Skip to content

Commit

Permalink
Support /boot mount for update-extlinux.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Apr 5, 2020
1 parent 09bb293 commit a9c7e96
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions root/usr/local/sbin/update-extlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,31 @@ emit_kernel() {
local NAME="$3"

echo "label kernel-$VERSION$NAME"
echo " kernel /boot/vmlinuz-$VERSION"
echo " kernel $MOUNT_PREFIX/vmlinuz-$VERSION"
if [[ -f "/boot/initrd.img-$VERSION" ]]; then
echo " initrd /boot/initrd.img-$VERSION"
echo " initrd $MOUNT_PREFIX/initrd.img-$VERSION"
fi
if [[ -f "/boot/dtb-$VERSION" ]]; then
echo " fdt /boot/dtb-$VERSION"
echo " fdt $MOUNT_PREFIX/dtb-$VERSION"
else
if [[ ! -d "/boot/dtbs/$VERSION" ]]; then
mkdir -p /boot/dtbs
cp -au "/usr/lib/linux-image-$VERSION" "/boot/dtbs/$VERSION"
fi
echo " devicetreedir /boot/dtbs/$VERSION"
echo " devicetreedir $MOUNT_PREFIX/dtbs/$VERSION"
fi
echo " append $APPEND"
echo ""
}

if findmnt /boot >/dev/null; then
# If we have `/boot` the files are in `/`
MOUNT_PREFIX=
else
# If we don't have `/boot` mount the files are in `/boot`
MOUNT_PREFIX=/boot
fi

linux-version list | linux-version sort --reverse | while read VERSION; do
emit_kernel "$VERSION" "$APPEND"
emit_kernel "$VERSION" "$APPEND memtest" "-memtest"
Expand Down

0 comments on commit a9c7e96

Please sign in to comment.