mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
bootloader: use labels defined by distro options
This commit is contained in:
parent
efe33a0a96
commit
e0c8006ae0
@ -69,6 +69,20 @@ makeinstall_target() {
|
||||
# Always install the update script
|
||||
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_FAT_VOLUME_LABEL/g" \
|
||||
-e "s/@DISK_LABEL@/$DISTRO_STORAGE_VOLUME_LABEL/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_FAT_VOLUME_LABEL/g" \
|
||||
-e "s/@DISK_LABEL@/$DISTRO_STORAGE_VOLUME_LABEL/g" \
|
||||
-i $INSTALL/usr/share/bootloader/boot.ini
|
||||
fi
|
||||
|
||||
# Always install the canupdate script
|
||||
if find_file_path bootloader/canupdate.sh; then
|
||||
cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
|
||||
|
@ -44,10 +44,10 @@ for arg in $(cat /proc/cmdline); do
|
||||
boot="${arg#*=}"
|
||||
case $boot in
|
||||
/dev/mmc*)
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $boot "LIBREELEC"
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $boot "@BOOT_LABEL@"
|
||||
;;
|
||||
LABEL=*)
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $($SYSTEM_ROOT/usr/sbin/findfs $boot) "LIBREELEC"
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $($SYSTEM_ROOT/usr/sbin/findfs $boot) "@BOOT_LABEL@"
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -91,10 +91,10 @@ for arg in $(cat /proc/cmdline); do
|
||||
disk="${arg#*=}"
|
||||
case $disk in
|
||||
/dev/mmc*)
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $disk "STORAGE"
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $disk "@DISK_LABEL@"
|
||||
;;
|
||||
LABEL=*)
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $($SYSTEM_ROOT/usr/sbin/findfs $disk) "STORAGE"
|
||||
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $($SYSTEM_ROOT/usr/sbin/findfs $disk) "@DISK_LABEL@"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------------------------------
|
||||
KHADAS-UBOOT-CONFIG
|
||||
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=LIBREELEC disk=LABEL=STORAGE"
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||
setenv condev "ttyS0,115200"
|
||||
setenv hdmimode "1080p60hz"
|
||||
setenv hdmioutput "1"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------------------------------
|
||||
KHADAS-UBOOT-CONFIG
|
||||
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=LIBREELEC disk=LABEL=STORAGE"
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||
setenv condev "ttyS0,115200"
|
||||
setenv hdmimode "1080p60hz"
|
||||
setenv hdmioutput "1"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------------------------------
|
||||
LIBRETECH-UBOOT-CONFIG
|
||||
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=LIBREELEC disk=LABEL=STORAGE"
|
||||
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||
setenv condev "ttyS0,115200"
|
||||
setenv hdmimode "1080p60hz"
|
||||
setenv hdmioutput "1"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------------------------------
|
||||
ODROIDC2-UBOOT-CONFIG
|
||||
|
||||
setenv bootrootfs "BOOT_IMAGE=KERNEL boot=LABEL=LIBREELEC disk=LABEL=STORAGE"
|
||||
setenv bootrootfs "BOOT_IMAGE=KERNEL boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||
setenv condev "ttyS0,115200"
|
||||
setenv hdmimode "1080p60hz"
|
||||
setenv hdmioutput "1"
|
||||
|
@ -89,4 +89,18 @@ 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_FAT_VOLUME_LABEL/g" \
|
||||
-e "s/@DISK_LABEL@/$DISTRO_STORAGE_VOLUME_LABEL/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_FAT_VOLUME_LABEL/g" \
|
||||
-e "s/@DISK_LABEL@/$DISTRO_STORAGE_VOLUME_LABEL/g" \
|
||||
-i $INSTALL/usr/share/bootloader/boot.ini
|
||||
fi
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user