@@ -65,15 +65,38 @@ mount -n -t devtmpfs devtmpfs /dev
6565
6666# get the root device, so we can find the boot partiton
6767UNPARSED=$(cmdline root)
68+ echo Unparsed cmdline rootdev: ${UNPARSED} > /dev/tty1
6869ROOT_PARTUUID=$(rootpartuuid $UNPARSED)
69- echo ${ROOT_PARTUUID} > /dev/tty1
70+ echo ROOT_PARTUUID: ${ROOT_PARTUUID} > /dev/tty1
71+
7072BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID )
71- echo ${BLKID} > /dev/tty1
73+ echo BLKID: ${BLKID} > /dev/tty1
74+ if [ -z "$BLKID" ]
75+ then
76+ echo BLKID wasnt found yet, give the kernel a moment... > /dev/tty1
77+ sleep 1
78+ BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID )
79+
80+ if [ -z "$BLKID" ]
81+ then
82+ echo BLKID still not found, give the kernel one more moment... > /dev/tty1
83+ sleep 1
84+ BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID )
85+
86+ if [ -z "$BLKID" ]
87+ then
88+ echo FAILED TO FIND BLKID AFTER 2 SECONDS, PLEASE OPEN AN ISSUE WITH A SCREENSHOT OF THIS ERROR > /dev/tty1
89+ rescue_shell
90+ fi
91+ fi
92+ fi
93+
94+ echo BLKID: ${BLKID} > /dev/tty1
95+
7296#If its an mmcblk device, the kernel partiton will p1. If it is a usb device, the partiton will just be 1
7397#Just want everything before the 1
7498ROOT_DEV="${BLKID%1:*}"
75-
76- echo ${ROOT_DEV} > /dev/tty1
99+ echo ROOT_DEV: ${ROOT_DEV} > /dev/tty1
77100
78101# label any partition on the system with RESCUESHELL to enter the initramfs rescue shell before mount and root_switch.
79102# you can do this with "cgpt add -i 1 -l RESCUESHELL /dev/sda" for example to label the first partiton of a usb drive.
0 commit comments