Skip to content

Commit

Permalink
Renaming the BSP package to armbian-bsp (armbian#2779)
Browse files Browse the repository at this point in the history
* Renaming the BSP package to armbian-bsp

Extracted from armbian#2776

* Update naming

* Create meta package for upgrade and remove deprecated mpv related config management

* Probably we want to keep our internal release version in filename
  • Loading branch information
igorpecovnik authored and root committed Feb 4, 2022
1 parent 91b791a commit ecb1661
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/distributions.sh
Expand Up @@ -292,7 +292,7 @@ install_common()

# install board support packages
if [[ "${REPOSITORY_INSTALL}" != *bsp* ]]; then
install_deb_chroot "${DEB_STORAGE}/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb" >> "${DEST}"/debug/install.log 2>&1
install_deb_chroot "${DEB_STORAGE}/$RELEASE/${BSP_CLI_PACKAGE_FULLNAME}.deb" >> "${DEST}"/debug/install.log 2>&1
else
install_deb_chroot "${CHOSEN_ROOTFS}" "remote"
fi
Expand Down
6 changes: 4 additions & 2 deletions lib/main.sh
Expand Up @@ -392,13 +392,15 @@ BOOTSOURCEDIR="${BOOTDIR}/$(branch2dir "${BOOTBRANCH}")"
LINUXSOURCEDIR="${KERNELDIR}/$(branch2dir "${KERNELBRANCH}")"
[[ -n $ATFSOURCE ]] && ATFSOURCEDIR="${ATFDIR}/$(branch2dir "${ATFBRANCH}")"

BSP_CLI_PACKAGE_NAME="armbian-bsp-cli-${BOARD}"
BSP_CLI_PACKAGE_FULLNAME="${BSP_CLI_PACKAGE_NAME}_${REVISION}_${ARCH}"
# define package names
DEB_BRANCH=${BRANCH//default}
# if not empty, append hyphen
DEB_BRANCH=${DEB_BRANCH:+${DEB_BRANCH}-}
CHOSEN_UBOOT=linux-u-boot-${DEB_BRANCH}${BOARD}
CHOSEN_KERNEL=linux-image-${DEB_BRANCH}${LINUXFAMILY}
CHOSEN_ROOTFS=linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}
CHOSEN_ROOTFS=${BSP_CLI_PACKAGE_NAME}
CHOSEN_DESKTOP=armbian-${RELEASE}-desktop-${DESKTOP_ENVIRONMENT}
CHOSEN_KSRC=linux-source-${BRANCH}-${LINUXFAMILY}

Expand Down Expand Up @@ -492,7 +494,7 @@ fi
overlayfs_wrapper "cleanup"

# create board support package
[[ -n $RELEASE && ! -f ${DEB_STORAGE}/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb ]] && create_board_package
[[ -n $RELEASE && ! -f ${DEB_STORAGE}/$RELEASE/${BSP_CLI_PACKAGE_FULLNAME}.deb ]] && create_board_package

# create desktop package
[[ -n $RELEASE && $DESKTOP_ENVIRONMENT && ! -f ${DEB_STORAGE}/$RELEASE/${CHOSEN_DESKTOP}_${REVISION}_all.deb ]] && create_desktop_package
Expand Down
29 changes: 22 additions & 7 deletions lib/makeboarddeb.sh
Expand Up @@ -20,7 +20,7 @@ create_board_package()
bsptempdir=$(mktemp -d)
chmod 700 ${bsptempdir}
trap "rm -rf \"${bsptempdir}\" ; exit 0" 0 1 2 3 15
local destination=${bsptempdir}/${RELEASE}/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}
local destination=${bsptempdir}/${RELEASE}/${BSP_CLI_PACKAGE_FULLNAME}
mkdir -p "${destination}"/DEBIAN
cd $destination

Expand Down Expand Up @@ -50,7 +50,7 @@ create_board_package()
# Depends: linux-base is needed for "linux-version" command in initrd cleanup script
# Depends: fping is needed for armbianmonitor to upload armbian-hardware-monitor.log
cat <<-EOF > "${destination}"/DEBIAN/control
Package: linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}
Package: ${BSP_CLI_PACKAGE_NAME}
Version: $REVISION
Architecture: $ARCH
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Expand All @@ -63,7 +63,7 @@ create_board_package()
Suggests: armbian-config
Replaces: zram-config, base-files, armbian-tools-$RELEASE
Recommends: bsdutils, parted, util-linux, toilet
Description: Armbian tweaks for $RELEASE on $BOARD ($BRANCH branch)
Description: Tweaks for Armbian $RELEASE on $BOARD
EOF

# set up pre install script
Expand Down Expand Up @@ -122,9 +122,6 @@ create_board_package()
[ -f "/lib/systemd/system/resize2fs.service" ] && rm /lib/systemd/system/resize2fs.service
[ -f "/usr/lib/armbian/apt-updates" ] && rm /usr/lib/armbian/apt-updates
[ -f "/usr/lib/armbian/firstrun-config.sh" ] && rm /usr/lib/armbian/firstrun-config.sh
# fix for https://bugs.launchpad.net/ubuntu/+source/lightdm-gtk-greeter/+bug/1897491
[ -d "/var/lib/lightdm" ] && (chown -R lightdm:lightdm /var/lib/lightdm ; chmod 0750 /var/lib/lightdm)
dpkg-divert --quiet --package linux-${RELEASE}-root-${DEB_BRANCH}${BOARD} --add --rename --divert /etc/mpv/mpv-dist.conf /etc/mpv/mpv.conf
exit 0
EOF

Expand All @@ -135,7 +132,6 @@ create_board_package()
#!/bin/sh
if [ remove = "\$1" ] || [ abort-install = "\$1" ]; then
dpkg-divert --quiet --package linux-${RELEASE}-root-${DEB_BRANCH}${BOARD} --remove --rename --divert /etc/mpv/mpv-dist.conf /etc/mpv/mpv.conf
systemctl disable armbian-hardware-monitor.service armbian-hardware-optimize.service >/dev/null 2>&1
systemctl disable armbian-zram-config.service armbian-ramlog.service >/dev/null 2>&1
Expand Down Expand Up @@ -324,6 +320,25 @@ fi
fakeroot dpkg-deb -b "${destination}" "${destination}.deb" >> "${DEST}"/debug/install.log 2>&1
mkdir -p "${DEB_STORAGE}/${RELEASE}/"
rsync --remove-source-files -rq "${destination}.deb" "${DEB_STORAGE}/${RELEASE}/"

# Can be removed after 21.05
# create meta package for upgrade
local destination=${bsptempdir}/${RELEASE}/linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}_${REVISION}_${ARCH}
mkdir -p "${destination}"/DEBIAN
cat <<-EOF > "${destination}"/DEBIAN/control
Package: linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}
Version: $REVISION
Architecture: $ARCH
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Pre-Depends: ${BSP_CLI_PACKAGE_NAME}
Description: Meta package that upgrades to ${BSP_CLI_PACKAGE_NAME}
EOF
display_alert "Building meta package" "$CHOSEN_ROOTFS" "info"
fakeroot dpkg-deb -b "${destination}" "${destination}.deb" >> "${DEST}"/debug/install.log 2>&1
mkdir -p "${DEB_STORAGE}/${RELEASE}/"
rsync --remove-source-files -rq "${destination}.deb" "${DEB_STORAGE}/${RELEASE}/"
# Can be removed after 21.05

# cleanup
rm -rf ${bsptempdir}
}

0 comments on commit ecb1661

Please sign in to comment.