mkimage: rebranding and prompt change

Change the prompt to instruct the end user to wait for the installer
instead of just "Press TAB for boot options". Hopefully more intuitive
now.

Rebrand to LE in the code also. :)
This commit is contained in:
Olli Salonen 2016-10-19 22:51:43 +03:00
parent 6e6cf890be
commit cbb43e568a

View File

@ -24,8 +24,8 @@
################################################################################ ################################################################################
# set variables # set variables
OE_TMP=$(mktemp -d) LE_TMP=$(mktemp -d)
SAVE_ERROR="$OE_TMP/save_error" SAVE_ERROR="$LE_TMP/save_error"
if [ -z "$SYSTEM_SIZE" -o -z "$SYSTEM_PART_START" ]; then if [ -z "$SYSTEM_SIZE" -o -z "$SYSTEM_PART_START" ]; then
echo "mkimage: SYSTEM_SIZE and SYSTEM_PART_START must be configured!" echo "mkimage: SYSTEM_SIZE and SYSTEM_PART_START must be configured!"
@ -40,7 +40,7 @@
# functions # functions
cleanup() { cleanup() {
echo "image: cleanup..." echo "image: cleanup..."
rm -rf "$OE_TMP" rm -rf "$LE_TMP"
echo echo
exit exit
} }
@ -125,8 +125,8 @@ fi
if [ "$BOOTLOADER" = "syslinux" ]; then if [ "$BOOTLOADER" = "syslinux" ]; then
# create bootloader configuration # create bootloader configuration
echo "image: creating bootloader configuration..." echo "image: creating bootloader configuration..."
cat << EOF > "$OE_TMP"/syslinux.cfg cat << EOF > "$LE_TMP"/syslinux.cfg
SAY Press <TAB> to edit options (installer, live, run) SAY Wait for installer to start or press <TAB> for more options (live, run)
DEFAULT installer DEFAULT installer
TIMEOUT 50 TIMEOUT 50
PROMPT 1 PROMPT 1
@ -145,7 +145,7 @@ LABEL run
EOF EOF
if [ "$PROJECT" = Virtual ]; then if [ "$PROJECT" = Virtual ]; then
cat << EOF > "$OE_TMP"/syslinux.cfg cat << EOF > "$LE_TMP"/syslinux.cfg
DEFAULT virtual DEFAULT virtual
TIMEOUT 50 TIMEOUT 50
PROMPT 0 PROMPT 0
@ -156,7 +156,7 @@ LABEL virtual
EOF EOF
fi fi
mcopy "$OE_TMP/syslinux.cfg" :: mcopy "$LE_TMP/syslinux.cfg" ::
# install extlinux # install extlinux
echo "image: installing extlinux to part1..." echo "image: installing extlinux to part1..."
@ -172,15 +172,15 @@ EOF
mmd EFI EFI/BOOT mmd EFI EFI/BOOT
mcopy $ROOT/$TOOLCHAIN/share/syslinux/bootx64.efi ::/EFI/BOOT mcopy $ROOT/$TOOLCHAIN/share/syslinux/bootx64.efi ::/EFI/BOOT
mcopy $ROOT/$TOOLCHAIN/share/syslinux/ldlinux.e64 ::/EFI/BOOT mcopy $ROOT/$TOOLCHAIN/share/syslinux/ldlinux.e64 ::/EFI/BOOT
mcopy "$OE_TMP"/syslinux.cfg ::/EFI/BOOT mcopy "$LE_TMP"/syslinux.cfg ::/EFI/BOOT
elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then
# create bootloader configuration # create bootloader configuration
echo "image: creating bootloader configuration..." echo "image: creating bootloader configuration..."
cat << EOF > "$OE_TMP"/cmdline.txt cat << EOF > "$LE_TMP"/cmdline.txt
boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet $EXTRA_CMDLINE boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet $EXTRA_CMDLINE
EOF EOF
mcopy "$OE_TMP/cmdline.txt" :: mcopy "$LE_TMP/cmdline.txt" ::
# copy files # copy files
echo "image: copying files to part1..." echo "image: copying files to part1..."
@ -271,35 +271,35 @@ fi # bootloader
echo "image: extracting part2 from image..." echo "image: extracting part2 from image..."
STORAGE_PART_COUNT=$(( $STORAGE_PART_END - $STORAGE_PART_START + 1 )) STORAGE_PART_COUNT=$(( $STORAGE_PART_END - $STORAGE_PART_START + 1 ))
sync sync
dd if="$DISK" of="$OE_TMP/part2.ext4" bs=512 skip="$STORAGE_PART_START" count="$STORAGE_PART_COUNT" conv=fsync >"$SAVE_ERROR" 2>&1 || show_error dd if="$DISK" of="$LE_TMP/part2.ext4" bs=512 skip="$STORAGE_PART_START" count="$STORAGE_PART_COUNT" conv=fsync >"$SAVE_ERROR" 2>&1 || show_error
# create filesystem on part2 # create filesystem on part2
echo "image: creating filesystem on part2..." echo "image: creating filesystem on part2..."
mke2fs -F -q -t ext4 -m 0 "$OE_TMP/part2.ext4" mke2fs -F -q -t ext4 -m 0 "$LE_TMP/part2.ext4"
tune2fs -U $UUID_STORAGE "$OE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error tune2fs -U $UUID_STORAGE "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
e2fsck -n "$OE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error e2fsck -n "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
sync sync
# add resize mark # add resize mark
mkdir "$OE_TMP/part2.fs" mkdir "$LE_TMP/part2.fs"
touch "$OE_TMP/part2.fs/.please_resize_me" touch "$LE_TMP/part2.fs/.please_resize_me"
echo "image: populating filesystem on part2..." echo "image: populating filesystem on part2..."
populatefs -U -d "$OE_TMP/part2.fs" "$OE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error populatefs -U -d "$LE_TMP/part2.fs" "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
sync sync
e2fsck -n "$OE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error e2fsck -n "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
# merge part2 back to disk image # merge part2 back to disk image
echo "image: merging part2 back to image..." echo "image: merging part2 back to image..."
dd if="$OE_TMP/part2.ext4" of="$DISK" bs=512 seek="$STORAGE_PART_START" conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error dd if="$LE_TMP/part2.ext4" of="$DISK" bs=512 seek="$STORAGE_PART_START" conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
# extract part1 from image to run fsck # extract part1 from image to run fsck
echo "image: extracting part1 from image..." echo "image: extracting part1 from image..."
SYSTEM_PART_COUNT=$(( $SYSTEM_PART_END - $SYSTEM_PART_START + 1 )) SYSTEM_PART_COUNT=$(( $SYSTEM_PART_END - $SYSTEM_PART_START + 1 ))
sync sync
dd if="$DISK" of="$OE_TMP/part1.fat" bs=512 skip="$SYSTEM_PART_START" count="$SYSTEM_PART_COUNT" conv=fsync >"$SAVE_ERROR" 2>&1 || show_error dd if="$DISK" of="$LE_TMP/part1.fat" bs=512 skip="$SYSTEM_PART_START" count="$SYSTEM_PART_COUNT" conv=fsync >"$SAVE_ERROR" 2>&1 || show_error
echo "image: checking filesystem on part1..." echo "image: checking filesystem on part1..."
fsck -n $OE_TMP/part1.fat >"$SAVE_ERROR" 2>&1 || show_error fsck -n $LE_TMP/part1.fat >"$SAVE_ERROR" 2>&1 || show_error
# create virtual images # create virtual images
if [ "$PROJECT" = Virtual ]; then if [ "$PROJECT" = Virtual ]; then