Skip to content

Commit

Permalink
projects: do not update extlinux.conf/update.sh on updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spycat88 committed Aug 19, 2024
1 parent 6193ea7 commit e70f0d6
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 209 deletions.
12 changes: 0 additions & 12 deletions projects/Allwinner/bootloader/install
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,3 @@ case "${PKG_SOC}" in
cp -av u-boot-sunxi-with-spl.bin ${INSTALL}/usr/share/bootloader
;;
esac

if [ "${EXT_LINUX_CONF}" == true ]; then
echo "boot: create extlinux.conf..."
mkdir -p "${INSTALL}/usr/share/bootloader/extlinux"
FDTMODE="FDT /${DEVICE_DTB[0]}.dtb"
cat << EOF > "${INSTALL}/usr/share/bootloader/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
${FDTMODE}
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
EOF
fi
7 changes: 0 additions & 7 deletions projects/Allwinner/bootloader/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ for all_dtb in $BOOT_ROOT/*.dtb; do
fi
done

if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
if [ -f $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf ]; then
echo "Updating extlinux.conf..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
fi
fi

# update bootloader
if [ -f $SYSTEM_ROOT/usr/share/bootloader/idbloader.img ]; then
echo -n "Updating u-boot.bin on $BOOT_DISK... "
Expand Down
13 changes: 0 additions & 13 deletions projects/Amlogic/bootloader/boot.ini

This file was deleted.

4 changes: 0 additions & 4 deletions projects/Amlogic/bootloader/extlinux/extlinux.conf

This file was deleted.

41 changes: 26 additions & 15 deletions projects/Amlogic/bootloader/mkimage
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,35 @@ fi
}

mkimage_bootini() {
echo "image: copying boot.ini..."
cp -p "${RELEASE_DIR}/3rdparty/bootloader/boot.ini" "${LE_TMP}/boot.ini"
sed -e "s/@DISTRO_BOOTLABEL@/${DISTRO_BOOTLABEL}/" \
-e "s/@DISTRO_DISKLABEL@/${DISTRO_DISKLABEL}/" \
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/" \
-i "${LE_TMP}/boot.ini"
mcopy "${LE_TMP}/boot.ini" ::
echo "image: creating boot.ini..."
cat << EOF > "${LE_TMP}/boot.ini"
${DISTRO}-UBOOT-CONFIG

setenv dtb_loadaddr "0x10000000"
setenv loadaddr "0x1B00000"

setenv bootargs "boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}"

load mmc \${devno}:1 \${loadaddr} KERNEL
load mmc \${devno}:1 \${dtb_loadaddr} \${fdtfile}

fdt addr \${dtb_loadaddr}

booti \${loadaddr} - \${dtb_loadaddr}
EOF
mcopy -s -o "${LE_TMP}/boot.ini" ::
}

mkimage_extlinux() {
echo "image: copying exlinux.conf..."
mkimage_extlinux(){
echo "image: copying exlinux.conf"
mkdir -p "${LE_TMP}/extlinux"
cp -p "${RELEASE_DIR}/3rdparty/bootloader/extlinux/extlinux.conf" "${LE_TMP}/extlinux/extlinux.conf"
sed -e "s/@DISTRO_BOOTLABEL@/${DISTRO_BOOTLABEL}/" \
-e "s/@DISTRO_DISKLABEL@/${DISTRO_DISKLABEL}/" \
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/" \
-i "${LE_TMP}/extlinux/extlinux.conf"
mcopy "${LE_TMP}/extlinux" ::
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::
}

mkimage_dtb() {
Expand Down
17 changes: 0 additions & 17 deletions projects/Amlogic/bootloader/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ for all_dtb in $BOOT_ROOT/*.dtb; do
fi
done

if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
if [ -f $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf ]; then
echo "Updating extlinux.conf..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
fi
fi

if [ -f $BOOT_ROOT/boot.ini ]; then
if [ -f /usr/share/bootloader/boot.ini ]; then
echo "Updating boot.ini"
cp -p /usr/share/bootloader/boot.ini $BOOT_ROOT/boot.ini
fi
fi

if [ -f $SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot ]; then
echo "Updating u-boot on: $BOOT_DISK..."
dd if=$SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot of=$BOOT_DISK conv=fsync,notrunc bs=512 seek=1 &>/dev/null
Expand All @@ -76,9 +62,6 @@ if [ -d $BOOT_ROOT/res ]; then
fi
fi

# Update system partition label to ROCKNIX
[ ! -z "$(blkid | grep JELOS)" ] && ${SYSTEM_ROOT}/usr/sbin/dosfslabel $BOOT_PART ROCKNIX

# mount $BOOT_ROOT ro
sync
mount -o remount,ro $BOOT_ROOT
Expand Down
16 changes: 0 additions & 16 deletions projects/Amlogic/packages/u-boot/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,6 @@ makeinstall_target() {
# Always install the update script
find_file_path bootloader/update.sh && cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader

if find_file_path bootloader/boot.ini; then
cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
sed -e "s/@DISTRO_BOOTLABEL@/${DISTRO_BOOTLABEL}/" \
-e "s/@DISTRO_DISKLABEL@/${DISTRO_DISKLABEL}/" \
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/" \
-i "${INSTALL}/usr/share/bootloader/boot.ini"
fi

if find_dir_path bootloader/extlinux; then
cp -av ${FOUND_PATH} $INSTALL/usr/share/bootloader
sed -e "s/@DISTRO_BOOTLABEL@/${DISTRO_BOOTLABEL}/" \
-e "s/@DISTRO_DISKLABEL@/${DISTRO_DISKLABEL}/" \
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/" \
-i "${INSTALL}/usr/share/bootloader/extlinux/extlinux.conf"
fi

for PKG_SUBDEVICE in $SUBDEVICES; do
unset PKG_UBOOTBIN
if [ "${PKG_SUBDEVICE}" = "Odroid_GOU" ]; then
Expand Down
32 changes: 0 additions & 32 deletions projects/Rockchip/bootloader/install
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,3 @@ EOF
fi
;;
esac

if [ "${BOOT_INI}" == true ]; then
echo "boot: create boot.ini..."
if [ -e "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini" ]; then
cp -f ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/boot.ini ${INSTALL}/usr/share/bootloader/boot.ini
sed -e "s/@DISTRO_BOOTLABEL@/${DISTRO_BOOTLABEL}/" \
-e "s/@DISTRO_DISKLABEL@/${DISTRO_DISKLABEL}/" \
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/" \
-i "${INSTALL}/usr/share/bootloader/boot.ini"
else
echo "ERROR: No boot.ini found in ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/boot/."
exit 1
fi
fi

if [ "${EXT_LINUX_CONF}" == true ]; then
echo "boot: create extlinux.conf..."
mkdir -p "${INSTALL}/usr/share/bootloader/extlinux"

if [[ "${PKG_SOC}" != "rk3588" ]] && [[ "${TRUST_LABEL}" = "resource" || "${#DEVICE_DTB[@]}" -gt 1 ]]; then
FDTMODE="FDTDIR /"
else
FDTMODE="FDT /${DEVICE_DTB[0]}.dtb"
fi

cat << EOF > "${INSTALL}/usr/share/bootloader/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
${FDTMODE}
APPEND boot=LABEL=${DISTRO_BOOTLABEL} disk=LABEL=${DISTRO_DISKLABEL} ${EXTRA_CMDLINE}
EOF
fi
8 changes: 0 additions & 8 deletions projects/Rockchip/bootloader/release
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ if [ -n "${UBOOT_CONFIG}" ]; then
esac
fi

if [ -f ${INSTALL}/usr/share/bootloader/boot.ini ]; then
cp -a ${INSTALL}/usr/share/bootloader/boot.ini ${RELEASE_DIR}/3rdparty/bootloader
fi

if [ -f ${INSTALL}/usr/share/bootloader/boot.scr ]; then
cp -a ${INSTALL}/usr/share/bootloader/boot.scr ${RELEASE_DIR}/3rdparty/bootloader
fi

LINUX_DTS_DIR=$(get_build_dir linux)/arch/${TARGET_KERNEL_ARCH}/boot/dts/
for dtb in $(find ${LINUX_DTS_DIR} -name "*.dtb"); do
if [ -f $dtb ]; then
Expand Down
85 changes: 0 additions & 85 deletions projects/Rockchip/bootloader/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,88 +38,6 @@ if [ -d $SYSTEM_ROOT/usr/share/bootloader/overlays ]; then
done
fi

if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
# Store away FDTOVERLAYS if existing
if grep -q FDTOVERLAYS $BOOT_ROOT/extlinux/extlinux.conf; then
echo "Backup FDTOVERLAYS..."
FDTOVERLAYS=$(grep FDTOVERLAYS $BOOT_ROOT/extlinux/extlinux.conf | awk '{$1=$1};1')
fi
if [ -f $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf ]; then
echo "Updating extlinux.conf..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
fi
# Set correct FDT boot dtb for RK3588
DT_ID=$($SYSTEM_ROOT/usr/bin/dtname)
if [ -n "${DT_ID}" ]; then
case ${DT_ID} in
*powkiddy,rgb20sx)
echo "Setting boot FDT to Powkiddy RGB20SX..."
sed -i '/FDT/c\ FDT /rk3566-powkiddy-rgb20sx.dtb' $BOOT_ROOT/extlinux/extlinux.conf
;;
*powkiddy,rgb30r2)
echo "Setting boot FDT to Powkiddy RGB30 rev.2..."
sed -i '/FDT/c\ FDT /rk3566-powkiddy-rgb30r2.dtb' $BOOT_ROOT/extlinux/extlinux.conf
;;
*gameforce,ace)
echo "Setting boot FDT to GameForce Ace..."
sed -i '/FDT/c\ FDT /rk3588s-gameforce-ace.dtb' $BOOT_ROOT/extlinux/extlinux.conf
;;
*orangepi-5-plus)
echo "Setting boot FDT to Orange Pi 5 Plus..."
sed -i '/FDT/c\ FDT /rk3588s-orangepi-5-plus.dtb' $BOOT_ROOT/extlinux/extlinux.conf
sed -i 's/ fbcon=rotate:1//' $BOOT_ROOT/extlinux/extlinux.conf
;;
*orangepi-5)
echo "Setting boot FDT to Orange Pi 5..."
sed -i '/FDT/c\ FDT /rk3588s-orangepi-5.dtb' $BOOT_ROOT/extlinux/extlinux.conf
sed -i 's/ fbcon=rotate:1//' $BOOT_ROOT/extlinux/extlinux.conf
;;
*rock-5b-plus)
echo "Setting boot FDT to Rock 5B+..."
sed -i '/FDT/c\ FDT /rk3588-rock-5b-plus.dtb' $BOOT_ROOT/extlinux/extlinux.conf
sed -i 's/ fbcon=rotate:1//' $BOOT_ROOT/extlinux/extlinux.conf
;;
*rock-5b)
echo "Setting boot FDT to Rock 5B..."
sed -i '/FDT/c\ FDT /rk3588-rock-5b.dtb' $BOOT_ROOT/extlinux/extlinux.conf
sed -i 's/ fbcon=rotate:1//' $BOOT_ROOT/extlinux/extlinux.conf
;;
*rock-5a)
echo "Setting boot FDT to Rock 5A..."
sed -i '/FDT/c\ FDT /rk3588-rock-5b.dtb' $BOOT_ROOT/extlinux/extlinux.conf
sed -i 's/ fbcon=rotate:1//' $BOOT_ROOT/extlinux/extlinux.conf
;;
esac
fi
# Restore FDTOVERLAYS after FDT, to avoid matching on FDTOVERLAY
if [ "$FDTOVERLAYS" ]; then
echo "Restore FDTOVERLAYS..."
sed -i "/FDT/a\ \ ${FDTOVERLAYS}" $BOOT_ROOT/extlinux/extlinux.conf
fi
fi

if [ -f $BOOT_ROOT/boot.ini ]; then
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

if [ -f $BOOT_ROOT/device.name ]; then
# Set correct R3xS dtb in boot.ini
DTB_NAME=$(cat $BOOT_ROOT/device.name)
case ${DTB_NAME} in
R33S)
echo "Setting R33S dtb in boot.ini..."
sed -i '/rk3326-gameconsole-r3/c\ load mmc 1:1 ${dtb_loadaddr} rk3326-gameconsole-r33s.dtb' $BOOT_ROOT/boot.ini
;;
R36S)
echo "Setting R36S/R35S dtb in boot.ini..."
sed -i '/rk3326-gameconsole-r3/c\ load mmc 1:1 ${dtb_loadaddr} rk3326-gameconsole-r36s.dtb' $BOOT_ROOT/boot.ini
;;
esac
fi
fi
fi

# update bootloader
DT_SOC=$($SYSTEM_ROOT/usr/bin/dtsoc)
case ${DT_SOC} in
Expand Down Expand Up @@ -153,9 +71,6 @@ elif [ -f $SYSTEM_ROOT/usr/share/bootloader/resource.img ]; then
dd if=$SYSTEM_ROOT/usr/share/bootloader/resource.img of=$BOOT_DISK bs=512 seek=24576 conv=fsync &>/dev/null
fi

# Update system partition label to ROCKNIX
[ ! -z "$(blkid | grep JELOS)" ] && ${SYSTEM_ROOT}/usr/sbin/dosfslabel $BOOT_PART ROCKNIX

# mount $BOOT_ROOT ro
sync
mount -o remount,ro $BOOT_ROOT
Expand Down

0 comments on commit e70f0d6

Please sign in to comment.