mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #2730 from ToKe79/le9-part_labels
Move partition labels to distro options
This commit is contained in:
commit
4807527dc3
@ -210,3 +210,7 @@
|
|||||||
|
|
||||||
# Default supported get handlers (archive, git, file etc.)
|
# Default supported get handlers (archive, git, file etc.)
|
||||||
GET_HANDLER_SUPPORT="archive"
|
GET_HANDLER_SUPPORT="archive"
|
||||||
|
|
||||||
|
# Partition labels for USB/SD installation media
|
||||||
|
DISTRO_BOOTLABEL="LIBREELEC"
|
||||||
|
DISTRO_DISKLABEL="STORAGE"
|
||||||
|
@ -218,6 +218,9 @@ makeinstall_init() {
|
|||||||
|
|
||||||
if find_file_path initramfs/platform_init; then
|
if find_file_path initramfs/platform_init; then
|
||||||
cp ${FOUND_PATH} $INSTALL
|
cp ${FOUND_PATH} $INSTALL
|
||||||
|
sed -e "s/@BOOT_LABEL@/$DISTRO_BOOTLABEL/g" \
|
||||||
|
-e "s/@DISK_LABEL@/$DISTRO_DISKLABEL/g" \
|
||||||
|
-i $INSTALL/platform_init
|
||||||
chmod 755 $INSTALL/platform_init
|
chmod 755 $INSTALL/platform_init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -69,6 +69,20 @@ 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
|
||||||
|
@ -44,10 +44,10 @@ for arg in $(cat /proc/cmdline); do
|
|||||||
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 "LIBREELEC"
|
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/fatlabel $boot "@BOOT_LABEL@"
|
||||||
;;
|
;;
|
||||||
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
|
esac
|
||||||
|
|
||||||
@ -91,10 +91,10 @@ for arg in $(cat /proc/cmdline); do
|
|||||||
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 "STORAGE"
|
LD_LIBRARY_PATH="$SYSTEM_ROOT/lib" $SYSTEM_ROOT/usr/sbin/e2label $disk "@DISK_LABEL@"
|
||||||
;;
|
;;
|
||||||
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
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#------------------------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------------------------
|
||||||
KHADAS-UBOOT-CONFIG
|
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 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=LIBREELEC disk=LABEL=STORAGE"
|
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||||
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=LIBREELEC disk=LABEL=STORAGE"
|
setenv bootrootfs "BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||||
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=LIBREELEC disk=LABEL=STORAGE"
|
setenv bootrootfs "BOOT_IMAGE=KERNEL boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||||
setenv condev "ttyS0,115200"
|
setenv condev "ttyS0,115200"
|
||||||
setenv hdmimode "1080p60hz"
|
setenv hdmimode "1080p60hz"
|
||||||
setenv hdmioutput "1"
|
setenv hdmioutput "1"
|
||||||
|
@ -44,7 +44,7 @@ done
|
|||||||
if [ -z "$BOOT_IMAGE" -o -z "$boot" -o -z "$disk" ]; then
|
if [ -z "$BOOT_IMAGE" -o -z "$boot" -o -z "$disk" ]; then
|
||||||
cmdline=$(cat /proc/cmdline)
|
cmdline=$(cat /proc/cmdline)
|
||||||
if [ -n "$bootfromext" ]; then
|
if [ -n "$bootfromext" ]; then
|
||||||
cmdline="$cmdline BOOT_IMAGE=kernel.img boot=LABEL=LIBREELEC disk=LABEL=STORAGE"
|
cmdline="$cmdline BOOT_IMAGE=kernel.img boot=LABEL=@BOOT_LABEL@ disk=LABEL=@DISK_LABEL@"
|
||||||
else
|
else
|
||||||
cmdline="$cmdline BOOT_IMAGE=/dev/boot boot=/dev/system disk=/dev/data"
|
cmdline="$cmdline BOOT_IMAGE=/dev/boot boot=/dev/system disk=/dev/data"
|
||||||
fi
|
fi
|
||||||
|
@ -89,4 +89,18 @@ 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
|
||||||
}
|
}
|
||||||
|
@ -71,8 +71,6 @@ trap cleanup SIGINT
|
|||||||
UUID_2=$(date '+%M%S')
|
UUID_2=$(date '+%M%S')
|
||||||
FAT_SERIAL_NUMBER="${UUID_1}${UUID_2}"
|
FAT_SERIAL_NUMBER="${UUID_1}${UUID_2}"
|
||||||
UUID_SYSTEM="${UUID_1}-${UUID_2}"
|
UUID_SYSTEM="${UUID_1}-${UUID_2}"
|
||||||
FAT_VOLUME_LABEL="LIBREELEC"
|
|
||||||
STORAGE_VOLUME_LABEL="STORAGE"
|
|
||||||
|
|
||||||
# create an image
|
# create an image
|
||||||
echo
|
echo
|
||||||
@ -129,7 +127,7 @@ fi
|
|||||||
alias mmd="mmd -i $DISK@@$OFFSET"
|
alias mmd="mmd -i $DISK@@$OFFSET"
|
||||||
|
|
||||||
if [ "$BOOTLOADER" = "syslinux" -o "$BOOTLOADER" = "bcm2835-bootloader" -o "$BOOTLOADER" = "u-boot" ]; then
|
if [ "$BOOTLOADER" = "syslinux" -o "$BOOTLOADER" = "bcm2835-bootloader" -o "$BOOTLOADER" = "u-boot" ]; then
|
||||||
mformat -v "$FAT_VOLUME_LABEL" -N "$FAT_SERIAL_NUMBER" ::
|
mformat -v "$DISTRO_BOOTLABEL" -N "$FAT_SERIAL_NUMBER" ::
|
||||||
fi
|
fi
|
||||||
sync
|
sync
|
||||||
|
|
||||||
@ -277,7 +275,7 @@ fi # bootloader
|
|||||||
# create filesystem on part2
|
# create filesystem on part2
|
||||||
echo "image: creating filesystem on part2..."
|
echo "image: creating filesystem on part2..."
|
||||||
mke2fs -F -q -t ext4 -m 0 "$LE_TMP/part2.ext4"
|
mke2fs -F -q -t ext4 -m 0 "$LE_TMP/part2.ext4"
|
||||||
tune2fs -L "$STORAGE_VOLUME_LABEL" -U $UUID_STORAGE "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
|
tune2fs -L "$DISTRO_DISKLABEL" -U $UUID_STORAGE "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
|
||||||
e2fsck -n "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
|
e2fsck -n "$LE_TMP/part2.ext4" >"$SAVE_ERROR" 2>&1 || show_error
|
||||||
sync
|
sync
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user