summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/mkefidisk.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 9275ecf17c..f8c08dd204 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -132,9 +132,7 @@ ROOTFS_START=$((BOOT_SIZE))
132ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) 132ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE))
133SWAP_START=$((ROOTFS_END)) 133SWAP_START=$((ROOTFS_END))
134 134
135# MMC devices are special in a couple of ways 135# MMC devices use a partition prefix character 'p'
136# 1) they use a partition prefix character 'p'
137# 2) they are detected asynchronously (need ROOTWAIT)
138PART_PREFIX="" 136PART_PREFIX=""
139if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then 137if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then
140 PART_PREFIX="p" 138 PART_PREFIX="p"
@@ -143,11 +141,9 @@ BOOTFS=$DEVICE${PART_PREFIX}1
143ROOTFS=$DEVICE${PART_PREFIX}2 141ROOTFS=$DEVICE${PART_PREFIX}2
144SWAP=$DEVICE${PART_PREFIX}3 142SWAP=$DEVICE${PART_PREFIX}3
145 143
146ROOTWAIT=""
147TARGET_PART_PREFIX="" 144TARGET_PART_PREFIX=""
148if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then 145if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then
149 TARGET_PART_PREFIX="p" 146 TARGET_PART_PREFIX="p"
150 ROOTWAIT="rootwait"
151fi 147fi
152TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 148TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2
153TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3 149TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3
@@ -250,10 +246,14 @@ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
250sed -i "/initrd /d" $GRUBCFG 246sed -i "/initrd /d" $GRUBCFG
251# Delete any LABEL= strings 247# Delete any LABEL= strings
252sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG 248sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
253# Replace the ramdisk root (if any) with the install device and include other 249# Remove any existing root= kernel parameters and:
254# kernel parameters 250# o Add a root= parameter with the target rootfs
251# o Specify ro so fsck can be run during boot
252# o Specify rootwait in case the target media is an asyncronous block device
253# such as MMC or USB disks
254# o Specify "quiet" to minimize boot time when using slow serial consoles
255sed -i "s@ root=[^ ]*@ @" $GRUBCFG 255sed -i "s@ root=[^ ]*@ @" $GRUBCFG
256sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro $ROOTWAIT quiet @" $GRUBCFG 256sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait quiet @" $GRUBCFG
257 257
258# Provide a startup.nsh script for older firmware with non-standard boot 258# Provide a startup.nsh script for older firmware with non-standard boot
259# directories and paths. 259# directories and paths.