aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/kbuild40
1 files changed, 38 insertions, 2 deletions
diff --git a/bin/kbuild b/bin/kbuild
index ffbcee8..1c7ed11 100755
--- a/bin/kbuild
+++ b/bin/kbuild
@@ -147,6 +147,9 @@ cat <<SCRIPT >"$INSTALL_PATH/install.sh"
set -ex
+##
+# Ensure you are root and dependencies are met.
+
if [ "\$EUID" -ne 0 ];then
echo "kbuild (error): run this as root."
exit 1
@@ -157,6 +160,9 @@ if [ ! -f /sbin/update-initramfs ] && [ ! -f /usr/bin/dracut ]; then
exit 1
fi
+##
+# Copy files into filesystem and generate initramfs.
+
cp -rv usr /
cp -rv boot /
@@ -168,6 +174,31 @@ else
update-initramfs -k $name -u
fi
+##
+# Configure /boot/extlinux/extlinux.conf by providing a default
+
+cat <<EXT >>/boot/extlinux/extlinux.conf
+###
+### NOTE: generated by kbuild.
+###
+
+label l1
+ menu label Debian GNU/Linux bookworm/sid $name
+ linux /vmlinuz-$name
+ initrd /initrd.img-$name
+
+ fdtdir /dtbs/$name
+ append root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
+
+label l1r
+ menu label Debian GNU/Linux bookworm/sid $name (rescue target)
+ linux /vmlinuz-$name
+ initrd /initrd.img-$name
+
+ fdtdir /dtbs/$name
+ append root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single
+EXT
+
if [ -z "\$EDITOR" ]; then
EDITOR=vi
fi
@@ -191,8 +222,13 @@ if [ ! -f files.txt ]; then
fi
xargs rm -f < files.txt
-rmdir /boot/dtbs/$name
-rmdir /usr/lib/modules/$name
+rm -r /boot/dtbs/$name
+rm -r /usr/lib/modules/$name
+
+if [ -z "\$EDITOR" ]; then
+ EDITOR=vi
+fi
+\$EDITOR /boot/extlinux/extlinux.conf
SCRIPT
##