mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #3071 from MilhouseVH/le90_fix_arch_incompat_with_uuids
Amlogic/update.sh: fix issues with binary compatability using UUIDs
This commit is contained in:
commit
16678f67cc
@ -52,20 +52,6 @@ makeinstall_target() {
|
|||||||
# Always install the update script
|
# Always install the update script
|
||||||
find_file_path bootloader/update.sh && cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
|
find_file_path bootloader/update.sh && cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Always install the canupdate script
|
# Always install the canupdate script
|
||||||
if find_file_path bootloader/canupdate.sh; then
|
if find_file_path bootloader/canupdate.sh; then
|
||||||
cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
|
cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
|
||||||
|
@ -18,7 +18,11 @@ if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/boot.ini" ]; then
|
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
|
fi
|
||||||
|
|
||||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/config.ini" ]; then
|
if [ -f "$RELEASE_DIR/3rdparty/bootloader/config.ini" ]; then
|
||||||
|
@ -6,8 +6,10 @@
|
|||||||
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
||||||
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
||||||
[ -z "$UPDATE_DIR" ] && UPDATE_DIR="/storage/.update"
|
[ -z "$UPDATE_DIR" ] && UPDATE_DIR="/storage/.update"
|
||||||
|
|
||||||
UPDATE_DTB_IMG="$UPDATE_DIR/dtb.img"
|
UPDATE_DTB_IMG="$UPDATE_DIR/dtb.img"
|
||||||
UPDATE_DTB=`ls -1 "$UPDATE_DIR"/*.dtb 2>/dev/null | head -n 1`
|
UPDATE_DTB="$(ls -1 "$UPDATE_DIR"/*.dtb 2>/dev/null | head -n 1)"
|
||||||
|
|
||||||
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
||||||
if [ -z "$BOOT_DISK" ]; then
|
if [ -z "$BOOT_DISK" ]; then
|
||||||
case $BOOT_PART in
|
case $BOOT_PART in
|
||||||
@ -25,14 +27,13 @@ mount -o rw,remount $BOOT_ROOT
|
|||||||
for arg in $(cat /proc/cmdline); do
|
for arg in $(cat /proc/cmdline); do
|
||||||
case $arg in
|
case $arg in
|
||||||
boot=*)
|
boot=*)
|
||||||
echo "Updating BOOT partition label..."
|
|
||||||
boot="${arg#*=}"
|
boot="${arg#*=}"
|
||||||
case $boot in
|
case $boot in
|
||||||
/dev/mmc*)
|
/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=*)
|
UUID=*|LABEL=*)
|
||||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $($SYSTEM_ROOT/usr/sbin/findfs $boot) "@BOOT_LABEL@"
|
BOOT_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $boot " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -71,15 +72,15 @@ for arg in $(cat /proc/cmdline); do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
disk=*)
|
disk=*)
|
||||||
echo "Updating DISK partition label..."
|
|
||||||
disk="${arg#*=}"
|
disk="${arg#*=}"
|
||||||
case $disk in
|
case $disk in
|
||||||
/dev/mmc*)
|
/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=*)
|
UUID=*|LABEL=*)
|
||||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $($SYSTEM_ROOT/usr/sbin/findfs $disk) "@DISK_LABEL@"
|
DISK_UUID="$(blkid | sed 's/"//g' | grep -m 1 -i " $disk " | sed 's/.* UUID=//;s/ .*//g')"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
@ -94,6 +95,10 @@ fi
|
|||||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.ini ]; then
|
if [ -f $SYSTEM_ROOT/usr/share/bootloader/boot.ini ]; then
|
||||||
echo "Updating boot.ini..."
|
echo "Updating boot.ini..."
|
||||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/boot.ini $BOOT_ROOT/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 $SYSTEM_ROOT/usr/share/bootloader/config.ini ]; then
|
||||||
if [ ! -f $BOOT_ROOT/config.ini ]; then
|
if [ ! -f $BOOT_ROOT/config.ini ]; then
|
||||||
echo "Creating config.ini..."
|
echo "Creating config.ini..."
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
KHADAS-UBOOT-CONFIG
|
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 condev "ttyS0,115200"
|
||||||
setenv hdmimode "1080p60hz"
|
setenv hdmimode "1080p60hz"
|
||||||
setenv hdmioutput "1"
|
setenv hdmioutput "1"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
KHADAS-UBOOT-CONFIG
|
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 condev "ttyS0,115200"
|
||||||
setenv hdmimode "1080p60hz"
|
setenv hdmimode "1080p60hz"
|
||||||
setenv hdmioutput "1"
|
setenv hdmioutput "1"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
LIBRETECH-UBOOT-CONFIG
|
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 condev "ttyS0,115200"
|
||||||
setenv hdmimode "1080p60hz"
|
setenv hdmimode "1080p60hz"
|
||||||
setenv hdmioutput "1"
|
setenv hdmioutput "1"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
ODROIDC2-UBOOT-CONFIG
|
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 condev "ttyS0,115200"
|
||||||
setenv hdmimode "1080p60hz"
|
setenv hdmimode "1080p60hz"
|
||||||
setenv hdmioutput "1"
|
setenv hdmioutput "1"
|
||||||
|
@ -73,18 +73,4 @@ makeinstall_target() {
|
|||||||
cp -av $PKG_BUILD/fip/u-boot.bin.sd.bin $INSTALL/usr/share/bootloader/u-boot
|
cp -av $PKG_BUILD/fip/u-boot.bin.sd.bin $INSTALL/usr/share/bootloader/u-boot
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user