archr: package scripts and alpm hooks so they ship through pacman

The archr scripts (archr-update, archr-flash-sync, archr-depmod,
wifictl, governors, ...) and the alpm hooks were installed in
post_install, which writes into the assembled image only, so they never
entered the pacman package: every one of them was flash-only. That is
why the dual update path could deliver package contents but not its own
plumbing, and the depmod fix would not have reached existing installs.
Move the copy into makeinstall_target so the package carries them and
pacman -Syu updates them like anything else.
This commit is contained in:
Douglas Teles
2026-07-08 21:37:13 -03:00
parent faa9c6f6c4
commit c9fa2ae9d3
+11 -9
View File
@@ -121,6 +121,17 @@ EOF
# final dir so it materializes on first launch. # final dir so it materializes on first launch.
mkdir -p ${INSTALL}/opt mkdir -p ${INSTALL}/opt
ln -sf /storage/jdk ${INSTALL}/opt/jdk ln -sf /storage/jdk ${INSTALL}/opt/jdk
# Scripts and alpm hooks belong in makeinstall_target, NOT post_install:
# post_install writes straight into the assembled image, so anything
# done there never lands in the pacman package and stays flash-only.
# These (archr-update, flash-sync, the depmod hook, wifictl, ...) must
# reach users through `pacman -Syu` too, so they go here.
mkdir -p ${INSTALL}/usr/bin
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/* 2>/dev/null ||:
mkdir -p ${INSTALL}/etc/pacman.d/hooks
cp ${PKG_DIR}/sources/pacman-hooks/*.hook ${INSTALL}/etc/pacman.d/hooks
} }
post_install() { post_install() {
@@ -143,15 +154,6 @@ EOF
cp ${PKG_DIR}/sources/motd ${INSTALL}/etc cp ${PKG_DIR}/sources/motd ${INSTALL}/etc
cat ${INSTALL}/etc/issue >> ${INSTALL}/etc/motd cat ${INSTALL}/etc/issue >> ${INSTALL}/etc/motd
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
chmod 0755 ${INSTALL}/usr/bin/* 2>/dev/null ||:
# alpm hooks (pacman.conf points HookDir at /etc/pacman.d/hooks): the
# flash-sync hook keeps the FAT boot partition in step with kernel or
# DTB updates delivered through pacman.
mkdir -p ${INSTALL}/etc/pacman.d/hooks
cp ${PKG_DIR}/sources/pacman-hooks/*.hook ${INSTALL}/etc/pacman.d/hooks
### Install man pages ### Install man pages
if [ -d "${PKG_DIR}/sources/man" ]; then if [ -d "${PKG_DIR}/sources/man" ]; then
for page in ${PKG_DIR}/sources/man/*.[1-9]; do for page in ${PKG_DIR}/sources/man/*.[1-9]; do