Fixing installer script

This commit is contained in:
brooksytech 2024-04-06 18:24:09 +00:00
parent 3406afc480
commit ed3901514c
No known key found for this signature in database
4 changed files with 43 additions and 53 deletions

View file

@ -17,6 +17,8 @@ post_install() {
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/g" \
-i ${INSTALL}/usr/bin/installer
chmod +x ${INSTALL}/usr/bin/installer
mkdir -p ${INSTALL}/etc
cp ${PKG_DIR}/config/* ${INSTALL}/etc
sed -e "s/@SYSTEM_SIZE@/${SYSTEM_SIZE}/g" \

28
packages/tools/installer/scripts/installer Executable file → Normal file
View file

@ -225,23 +225,6 @@ do_install_quick() {
printf "fix " | parted ---pretend-input-tty ${INSTALL_DEVICE} print >> $LOGFILE 2>&1
PART1=7
INSTALL_UBOOT=false
else
PART1=1
msg_progress_install "8" "Creating uboot partition on ${INSTALL_DEVICE}${PARTID}${PART1}"
parted -s "${INSTALL_DEVICE}" unit s mkpart uboot 16384 24575 >> $LOGFILE 2>&1
if [ -e "/usr/share/bootloader/trust.img" ]
then
TRUST_LABEL="trust"
elif [ -e "/usr/share/bootloader/resource.img" ]
then
TRUST_LABEL="resource"
fi
if [ -n "${TRUST_LABEL}" ]
then
PART1=$(( ${PART1} + 1 ))
msg_progress_install "8" "Creating ${TRUST_LABEL} partition on ${INSTALL_DEVICE}${PARTID}${PART1}"
parted -s "${INSTALL_DEVICE}" unit s mkpart ${TRUST_LABEL} 24576 32767 >> $LOGFILE 2>&1
fi
fi
;;
*)
@ -275,7 +258,7 @@ do_install_quick() {
if [ "$GPT" = "1" ]; then
parted -s ${INSTALL_DEVICE} unit s mkpart $DISKLABEL_STORAGE ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
else
parted - ${INSTALL_DEVICE} unit s mkpart storage ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
parted -s ${INSTALL_DEVICE} unit s mkpart primary ext4 -- $partsize_storage_start $partsize_storage_end >> $LOGFILE 2>&1
fi
msg_progress_install "16" "Setup bootflag on partition ${BOOT_PART} of ${INSTALL_DEVICE}"
@ -324,7 +307,7 @@ do_install_quick() {
if [ ! "${INSTALL_UBOOT}" = false ]
then
msg_progress_install "50" "Installing bootloader to $TMPDIR/part1"
/usr/share/bootloader/update.sh "${INSTALL_DEVICE}" "${TMPDIR}/part1" "$UUID_SYSTEM" "$UUID_STORAGE" "$SYSLINUX_PARAMETERS @EXTRA_CMDLINE@"
/usr/share/bootloader/update.sh "${INSTALL_DEVICE}" "/flash" "${TMPDIR}/part1"
mount -o remount,rw $TMPDIR/part1
fi
;;
@ -363,11 +346,8 @@ EOF
esac
# install system files
msg_progress_install "60" "Installing Kernel"
cp "/flash/$IMAGE_KERNEL" $TMPDIR/part1/KERNEL >> $LOGFILE 2>&1
msg_progress_install "65" "Installing System"
cp "/flash/$IMAGE_SYSTEM" $TMPDIR/part1/SYSTEM >> $LOGFILE 2>&1
msg_progress_install "60" "Installing boot files"
cp -r /flash/* $TMPDIR/part1/ >> $LOGFILE 2>&1
sync
sync

View file

@ -3,17 +3,22 @@
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
if [ -z "${1}" ]; then
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
# identify the boot device
if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in
/dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;;
esac
# identify the boot device
if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in
/dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;;
esac
fi
else
BOOT_DISK="${1}"
BOOT_ROOT="${2}"
fi
# mount $BOOT_ROOT rw
@ -32,27 +37,27 @@ if [ -f $BOOT_ROOT/extlinux/extlinux.conf ]; then
echo "Updating extlinux.conf..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/extlinux/extlinux.conf $BOOT_ROOT/extlinux
fi
fi
# Set correct FDT boot dtb for RK3588
DT_ID=$($SYSTEM_ROOT/usr/bin/dtname)
if [ -n "${DT_ID}" ]; then
case ${DT_ID} in
*gameforce,ace)
echo "Setting boot FDT to GameForce Ace..."
sed -i '/FDT/c\ FDT /rk3588s-gameforce-ace.dtb' $BOOT_ROOT/extlinux/extlinux.conf
# Set correct FDT boot dtb for RK3588
DT_ID=$($SYSTEM_ROOT/usr/bin/dtname)
if [ -n "${DT_ID}" ]; then
case ${DT_ID} in
*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)
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
*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-5)
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
;;
esac
*rock-5)
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
;;
esac
fi
fi
if [ -f $BOOT_ROOT/boot.ini ]; then
@ -91,7 +96,7 @@ fi
for BOOT_IMAGE in u-boot.itb u-boot.img; do
if [ -f "$SYSTEM_ROOT/usr/share/bootloader/${BOOT_IMAGE}" ]; then
echo "Updating $BOOT_IMAGE on $BOOT_DISK..."
echo -n "Updating $BOOT_IMAGE on $BOOT_DISK..."
dd if=$SYSTEM_ROOT/usr/share/bootloader/$BOOT_IMAGE of=$BOOT_DISK bs=512 seek=16384 conv=fsync &>/dev/null
break
fi

View file

@ -87,3 +87,6 @@
# debug tty path
DEBUG_TTY="/dev/ttyFIQ0"
# Some devices have internal storage.
INSTALLER_SUPPORT="yes"