aml-s9xx-box: inline bsp-cli preinst function so it's hashed together with the hook; half fixes #6817

- this is technically cheating, but works
- add TODO's ref the manual include'ing of files that are not hashed in the bsp-cli
This commit is contained in:
Ricardo Pardini 2024-06-30 12:30:11 +02:00 committed by Igor
parent d5df9f06be
commit a0bf4c1a5a

View File

@ -1,4 +1,4 @@
# Amlogic S9xx based TVBox
# Amlogic S9xx based TVBox
BOARD_NAME="aml-s9xx-box"
BOARDFAMILY="meson-gxl"
BOARD_MAINTAINER="SteeManMI"
@ -13,49 +13,48 @@ BOOT_LOGO="desktop"
SRC_EXTLINUX="yes"
SRC_CMDLINE='rootflags=data=writeback console=ttyAML0,115200n8 console=tty0'
function aml-s9xx-box-bsp-cli-preinst() {
#update of the board bsp-cli package fails because the filesystem type is
#fat and dpkg tries to create a hard link for the existing files as backup
#so rm the files instead in a preinst step
[ -f /boot/aml_autoscript ] && rm /boot/aml_autoscript
[ -f /boot/emmc_autoscript ] && rm /boot/emmc_autoscript
[ -f /boot/s905_autoscript ] && rm /boot/s905_autoscript
[ -f /boot/u-boot-s905 ] && rm /boot/u-boot-s905
[ -f /boot/u-boot-s905x-s912 ] && rm /boot/u-boot-s905x-s912
[ -f /boot/u-boot-s905x2-s922 ] && rm /boot/u-boot-s905x2-s922
[ -f /boot/u-boot-s905x3 ] && rm /boot/u-boot-s905x3
[ -f /boot/u-boot-s905x3-ugoosx3 ] && rm /boot/u-boot-s905x3-ugoosx3
[ -f /boot/extlinux/extlinux.conf.template ] && rm /boot/extlinux/extlinux.conf.template
[ -f /boot/build-u-boot/readme.txt ] && rm /boot/build-u-boot/readme.txt
[ -f /boot/build-u-boot/u-boot-s905x-s912.patch ] && rm /boot/build-u-boot/u-boot-s905x-s912.patch
[ -f /boot/build-u-boot/u-boot-s905x2-s922.patch ] && rm /boot/build-u-boot/u-boot-s905x2-s922.patch
[ -f /boot/build-u-boot/u-boot-s905x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3.patch
[ -f /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch
}
function post_family_config__uboot_aml-s9xx-box() {
# This board type relies on the vendor installed u-boot on emmc to boot
display_alert "$BOARD" "Configuring ($BOARD) non-u-boot" "info"
unset BOOTSOURCE
declare -g BOOTCONFIG='none'
# This board type relies on the vendor installed u-boot on emmc to boot
display_alert "$BOARD" "Configuring ($BOARD) non-u-boot" "info"
unset BOOTSOURCE
declare -g BOOTCONFIG='none'
}
function post_family_tweaks_bsp__config_aml-s9xx-box_bsp() {
: "${destination:?destination is not set}"
display_alert "$BOARD" "Installing bsp files" "info"
display_alert "$BOARD" "Installing bsp files" "info"
cp -r "${SRC}"/packages/bsp/aml-s9xx-box/boot "${destination}"
install -D -m 744 "${SRC}"/packages/bsp/aml-s9xx-box/root/install-aml.sh "${destination}"/root/install-aml.sh
install -m 644 "${SRC}"/packages/bsp/aml-s9xx-box/root/fstab.template "${destination}"/root/fstab.template
# @TODO: rpardini: these files are NOT hashed in the bsp-cli package hash! Anytime there's a change on any of those files, this hook needs to be changed/updated as well, otherwise changes will be ignored
run_host_command_logged cp -rv "${SRC}"/packages/bsp/aml-s9xx-box/boot "${destination}"
run_host_command_logged install -v -D -m 744 "${SRC}"/packages/bsp/aml-s9xx-box/root/install-aml.sh "${destination}"/root/install-aml.sh
run_host_command_logged install -v -m 644 "${SRC}"/packages/bsp/aml-s9xx-box/root/fstab.template "${destination}"/root/fstab.template
display_alert "${BOARD}" "Removing armbian-install" "info"
display_alert "${BOARD}" "Removing armbian-install" "info"
rm "${destination}"/usr/sbin/armbian-install
rm "${destination}"/usr/sbin/armbian-install
display_alert "${BOARD}" "Adding bsp-cli preinst logic" "info"
preinst_functions+=('aml-s9xx-box-bsp-cli-preinst')
display_alert "${BOARD}" "Adding bsp-cli preinst logic" "info"
# Inline function! So this function is automatically hashed when this hook is hashed.
function aml-s9xx-box-bsp-cli-preinst() {
#update of the board bsp-cli package fails because the filesystem type is
#fat and dpkg tries to create a hard link for the existing files as backup
#so rm the files instead in a preinst step
[ -f /boot/aml_autoscript ] && rm /boot/aml_autoscript
[ -f /boot/emmc_autoscript ] && rm /boot/emmc_autoscript
[ -f /boot/s905_autoscript ] && rm /boot/s905_autoscript
[ -f /boot/u-boot-s905 ] && rm /boot/u-boot-s905
[ -f /boot/u-boot-s905x-s912 ] && rm /boot/u-boot-s905x-s912
[ -f /boot/u-boot-s905x2-s922 ] && rm /boot/u-boot-s905x2-s922
[ -f /boot/u-boot-s905x3 ] && rm /boot/u-boot-s905x3
[ -f /boot/u-boot-s905x3-ugoosx3 ] && rm /boot/u-boot-s905x3-ugoosx3
[ -f /boot/extlinux/extlinux.conf.template ] && rm /boot/extlinux/extlinux.conf.template
[ -f /boot/build-u-boot/readme.txt ] && rm /boot/build-u-boot/readme.txt
[ -f /boot/build-u-boot/u-boot-s905x-s912.patch ] && rm /boot/build-u-boot/u-boot-s905x-s912.patch
[ -f /boot/build-u-boot/u-boot-s905x2-s922.patch ] && rm /boot/build-u-boot/u-boot-s905x2-s922.patch
[ -f /boot/build-u-boot/u-boot-s905x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3.patch
[ -f /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch
return 0 # short-circuits above, avoid errors
}
preinst_functions+=('aml-s9xx-box-bsp-cli-preinst')
if false; then aml-s9xx-box-bsp-cli-preinst; fi # so shellcheck stops complaining the function is unused. sorry
}