Amlogic/update.sh: fix arch binary incompatibility; switch to uuids

This commit is contained in:
MilhouseVH 2018-10-29 14:46:53 +00:00
parent e73037faf4
commit d7872430ee
7 changed files with 20 additions and 27 deletions

View File

@ -18,7 +18,11 @@ if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot" ]; then
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then
mcopy $RELEASE_DIR/3rdparty/bootloader/boot.ini ::
cp -p "$RELEASE_DIR/3rdparty/bootloader/boot.ini" "$LE_TMP/boot.ini"
sed -e "s/@BOOT_UUID@/$UUID_SYSTEM/" \
-e "s/@DISK_UUID@/$UUID_STORAGE/" \
-i "$LE_TMP/boot.ini"
mcopy "$LE_TMP/boot.ini" ::
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/config.ini" ]; then

View File

@ -27,14 +27,13 @@ mount -o rw,remount $BOOT_ROOT
for arg in $(cat /proc/cmdline); do
case $arg in
boot=*)
echo "Updating BOOT partition label..."
boot="${arg#*=}"
case $boot in
/dev/mmc*)
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $boot "@BOOT_LABEL@"
BOOT_UUID="$(blkid $boot | sed 's/.* UUID="//;s/".*//g')"
;;
LABEL=*)
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $($SYSTEM_ROOT/usr/sbin/findfs $boot) "@BOOT_LABEL@"
UUID=*|LABEL=*)
BOOT_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
;;
esac
@ -73,15 +72,15 @@ for arg in $(cat /proc/cmdline); do
fi
done
;;
disk=*)
echo "Updating DISK partition label..."
disk="${arg#*=}"
case $disk in
/dev/mmc*)
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $disk "@DISK_LABEL@"
DISK_UUID="$(blkid $disk | sed 's/.* UUID="//;s/".*//g')"
;;
LABEL=*)
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $($SYSTEM_ROOT/usr/sbin/findfs $disk) "@DISK_LABEL@"
UUID=*|LABEL=*)
DISK_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
;;
esac
;;
@ -96,6 +95,10 @@ fi
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.ini ]; then
echo "Updating boot.ini..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/boot.ini $BOOT_ROOT/boot.ini
sed -e "s/@BOOT_UUID@/$BOOT_UUID/" \
-e "s/@DISK_UUID@/$DISK_UUID/" \
-i $BOOT_ROOT/boot.ini
if [ -f $SYSTEM_ROOT/usr/share/bootloader/config.ini ]; then
if [ ! -f $BOOT_ROOT/config.ini ]; then
echo "Creating config.ini..."

View File

@ -8,7 +8,7 @@
#------------------------------------------------------------------------------------------------------
KHADAS-UBOOT-CONFIG
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@"
setenv condev "ttyS0,115200"
setenv hdmimode "1080p60hz"
setenv hdmioutput "1"

View File

@ -8,7 +8,7 @@
#------------------------------------------------------------------------------------------------------
KHADAS-UBOOT-CONFIG
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@"
setenv condev "ttyS0,115200"
setenv hdmimode "1080p60hz"
setenv hdmioutput "1"

View File

@ -8,7 +8,7 @@
#------------------------------------------------------------------------------------------------------
LIBRETECH-UBOOT-CONFIG
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@"
setenv condev "ttyS0,115200"
setenv hdmimode "1080p60hz"
setenv hdmioutput "1"

View File

@ -8,7 +8,7 @@
#------------------------------------------------------------------------------------------------------
ODROIDC2-UBOOT-CONFIG
setenv bootrootfs "BOOT_IMAGE=KERNEL boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
setenv bootrootfs "BOOT_IMAGE=KERNEL boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@"
setenv condev "ttyS0,115200"
setenv hdmimode "1080p60hz"
setenv hdmioutput "1"

View File

@ -73,18 +73,4 @@ makeinstall_target() {
cp -av $PKG_BUILD/fip/u-boot.bin.sd.bin $INSTALL/usr/share/bootloader/u-boot
;;
esac
# Replace partition names in update.sh
if [ -f "$INSTALL/usr/share/bootloader/update.sh" ] ; then
sed -e "s/@BOOT_LABEL@/$DISTRO_BOOTLABEL/g" \
-e "s/@DISK_LABEL@/$DISTRO_DISKLABEL/g" \
-i $INSTALL/usr/share/bootloader/update.sh
fi
# Replace labels in boot.ini
if [ -f "$INSTALL/usr/share/bootloader/boot.ini" ] ; then
sed -e "s/@BOOT_LABEL@/$DISTRO_BOOTLABEL/g" \
-e "s/@DISK_LABEL@/$DISTRO_DISKLABEL/g" \
-i $INSTALL/usr/share/bootloader/boot.ini
fi
}