handle both noraml and rescue boot
authorRalph Ronnquist <rrq@rrq.au>
Tue, 6 Feb 2024 09:23:19 +0000 (20:23 +1100)
committerRalph Ronnquist <rrq@rrq.au>
Tue, 6 Feb 2024 09:23:19 +0000 (20:23 +1100)
init-udevd.template

index 1e39fa183bdefac583bc4398bf21a5b391e847e6..43f2c2c2c6cc33945bc1c5731296fa2575e53202 100755 (executable)
@@ -1,22 +1,28 @@
 #!/bin/sh
 mount -t proc proc /proc
+echo "************************************************************" >&2
+cat /proc/cmdline >&2
+echo "************************************************************" >&2
+if grep -qw rescue /proc/cmdline ; then
+    cat <<EOF >&2
+ ____  _____ ____   ____ _   _ _____    ____   ___   ___ _____ 
+|  _ \| ____/ ___| / ___| | | | ____|  | __ ) / _ \ / _ \_   _|
+| |_) |  _| \___ \| |   | | | |  _|    |  _ \| | | | | | || |  
+|  _ <| |___ ___) | |___| |_| | |___   | |_) | |_| | |_| || |  
+|_| \_\_____|____/ \____|\___/|_____|  |____/ \___/ \___/ |_|  
+***************************************************************
+EOF
+else
+    umount /proc
+    exec /init.FS
+fi
+
 mount -t sysfs sysfs /sys
 mount -t devtmpfs devtmpfs /dev
 mkdir /dev/pts
 mount -t devpts devpts /dev/pts
-
-#MODULES=" \
-#scsi_mod sd_mod ata_piix \
-#crc32c ext4 \
-#nls_ascii nls_cp437 vfat fat \
-#"
-#for m in $MODULES ; do modprobe $m ; done
-
-cat <<EOF | /bin/sh > udev.log 2>&1
-udevd -d -D
-udevadm trigger -c add -v
-EOF
-
-cat message.txt
-
+udevd -d -c 500 --resolve-names=never
+udevadm trigger -c add
+udevadm settle
+cat message.txt >&2
 exec setsid cttyhack sh