Set dpkg vendor to Armbian in all images (#6122)

* Set dpkg vendor to Armbian in all images

We already set to Armbian, but we didn't set default link. This fixes it for both, Debian and Ubuntu.

* Adjust post install scripts to set correct link on upgrade
This commit is contained in:
Igor 2024-01-03 19:27:39 +01:00 committed by GitHub
parent 9c16c47c24
commit 69d0ec7218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,6 +137,30 @@ function compile_armbian-base-files() {
Bugs: ${VENDORBUGS}
Parent: ${DISTRIBUTION}
EOD
# Add armbian to the package conf files.
sed -i '/\/etc\/dpkg\/origins\/debian/a \/etc\/dpkg\/origins\/armbian' "${destination}"/DEBIAN/conffiles
# Fix symlinking in postinst for Debian and Ubuntu. They have to point towards Armbian, Armbian parent is Debian or Ubuntu -> Debian
sed -i "s|ln -sf ubuntu /etc/dpkg/origins/default|ln -sf armbian /etc/dpkg/origins/default|g" "${destination}"/DEBIAN/postinst
sed -i "s|ln -sf debian \"\$DPKG_ROOT/etc/dpkg/origins/default\"|ln -sf armbian \"\$DPKG_ROOT/etc/dpkg/origins/default\"|g" "${destination}"/DEBIAN/postinst
# Create preinst file if not exists (Debian)
if [[ ! -e "${destination}"/DEBIAN/preinst ]]; then
cat <<- EOD >> "${destination}"/DEBIAN/preinst
#!/bin/sh
set -e
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
EOD
chmod 0755 "${destination}"/DEBIAN/preinst
else
cat <<- EOD >> "${destination}"/DEBIAN/preinst
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
EOD
fi
sed -i "s|^HOME_URL=.*|HOME_URL=\"${VENDORURL}\"|" "${destination}"/etc/os-release
sed -i "s|^SUPPORT_URL=.*|SUPPORT_URL=\"${VENDORSUPPORT}\"|" "${destination}"/etc/os-release
sed -i "s|^BUG_REPORT_URL=.*|BUG_REPORT_URL=\"${VENDORBUGS}\"|" "${destination}"/etc/os-release