Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Aug 19, 2022
1 parent 6d81511 commit 365e3e4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1-4
0.1-5
17 changes: 8 additions & 9 deletions root/usr/sbin/uncompress-kernel
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ VERSION="$2"
# Workaround Rockchip U-Boot issue where they cannot load gzip compressed kernel image

case $ACTION in
configure|'') : ;;
*) exit ;;
configure|'')
if file "$IMAGE" | grep -qi "gzip"
then
echo "Decompressing $IMAGE ..."
mv "$IMAGE" "$IMAGE.gz"
gunzip "$IMAGE.gz"
fi
;;
esac

if file "$IMAGE" | grep -qi "gzip"
then
echo "Decompressing $IMAGE ..."
mv "$IMAGE" "$IMAGE.gz"
gunzip "$IMAGE.gz"
fi
6 changes: 3 additions & 3 deletions root/usr/sbin/update-extlinux
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ VERSION="$2"
# Update extlinux.conf

case $ACTION in
configure|remove|'') : ;;
*) exit ;;
configure|remove|'') : ;;
*) exit ;;
esac

if ! source /etc/default/extlinux 2>/dev/null
Expand Down Expand Up @@ -58,7 +58,7 @@ done < <(linux-version list | linux-version sort --reverse)

if (( ${#FDTOVERLAYS[@]} != 0 ))
then
sed -i "s/#fdtoverlays/fdtoverlays/g" /boot/extlinux/extlinux.conf.new
sed -i "s/#fdtoverlays/fdtoverlays/g" /boot/extlinux/extlinux.conf.new
fi

mv /boot/extlinux/extlinux.conf.new /boot/extlinux/extlinux.conf
Expand Down
17 changes: 5 additions & 12 deletions root/usr/sbin/update-systemd-boot
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,22 @@ VERSION="$2"

# Update EFI boot entries for systemd-boot

case $ACTION in
configure|remove|'') : ;;
*) exit ;;
esac

if ! command -v efibootmgr >/dev/null
then
exit
fi

echo "Updating /boot/efi/$(cat /etc/machine-id) ..."

case "$MODE" in
postinst.d)
case $ACTION in
configure)
echo "Updating EFI entry for $ABI ..."
if [[ -z "$IMAGE" ]]
then
IMAGE="$(ls /boot/vmlinu*-$ABI)"
fi
kernel-install add "$ABI" "$IMAGE"
;;
postrm.d)
remove)
echo "Removing EFI entry for $ABI ..."
kernel-install remove "$ABI"
;;
sbin)
;;
esac

0 comments on commit 365e3e4

Please sign in to comment.