{"id":13602303,"url":"https://github.com/random-archer/mkinitcpio-systemd-tool","last_synced_at":"2026-03-05T05:32:02.321Z","repository":{"id":45609031,"uuid":"59916137","full_name":"random-archer/mkinitcpio-systemd-tool","owner":"random-archer","description":"Provisioning tool for systemd in initramfs (systemd-tool)","archived":false,"fork":false,"pushed_at":"2025-11-22T13:57:01.000Z","size":184,"stargazers_count":122,"open_issues_count":22,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-11-22T15:20:24.537Z","etag":null,"topics":["archlinux","btrfs","cryptsetup","dropbear","initramfs","initrd","initrd-units","lvm","mkinitcpio","mkinitcpio-hook","mkinitcpio-systemd","nftables","password-agent","plymouth","provision","ssh","systemd","systemd-service","tinysshd","zfs"],"latest_commit_sha":null,"homepage":"https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/random-archer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2016-05-28T22:00:58.000Z","updated_at":"2025-11-22T13:50:15.000Z","dependencies_parsed_at":"2023-01-30T04:00:35.122Z","dependency_job_id":"362c26ee-7026-44ad-aee7-c510bd450f89","html_url":"https://github.com/random-archer/mkinitcpio-systemd-tool","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/random-archer/mkinitcpio-systemd-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-archer%2Fmkinitcpio-systemd-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-archer%2Fmkinitcpio-systemd-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-archer%2Fmkinitcpio-systemd-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-archer%2Fmkinitcpio-systemd-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/random-archer","download_url":"https://codeload.github.com/random-archer/mkinitcpio-systemd-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-archer%2Fmkinitcpio-systemd-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30111743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["archlinux","btrfs","cryptsetup","dropbear","initramfs","initrd","initrd-units","lvm","mkinitcpio","mkinitcpio-hook","mkinitcpio-systemd","nftables","password-agent","plymouth","provision","ssh","systemd","systemd-service","tinysshd","zfs"],"created_at":"2024-08-01T18:01:19.717Z","updated_at":"2026-03-05T05:32:02.295Z","avatar_url":"https://github.com/random-archer.png","language":"Python","funding_links":[],"categories":["archlinux"],"sub_categories":[],"readme":"##### This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool\n\n## mkinitcpio-systemd-tool\n\n\u003c!--\n[![Master Status](https://dev.azure.com/random-archer/mkinitcpio-systemd-tool/_apis/build/status/random-archer.mkinitcpio-systemd-tool?branchName=master)](https://dev.azure.com/random-archer/mkinitcpio-systemd-tool/_build/latest?definitionId=1\u0026branchName=master)\n--\u003e\n\n### Summary\n\n\u003cdetails\u003e\n\u003csummary\u003e\n  \u003cb\u003eNever write another mkinitcpio hook again: use systemd-tool.\u003c/b\u003e\n\u003c/summary\u003e\n\u003cbr/\u003e\n\nProvisioning tool for systemd in initramfs (systemd-tool):\n\n#### mkinitcpio hook name: `systemd-tool`\n\nCore features provided by the hook:\n* unified systemd + mkinitcpio configuration\n* automatic provisioning of binary and config resources\n* on-demand invocation of mkinitcpio scripts and in-line functions\n\nFeatures provided by the included service units:\n* initrd debugging\n* early network setup\n* interactive user shell\n* remote ssh access in initrd\n* cryptsetup + plymouth support\n* cryptsetup + custom password agent\n\n\u003c/details\u003e\n\n### Issues\n\nUseful issues [resolved in the past](https://github.com/random-archer/mkinitcpio-systemd-tool/wiki)\n\n### Example\n\nBasic usage steps:\n\n1) study and practice [system recovery](https://github.com/random-archer/mkinitcpio-systemd-tool/wiki/System-Recovery)\u003cbr/\u003e\n\n2) install the package\n```\npacman -S mkinitcpio-systemd-tool\n```\n\n3) activate required hooks in `/etc/mkinitcpio.conf`:\n```\nHOOKS=(base ... systemd systemd-tool)\n```\n\n4) configure, override and enable/disable [provided units](https://github.com/random-archer/mkinitcpio-systemd-tool/tree/master/src), for example: \u003cbr/\u003e\nfor remote unlocking of luks root with `cryptsetup` and `tinysshd` use:\n```\nedit /etc/mkinitcpio-systemd-tool/config/crypttab\nedit /etc/mkinitcpio-systemd-tool/config/fstab\nsystemctl enable initrd-cryptsetup.path\nsystemctl enable initrd-tinysshd.service\nsystemctl enable initrd-debug-progs.service\nsystemctl enable initrd-sysroot-mount.service\n```\n\n5) build image, review content and finally reboot:\n```\nmkinitcpio -v -p linux \u003e /tmp/initrd.log\nlsinitcpio -l /boot/initramfs-linux.img | grep initrd\nsystemctl reboot\n```\n\n### Install Details\n\n`pacman` install actions:\n* take a look in [arch repo](https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/mkinitcpio-systemd-tool)\n  and [make file](https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/Makefile)\n* provision user config and vendor systemd units into:\n* `/etc/mkinitcpio-systemd-tool` (with backup)\n* `/usr/lib/systemd/system` (with silent overwrite)\n\n`mkinitcpio` install hook actions:\n* look for enabled units in the `/etc/systemd/system`\n* include in initrd units containing marker `/etc/initrd-release`\n* activate transitively in initrd any discovered systemd service units\n* auto provision into initramfs resources declared inside initrd service units\n\n### Provisioning Questions and Answers\n\nwhat is the mkinitcpio hook entry provided by this package?\n* hook name: `systemd-tool`\n* required hooks are: `base systemd systemd-tool`\n* recommended hooks are: `base autodetect modconf block filesystems keyboard fsck systemd systemd-tool`\n\nhow can I customize installed service units?\n* follow regular approaches to [editing provided units](https://wiki.archlinux.org/index.php/systemd#Editing_provided_units)\n* create service unit override with `systemctl edit $unit_name`\n* enable/disable with `systemctl enable $unit_name` / `systemctl disable $unit_name`\n\nhow can I review generated `/boot/initramfs-linux.img`?\n* to review `initramfs.img` after `mkinitcpio` but before `reboot`, use:\n* visually, with [midnight commander](https://www.archlinux.org/packages/community/x86_64/mc/)\n  or scripted, with [mkinitcpio lsinitcpio](https://wiki.archlinux.org/index.php/Mkinitcpio#Extracting_the_image)\n\nhow systemd unit transitive dependency provisioning works?\n* see `mkinitcpio-install.sh/add_systemd_unit_X()`\n* units found in `[Unit]/Requires|OnFailure` are recursively installed\n\nwhat is the purpose of `[X-SystemdTool]` section in service unit files?\n* see https://github.com/systemd/systemd/issues/3340\n* this section provides configuration interface for `mkinitcpio` provisioning actions\n* directives: `InitrdPath` `InitrdLink` `InitrdBinary` `InitrdBuild` `InitrdCall` `InitrdUnit`\n\nhow can I auto-provision my custom service unit binaries into initramfs?\n* use `InitrdBinary=/path/target-exec` to provision service binary\n* also will be provisioned all `Exec*` entries such as `ExecStart=/usr/bin/program`\n\nhow can I auto-provision my custom service unit resources into initramfs?\n* use `InitrdPath=/path/to/host/folder-or-file`\n\nhow can I relocate folder during provisioning?\n* not implemented, source and target folder must use the same location\n\nhow can I relocate file and/or change file mode during provisioning?\n* use `InitrdPath=/target-file source=/source-file mode=NNN`\n\nhow can I filter directory content during provisioning?\n* use `InitrdPath=/target-folder glob=*.example`\n\nhow can I provision optional folder or file?\n* use `InitrdPath=/target-file source=/source-file optional=yes`\n\nis there a way to create empty folder or file?\n* for empty dir, use `InitrdPath=/path/target-dir/ create=yes` note trailing SLASH\n* for empty file, use `InitrdPath=/path/target-file create=yes` note NO trailing slash\n\nhow can I provision a symbolic link?\n* use `InitrdLink=/path-to-link/link-name target=/path-to-target/target-name`\n* note that link target `/path-to-target/target-name` must be provisioned separately\n\ncan I invoke a provisioning script related to my service during mkinitcpio build time?\n* use `InitrdBuild=/path-to/script.sh command=function_name`\n\ncan I call a little provisioning script snippet during mkinitcpio build time?\n* check for available `mkinitcpio` functions in `/usr/lib/initcpio/functions.sh`\n* use `InitrdCall=inline-bash-code-here` to call these functions\n\nhow can I provide custom interactive user shell for ssh client\n* change sample shell file located in `/usr/lib/mkinitcpio-systemd-tool/initrd-shell.sh`\n\nwhich ssh user keys are used by initramfs sshd server(s)?\n* they come from host `/etc/mkinitcpio-systemd-tool/config/authorized_keys`\n\n### Shell Script Questions and Answers\n\nthere is a `initrd-shell.sh` script provided, what does it do?\n* it is used as both interactive login shell and as a systemd service\n* when crypto disks are present, it acts as password agent\n* when in ssh console, it offers simple interactive menu\n* when in systemd service mode, it acts as service\n\nhow can I review `initrd-shell.sh` actions during last boot?\n* use `journalctl -b -t shell`\n\nwhat does `CTRL-C` do to `initrd-shell.sh` in different modes?\n* `initrd-shell.sh` provides appropriate reaction to interrupt, depending on the context\n* while in `ssh` terminal password agent prompt, it will start a menu form `initrd-shell.sh`\n* while in `/dev/tty` local debug console, it will exit from `initrd-shell.sh`\n* while in `/dev/console` password agent prompt, it will restart the `initrd-shell.sh` service\n\nis there a silent or no-echo mode during password entry in `initrd-shell.sh`?\n* there are two ways to enter silent mode (see `systemd-ask-password.c`):\n* either by pressing `BACKSPACE` as first key or by pressing `TAB` at any time\n* then the prompt will show extra text: `(no echo)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-archer%2Fmkinitcpio-systemd-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandom-archer%2Fmkinitcpio-systemd-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-archer%2Fmkinitcpio-systemd-tool/lists"}