diff --git a/dracut-modules/90void-usb/create-loop0.sh b/dracut-modules/90void-usb/create-loop0.sh new file mode 100644 index 0000000..de151f1 --- /dev/null +++ b/dracut-modules/90void-usb/create-loop0.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +mknod --mode=660 /dev/loop0 b 7 0 diff --git a/dracut-modules/90void-usb/module-setup.sh b/dracut-modules/90void-usb/module-setup.sh new file mode 100644 index 0000000..2dd30ad --- /dev/null +++ b/dracut-modules/90void-usb/module-setup.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +check() { + return 0 +} + +depends() { + echo bash +} + +install() { + inst_hook pre-udev 90 "$moddir/create-loop0.sh" + inst_hook pre-mount 92 "$moddir/squashfs-img.sh" +} + +installkernel() { + instmods loop +} diff --git a/dracut-modules/90void-usb/squashfs-img.sh b/dracut-modules/90void-usb/squashfs-img.sh new file mode 100644 index 0000000..a9bf588 --- /dev/null +++ b/dracut-modules/90void-usb/squashfs-img.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/install-stage1.sh b/install-stage1.sh index e5f2c9e..6336355 100644 --- a/install-stage1.sh +++ b/install-stage1.sh @@ -193,11 +193,21 @@ echo "UUID=$(blkid --output value --match-tag UUID $TARGET_PART_BIG) /container echo '# Void USB dracut configuration hostonly="no" -omit_dracutmodules+=" nvdimm resume " compress="xz" + +add_dracutmodules+=" void-usb " +omit_dracutmodules+=" nvdimm resume " add_fstab+=" /opt/void-usb/initramfs-fstab "' > /mnt/target/etc/dracut.conf.d/99-void-usb.conf -# TODO: add dracut modules +#TODO: mount /container +mkdir -p /mnt/target/lib/dracut/modules.d/90void-usb +chmod 755 /mnt/target/lib/dracut/modules.d/90void-usb +wget --output-document=/mnt/target/lib/dracut/modules.d/90void-usb/module-setup.sh https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/dracut-modules/90void-usb/module-setup.sh +chmod 744 /mnt/target/lib/dracut/modules.d/90void-usb/module-setup.sh +wget --output-document=/mnt/target/lib/dracut/modules.d/90void-usb/create-loop0.sh https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/dracut-modules/90void-usb/create-loop0.sh +chmod 744 /mnt/target/lib/dracut/modules.d/90void-usb/create-loop0.sh +wget --output-document=/mnt/target/lib/dracut/modules.d/90void-usb/squashfs-img.sh https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/dracut-modules/90void-usb/squashfs-img.sh +chmod 744 /mnt/target/lib/dracut/modules.d/90void-usb/squashfs-img.sh wget --output-document=/mnt/target/opt/void-usb/backup-fs https://lostcave.ddnss.de/git/BodgeMaster/void-minecraft-usb/raw/branch/master/opt/backup-fs chmod 744 /mnt/target/opt/void-usb/backup-fs diff --git a/notes_to_self.txt b/notes_to_self.txt index cc7e31b..362bffb 100644 --- a/notes_to_self.txt +++ b/notes_to_self.txt @@ -36,12 +36,14 @@ f2fs for home boot setup + dracut configuration - root=/dev/loop0 ro - - custom dracut modules - - udev rule for /dev/loop0 + - custom dracut module + - pre-udev script + - make loop0 appear - pre-mount script - mount /container by UUID (possibly passed from a kernel command line parameter) - losetup the squashfs img - - do we need one to move over the /container mount to real root? + - pre-pivot script? + - do we need one to move over the /container mount to real root? - overlayfs gets mounted from fstab when backing up