3.1 KiB
Install
bootvine always shows stage 2 and shutdown. To show the boot from the initrd as well, the initrd has to run systemd.
NixOS
-
Add the flake to your system flake's inputs and pass its module in:
{ inputs.bootvine = { url = "git+https://codeberg.org/wvhulle/bootvine"; inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { nixpkgs, bootvine, ... }: { nixosConfigurations.my-host = nixpkgs.lib.nixosSystem { modules = [ bootvine.nixosModules.default ./configuration.nix ]; }; }; } -
Enable it in
configuration.nix:{ services.bootvine.enable = true; }The initrd is a systemd initrd by default since NixOS 26.05, and the only kind after it. On NixOS 25.11 and earlier, also set
boot.initrd.systemd.enable = trueto show the boot from the initrd. -
Rebuild and reboot:
sudo nixos-rebuild switch --flake .#my-host
Ubuntu
-
Install the build dependencies and Rust:
sudo apt install build-essential pkg-config libdbus-1-dev git curl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -
Build bootvine into
~/.cargo/bin:cargo install --locked --git https://codeberg.org/wvhulle/bootvine bootvine -
Install it for the system and enable its units. It asks
sudoitself for the copying andsystemctl enable:bootvine installThis copies the binary to
/usr/bin/bootvine, andbootvine.serviceandbootvine-shutdown.serviceto/usr/lib/systemd/system, which is enough for stage 2 and shutdown. The copy in~/.cargo/binis no longer needed;cargo uninstall bootvineremoves it. -
Optionally, show the boot from the initrd. This needs a dracut initramfs with systemd in it; initramfs-tools has no systemd, so on releases that use it bootvine starts in stage 2 only.
bootvine install --initrd dracut sudo dracut --forceThis adds the dracut module in
/usr/lib/dracut/modules.d/90bootvineand enables it in/etc/dracut.conf.d/bootvine.conf. -
Reboot.
Other distributions
Install as in the Ubuntu steps, with your distribution's packages for a C
toolchain, pkg-config and the libdbus headers.
For the initrd, use the dracut module as above, or on mkinitcpio:
-
Install the hook in
/usr/lib/initcpio/install/sd-bootvine:bootvine install --initrd mkinitcpio -
Add
sd-bootvineaftersystemdinHOOKSin/etc/mkinitcpio.conf. -
Rebuild the initramfs:
sudo mkinitcpio -P
Packaging
bootvine install --destdir <dir> stages the files under <dir> instead of
the root, without sudo or systemctl, and combines with --initrd and
--prefix. The units' ExecStart follows --prefix. The initrd hooks expect
the default /usr.
Uninstall
bootvine uninstall disables and removes everything bootvine install put in
place, with the same --prefix and --destdir. On NixOS, remove
services.bootvine.enable and rebuild.