{"id":20802280,"url":"https://github.com/siduction/kpmcore","last_synced_at":"2026-04-18T10:03:00.595Z","repository":{"id":100555639,"uuid":"371476521","full_name":"siduction/kpmcore","owner":"siduction","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-27T19:02:07.000Z","size":338,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-25T22:33:45.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siduction.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.GPL3","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-27T19:01:51.000Z","updated_at":"2021-05-27T22:10:53.000Z","dependencies_parsed_at":"2023-05-15T21:30:40.729Z","dependency_job_id":null,"html_url":"https://github.com/siduction/kpmcore","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"3e4ce5bc515779a626295b2d5b886ab50fce60d7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/siduction/kpmcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siduction%2Fkpmcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siduction%2Fkpmcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siduction%2Fkpmcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siduction%2Fkpmcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siduction","download_url":"https://codeload.github.com/siduction/kpmcore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siduction%2Fkpmcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31964547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T18:29:24.006Z","updated_at":"2026-04-18T10:02:55.559Z","avatar_url":"https://github.com/siduction.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KPMcore\n\n\u003e KPMcore, the KDE Partition Manager core, is a library for examining\n\u003e and modifying partitions, disk devices, and filesystems on a\n\u003e Linux system. It provides a unified programming interface over\n\u003e top of (external) system-manipulation tools.\n\nKPMcore is a library for examining and manipulating all facets\nof storage devices on a system:\n* raw disk devices\n* partition tables on a device\n* filesystems within a partition\n\nThere are multiple backends so that KPMcore can support different\noperating systems, although the only functional backend is the\none for Linux systems:\n* sfdisk backend (Linux)\n* null backend\n\n## Using KPMcore\n\nMost of the usage information on KPMcore is included in the API\ndocumentation; this section contains only high-level usage information.\n\n### Finding KPMcore with CMake\n\nKPMcore supports CMake as (meta-)build system and installs suitable\nCMake support files. Typical use of of KPMcore in a `CMakeLists.txt`\nlooks like this:\n\n```\n    find_package( KPMcore 3.2 REQUIRED )\n    include_directories( ${KPMCORE_INCLUDE_DIR} )\n    target_link_libraries( target kpmcore )\n```\n\nThere are no imported targets defined for KPMcore.\n\n### Initialization\n\nAn application must initialize the library and load a suitable\nbackend before using KPMcore functions. By convention, the\nenvironment variable `KPMCORE_BACKEND` names a backend,\nand typical initialization code will look like this (or use the\nclass `KPMCoreInitializer` from `test/helpers.h`):\n\n```\n    #include \u003cbackend/corebackendmanager.h\u003e\n    #include \u003cQDebug\u003e\n\n    bool initKPMcore()\n    {\n        static bool inited = false;\n        if ( inited ) return true;\n\n        QByteArray env = qgetenv( \"KPMCORE_BACKEND\" );\n        auto backendName = env.isEmpty() ? CoreBackendManager::defaultBackendName() : env;\n        if ( !CoreBackendManager::self()-\u003eload( backendName )\n        {\n            qWarning() \u003c\u003c \"Failed to load backend plugin\" \u003c\u003c backendName;\n            return false;\n        }\n        inited = true;\n        return true;\n    }\n```\n\nThis code uses the environment variable if set, and otherwise falls\nback to a default backend suitable for the current platform.\n\nCalling KPMcore functions before the library is initialized will\nresult in undefined behavior.\n\n### Devices\n\nAfter the backend is initialized you can scan for available devices.\nIf you only want devices from the loaded backend you can call\n\n```\n    QList\u003cDevice*\u003e devices = backend-\u003escanDevices( excludeReadOnly );\n```\n\nwhere `bool` option `excludeReadOnly` specifies whether to exclude\nread only devices.\n\n#### KPMcore device scanner\n\nAlternatively, you can use KPMcore device scanner\n\n```\n    #include \u003ccore/device.h\u003e\n    #include \u003ccore/devicescanner.h\u003e\n    #include \u003ccore/operationstack.h\u003e\n\n    // First create operationStack with another QObject as parent, we will use nullptr here.\n    OperationStack *operationStack = new OperationStack(nullptr);\n    DeviceScanner *deviceScanner = new DeviceScanner(nullptr, *operationStack);\n    deviceScanner-\u003escan(); // use start() for scanning in the background thread\n    QList\u003cDevice*\u003e devices = operationStack-\u003epreviewDevices();\n```\n\nThen `deviceScanner` scans for the devices in a background thread. After\nscanning is complete `DeviceScanner::finished()` signal will be emitted.\nThen the devices can accessed using `operationStack-\u003epreviewDevices()`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiduction%2Fkpmcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiduction%2Fkpmcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiduction%2Fkpmcore/lists"}