Skip to content

Commit ee7a4dd

Browse files
committed
fixup bsp-cli vs bsp-generic dpkg postinst/preinst/etc hooks
1 parent e522f54 commit ee7a4dd

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

lib/functions/bsp/armbian-bsp-cli-deb.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,16 @@ function compile_armbian-bsp-generic() {
351351
# It is done this way so we get shellcheck and formatting instead of a huge heredoc.
352352
### preinst
353353
#FIXME: this mentions boards, is this relevant to bsp-generic? see below for postrm & postinst too
354-
artifact_package_hook_helper_board_side_functions "preinst" board_side_bsp_cli_preinst "${preinst_functions[@]}"
355-
unset board_side_bsp_cli_preinst
354+
artifact_package_hook_helper_board_side_functions "preinst" board_side_bsp_generic_preinst "${preinst_functions[@]}"
355+
unset board_side_bsp_generic_preinst "${preinst_functions[@]}"
356356

357357
### postrm
358-
artifact_package_hook_helper_board_side_functions "postrm" board_side_bsp_cli_postrm "${postrm_functions[@]}"
359-
unset board_side_bsp_cli_postrm
358+
artifact_package_hook_helper_board_side_functions "postrm" board_side_bsp_generic_postrm "${postrm_functions[@]}"
359+
unset board_side_bsp_generic_postrm "${postrm_functions[@]}"
360360

361361
### postinst -- a bit more complex, extendable via postinst_functions which can be customized in hook above
362-
artifact_package_hook_helper_board_side_functions "postinst" board_side_bsp_cli_postinst_base "${postinst_functions[@]}" board_side_bsp_cli_postinst_finish
363-
unset board_side_bsp_cli_postinst_base board_side_bsp_cli_postinst_update_uboot_bootscript board_side_bsp_cli_postinst_finish
362+
artifact_package_hook_helper_board_side_functions "postinst" board_side_bsp_generic_postinst_base "${postinst_functions[@]}" board_side_bsp_generic_postinst_finish
363+
unset board_side_bsp_generic_postinst_base board_side_bsp_generic_postinst_finish "${postinst_functions[@]}"
364364

365365
# fixing permissions (basic), reference: dh_fixperms
366366
find "${destination}" -print0 2> /dev/null | xargs -0r chown --no-dereference 0:0
@@ -480,8 +480,14 @@ function board_side_bsp_cli_postinst_update_uboot_bootscript() {
480480
[ -f /boot/boot.cmd ] && mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr > /dev/null 2>&1
481481
fi
482482
}
483+
function board_side_bsp_generic_postinst_update_uboot_bootscript() {
484+
/bin/true
485+
}
483486

484487
function board_side_bsp_cli_preinst() {
488+
/bin/true
489+
}
490+
function board_side_bsp_generic_preinst() {
485491
# tell people to reboot at next login
486492
[ "$1" = "upgrade" ] && touch /var/run/.reboot_required
487493

@@ -538,7 +544,11 @@ function board_side_bsp_cli_preinst() {
538544
)
539545
}
540546

541-
function board_side_bsp_cli_postrm() { # not run here
547+
function board_side_bsp_cli_postrm() {
548+
/bin/true
549+
}
550+
function board_side_bsp_generic_postrm() { # not run here
551+
#FIXME: if/when zram vs hardware-monitor etc are split, this gets more complicated
542552
if [[ remove == "$1" ]] || [[ abort-install == "$1" ]]; then
543553
systemctl disable armbian-hardware-monitor.service armbian-hardware-optimize.service > /dev/null 2>&1
544554
systemctl disable armbian-zram-config.service armbian-ramlog.service > /dev/null 2>&1
@@ -547,6 +557,9 @@ function board_side_bsp_cli_postrm() { # not run here
547557
}
548558

549559
function board_side_bsp_cli_postinst_base() {
560+
/bin/true
561+
}
562+
function board_side_bsp_generic_postinst_base() {
550563
# Source the armbian-release information file
551564
# shellcheck source=/dev/null
552565
[ -f /etc/armbian-release ] && . /etc/armbian-release
@@ -570,6 +583,9 @@ function board_side_bsp_cli_postinst_base() {
570583
}
571584

572585
function board_side_bsp_cli_postinst_finish() {
586+
/bin/true
587+
}
588+
function board_side_bsp_generic_postinst_finish() {
573589
ln -sf /var/run/motd /etc/motd
574590
rm -f /etc/update-motd.d/00-header /etc/update-motd.d/10-help-text
575591

0 commit comments

Comments
 (0)