build/lib/makeboarddeb.sh

317 lines
12 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# Copyright (c) 2015 Igor Pecovnik, igor.pecovnik@gma**.com
#
# This file is licensed under the terms of the GNU General Public
# License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.
# This file is a part of the Armbian build script
# https://github.com/armbian/build/
# Create board support packages
#
2015-12-18 12:22:42 +03:00
# Functions:
# create_board_package
2016-06-08 19:49:47 +03:00
create_board_package()
{
display_alert "Creating board support package" "$BOARD $BRANCH" "info"
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}
mkdir -p "${destination}"/DEBIAN
cd $destination
2016-04-08 18:26:32 +03:00
# install copy of boot script & environment file
local bootscript_src=${BOOTSCRIPT%%:*}
local bootscript_dst=${BOOTSCRIPT##*:}
mkdir -p "${destination}"/usr/share/armbian/
cp "${SRC}/config/bootscripts/${bootscript_src}" "${destination}/usr/share/armbian/${bootscript_dst}"
[[ -n $BOOTENV_FILE && -f $SRC/config/bootenv/$BOOTENV_FILE ]] && \
cp "${SRC}/config/bootenv/${BOOTENV_FILE}" "${destination}"/usr/share/armbian/armbianEnv.txt
# add configuration for setting uboot environment from userspace with: fw_setenv fw_printenv
if [[ -n $UBOOT_FW_ENV ]]; then
UBOOT_FW_ENV=($(tr ',' ' ' <<< "$UBOOT_FW_ENV"))
mkdir -p "${destination}"/etc
echo "# Device to access offset env size" > "${destination}"/etc/fw_env.config
echo "/dev/mmcblk0 ${UBOOT_FW_ENV[0]} ${UBOOT_FW_ENV[1]}" >> "${destination}"/etc/fw_env.config
fi
2016-06-19 00:57:24 +03:00
# Replaces: base-files is needed to replace /etc/update-motd.d/ files on Xenial
2016-06-19 13:36:48 +03:00
# Replaces: unattended-upgrades may be needed to replace /etc/apt/apt.conf.d/50unattended-upgrades
# (distributions provide good defaults, so this is not needed currently)
# 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
2016-06-08 19:49:47 +03:00
Package: linux-${RELEASE}-root-${DEB_BRANCH}${BOARD}
Version: $REVISION
Architecture: $ARCH
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
Installed-Size: 1
Section: kernel
Priority: optional
Depends: bash, linux-base, u-boot-tools, initramfs-tools, lsb-release, fping
2016-06-08 19:49:47 +03:00
Provides: armbian-bsp
Conflicts: armbian-bsp
2017-11-11 22:48:09 +03:00
Suggests: armbian-config
Replaces: zram-config, base-files, armbian-tools-$RELEASE
Recommends: bsdutils, parted, util-linux, toilet
2016-06-19 00:57:24 +03:00
Description: Armbian tweaks for $RELEASE on $BOARD ($BRANCH branch)
2016-06-08 19:49:47 +03:00
EOF
# set up pre install script
cat <<-EOF > "${destination}"/DEBIAN/preinst
2016-06-08 19:49:47 +03:00
#!/bin/sh
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# tell people to reboot at next login
2016-08-20 22:53:50 +03:00
[ "\$1" = "upgrade" ] && touch /var/run/.reboot_required
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# convert link to file
if [ -L "/etc/network/interfaces" ]; then
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
cp /etc/network/interfaces /etc/network/interfaces.tmp
rm /etc/network/interfaces
mv /etc/network/interfaces.tmp /etc/network/interfaces
fi
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# fixing ramdisk corruption when using lz4 compression method
sed -i "s/^COMPRESS=.*/COMPRESS=gzip/" /etc/initramfs-tools/initramfs.conf
# swap
grep -q vm.swappiness /etc/sysctl.conf
case \$? in
0)
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
sed -i 's/vm\.swappiness.*/vm.swappiness=100/' /etc/sysctl.conf
;;
*)
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
echo vm.swappiness=100 >>/etc/sysctl.conf
;;
esac
sysctl -p >/dev/null 2>&1
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# disable deprecated services
[ -f "/etc/profile.d/activate_psd_user.sh" ] && rm /etc/profile.d/activate_psd_user.sh
[ -f "/etc/profile.d/check_first_login.sh" ] && rm /etc/profile.d/check_first_login.sh
[ -f "/etc/profile.d/check_first_login_reboot.sh" ] && rm /etc/profile.d/check_first_login_reboot.sh
[ -f "/etc/profile.d/ssh-title.sh" ] && rm /etc/profile.d/ssh-title.sh
[ -f "/etc/update-motd.d/10-header" ] && rm /etc/update-motd.d/10-header
[ -f "/etc/update-motd.d/30-sysinfo" ] && rm /etc/update-motd.d/30-sysinfo
[ -f "/etc/update-motd.d/35-tips" ] && rm /etc/update-motd.d/35-tips
[ -f "/etc/update-motd.d/40-updates" ] && rm /etc/update-motd.d/40-updates
[ -f "/etc/update-motd.d/98-autoreboot-warn" ] && rm /etc/update-motd.d/98-autoreboot-warn
[ -f "/etc/update-motd.d/99-point-to-faq" ] && rm /etc/update-motd.d/99-point-to-faq
[ -f "/etc/update-motd.d/80-esm" ] && rm /etc/update-motd.d/80-esm
[ -f "/etc/update-motd.d/80-livepatch" ] && rm /etc/update-motd.d/80-livepatch
[ -f "/etc/apt/apt.conf.d/02compress-indexes" ] && rm /etc/apt/apt.conf.d/02compress-indexes
[ -f "/etc/apt/apt.conf.d/02periodic" ] && rm /etc/apt/apt.conf.d/02periodic
[ -f "/etc/apt/apt.conf.d/no-languages" ] && rm /etc/apt/apt.conf.d/no-languages
[ -f "/etc/init.d/armhwinfo" ] && rm /etc/init.d/armhwinfo
[ -f "/etc/logrotate.d/armhwinfo" ] && rm /etc/logrotate.d/armhwinfo
[ -f "/etc/init.d/firstrun" ] && rm /etc/init.d/firstrun
[ -f "/etc/init.d/resize2fs" ] && rm /etc/init.d/resize2fs
[ -f "/lib/systemd/system/firstrun-config.service" ] && rm /lib/systemd/system/firstrun-config.service
[ -f "/lib/systemd/system/firstrun.service" ] && rm /lib/systemd/system/firstrun.service
[ -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)
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
dpkg-divert --quiet --package linux-${RELEASE}-root-${DEB_BRANCH}${BOARD} --add --rename --divert /etc/mpv/mpv-dist.conf /etc/mpv/mpv.conf
exit 0
2016-06-08 19:49:47 +03:00
EOF
chmod 755 "${destination}"/DEBIAN/preinst
2016-04-08 18:26:32 +03:00
2016-10-09 22:47:15 +03:00
# postrm script
cat <<-EOF > "${destination}"/DEBIAN/postrm
2016-10-09 22:47:15 +03:00
#!/bin/sh
if [ remove = "\$1" ] || [ abort-install = "\$1" ]; then
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
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
fi
2016-10-09 22:47:15 +03:00
exit 0
EOF
chmod 755 "${destination}"/DEBIAN/postrm
2016-10-09 22:47:15 +03:00
# set up post install script
cat <<-EOF > "${destination}"/DEBIAN/postinst
2016-06-08 19:49:47 +03:00
#!/bin/sh
#
# ${BOARD} BSP post installation script
#
2019-02-08 16:08:44 +01:00
systemctl --no-reload enable armbian-ramlog.service
# check if it was disabled in config and disable in new service
if [ -n "\$(grep -w '^ENABLED=false' /etc/default/log2ram 2> /dev/null)" ]; then
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
sed -i "s/^ENABLED=.*/ENABLED=false/" /etc/default/armbian-ramlog
fi
# fix boot delay "waiting for suspend/resume device"
if [ -f "/etc/initramfs-tools/initramfs.conf" ]; then
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
if ! grep --quiet "RESUME=none" /etc/initramfs-tools/initramfs.conf; then
echo "RESUME=none" >> /etc/initramfs-tools/initramfs.conf
fi
fi
Helios4: Changes / fixes related to bootscript issue (#1169) * helios4: next branch use u-boot 2018 use new u-boot based on upstream 2018 Signed-off-by: Aditya Prayoga <aditya@kobol.io> * helios4: Tweak fancontrol configuration Adjusted MINSTART and MINSTOP to suit both old and new fan. Adjusted TEMP threshold so fan would stop or run in minimal speed when the system idle. Fixed wrong MINPWM value. URL:https://wiki.kobol.io/pwm/#configuration-file Signed-off-by: Aditya Prayoga <aditya@kobol.io> * kernel: mvebu-next: use upstream helios4 dts Helios4 device tree has been merged on upstream since 4.19. Rework the patch to produce same device tree. URL:https://patchwork.kernel.org/patch/10449393/ Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: Use boot-mvebu-next bootscript Use boot-mvebu-next.cmd that make use of upstream's Generic Distro Configuration. Since loadaddr and fdt_addr varibales are no longer required, remove the patch. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: mvebu-next: Add workaround for SPI and SATA concurrent access issue Concurrent access on SPI NOR and SATA drives can lead to unstable SATA. Therefore as workaround, disable SATA controller when SPI flash access is needed and make it as user configurable item in armbianEnv.txt This workaround might applies to Clearfog too. Refer to Commit 59af84c07c09 ("Helios4: Add SPI bootloader install feature (#1126)") Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Bootscripts: Fixed boot-mvebu-next.cmd The environment setting (armbianEnv.txt) is loaded to RAM located on ${load_addr} but the env import use wrong address (${pxefile_addr_r}). bootargs still expect ${boot_interface} which carried over from boot- marvell.cmd. Upstream's distro configuration use ${devtype} instead. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * uboot: mvebu-next: only apply DT fixup script if it exists * [ buildscript ] Add FORCE_BOOTSCRIPT_UPDATE option If enabled bootscript will get updated during bsp upgrade. * Helios4: Enable FORCE_BOOTSCRIPT_UPDATE by default in board config. * Helios4: Added boot-marvell.cmd compability to u-boot 2018 Revert the changes to use boot-mvebu-next.cmd instead of boot- marvell.cmd to prevent unbootable system due to incompatibility between u-boot 2013.01 and boot-mvebu-next.cmd This reverts commit 0f17ecb233babe ("Helios4: Use boot-mvebu-next bootscript") U-Boot 2018 will failed load dtb and script due to missing some variables on boot-marvell.cmd. This will render the system unbootable. Re-added and update loading-boot-scr.patch for backward compatibility Signed-off-by: Aditya Prayoga <aditya@kobol.io>
2018-11-29 13:58:39 +08:00
EOF
if [[ $RELEASE == bionic ]] || [[ $RELEASE == focal && $BOARDFAMILY == sun50iw6 ]]; then
cat <<-EOF >> "${destination}"/DEBIAN/postinst
# temporally disable acceleration on some arch in Bionic due to broken mesa packages
echo 'Section "Device"
\tIdentifier \t"Default Device"
\tOption \t"AccelMethod" "none"
EndSection' >> /etc/X11/xorg.conf.d/01-armbian-defaults.conf
EOF
fi
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# install bootscripts if they are not present. Fix upgrades from old images
Helios4: Changes / fixes related to bootscript issue (#1169) * helios4: next branch use u-boot 2018 use new u-boot based on upstream 2018 Signed-off-by: Aditya Prayoga <aditya@kobol.io> * helios4: Tweak fancontrol configuration Adjusted MINSTART and MINSTOP to suit both old and new fan. Adjusted TEMP threshold so fan would stop or run in minimal speed when the system idle. Fixed wrong MINPWM value. URL:https://wiki.kobol.io/pwm/#configuration-file Signed-off-by: Aditya Prayoga <aditya@kobol.io> * kernel: mvebu-next: use upstream helios4 dts Helios4 device tree has been merged on upstream since 4.19. Rework the patch to produce same device tree. URL:https://patchwork.kernel.org/patch/10449393/ Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: Use boot-mvebu-next bootscript Use boot-mvebu-next.cmd that make use of upstream's Generic Distro Configuration. Since loadaddr and fdt_addr varibales are no longer required, remove the patch. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: mvebu-next: Add workaround for SPI and SATA concurrent access issue Concurrent access on SPI NOR and SATA drives can lead to unstable SATA. Therefore as workaround, disable SATA controller when SPI flash access is needed and make it as user configurable item in armbianEnv.txt This workaround might applies to Clearfog too. Refer to Commit 59af84c07c09 ("Helios4: Add SPI bootloader install feature (#1126)") Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Bootscripts: Fixed boot-mvebu-next.cmd The environment setting (armbianEnv.txt) is loaded to RAM located on ${load_addr} but the env import use wrong address (${pxefile_addr_r}). bootargs still expect ${boot_interface} which carried over from boot- marvell.cmd. Upstream's distro configuration use ${devtype} instead. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * uboot: mvebu-next: only apply DT fixup script if it exists * [ buildscript ] Add FORCE_BOOTSCRIPT_UPDATE option If enabled bootscript will get updated during bsp upgrade. * Helios4: Enable FORCE_BOOTSCRIPT_UPDATE by default in board config. * Helios4: Added boot-marvell.cmd compability to u-boot 2018 Revert the changes to use boot-mvebu-next.cmd instead of boot- marvell.cmd to prevent unbootable system due to incompatibility between u-boot 2013.01 and boot-mvebu-next.cmd This reverts commit 0f17ecb233babe ("Helios4: Use boot-mvebu-next bootscript") U-Boot 2018 will failed load dtb and script due to missing some variables on boot-marvell.cmd. This will render the system unbootable. Re-added and update loading-boot-scr.patch for backward compatibility Signed-off-by: Aditya Prayoga <aditya@kobol.io>
2018-11-29 13:58:39 +08:00
if [[ $FORCE_BOOTSCRIPT_UPDATE == yes ]]; then
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
cat <<-EOF >> "${destination}"/DEBIAN/postinst
if [ true ]; then
Helios4: Changes / fixes related to bootscript issue (#1169) * helios4: next branch use u-boot 2018 use new u-boot based on upstream 2018 Signed-off-by: Aditya Prayoga <aditya@kobol.io> * helios4: Tweak fancontrol configuration Adjusted MINSTART and MINSTOP to suit both old and new fan. Adjusted TEMP threshold so fan would stop or run in minimal speed when the system idle. Fixed wrong MINPWM value. URL:https://wiki.kobol.io/pwm/#configuration-file Signed-off-by: Aditya Prayoga <aditya@kobol.io> * kernel: mvebu-next: use upstream helios4 dts Helios4 device tree has been merged on upstream since 4.19. Rework the patch to produce same device tree. URL:https://patchwork.kernel.org/patch/10449393/ Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: Use boot-mvebu-next bootscript Use boot-mvebu-next.cmd that make use of upstream's Generic Distro Configuration. Since loadaddr and fdt_addr varibales are no longer required, remove the patch. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: mvebu-next: Add workaround for SPI and SATA concurrent access issue Concurrent access on SPI NOR and SATA drives can lead to unstable SATA. Therefore as workaround, disable SATA controller when SPI flash access is needed and make it as user configurable item in armbianEnv.txt This workaround might applies to Clearfog too. Refer to Commit 59af84c07c09 ("Helios4: Add SPI bootloader install feature (#1126)") Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Bootscripts: Fixed boot-mvebu-next.cmd The environment setting (armbianEnv.txt) is loaded to RAM located on ${load_addr} but the env import use wrong address (${pxefile_addr_r}). bootargs still expect ${boot_interface} which carried over from boot- marvell.cmd. Upstream's distro configuration use ${devtype} instead. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * uboot: mvebu-next: only apply DT fixup script if it exists * [ buildscript ] Add FORCE_BOOTSCRIPT_UPDATE option If enabled bootscript will get updated during bsp upgrade. * Helios4: Enable FORCE_BOOTSCRIPT_UPDATE by default in board config. * Helios4: Added boot-marvell.cmd compability to u-boot 2018 Revert the changes to use boot-mvebu-next.cmd instead of boot- marvell.cmd to prevent unbootable system due to incompatibility between u-boot 2013.01 and boot-mvebu-next.cmd This reverts commit 0f17ecb233babe ("Helios4: Use boot-mvebu-next bootscript") U-Boot 2018 will failed load dtb and script due to missing some variables on boot-marvell.cmd. This will render the system unbootable. Re-added and update loading-boot-scr.patch for backward compatibility Signed-off-by: Aditya Prayoga <aditya@kobol.io>
2018-11-29 13:58:39 +08:00
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# this package recreate boot scripts
EOF
else
cat <<-EOF >> "${destination}"/DEBIAN/postinst
if [ ! -f /boot/$bootscript_dst ]; then
Helios4: Changes / fixes related to bootscript issue (#1169) * helios4: next branch use u-boot 2018 use new u-boot based on upstream 2018 Signed-off-by: Aditya Prayoga <aditya@kobol.io> * helios4: Tweak fancontrol configuration Adjusted MINSTART and MINSTOP to suit both old and new fan. Adjusted TEMP threshold so fan would stop or run in minimal speed when the system idle. Fixed wrong MINPWM value. URL:https://wiki.kobol.io/pwm/#configuration-file Signed-off-by: Aditya Prayoga <aditya@kobol.io> * kernel: mvebu-next: use upstream helios4 dts Helios4 device tree has been merged on upstream since 4.19. Rework the patch to produce same device tree. URL:https://patchwork.kernel.org/patch/10449393/ Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: Use boot-mvebu-next bootscript Use boot-mvebu-next.cmd that make use of upstream's Generic Distro Configuration. Since loadaddr and fdt_addr varibales are no longer required, remove the patch. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Helios4: mvebu-next: Add workaround for SPI and SATA concurrent access issue Concurrent access on SPI NOR and SATA drives can lead to unstable SATA. Therefore as workaround, disable SATA controller when SPI flash access is needed and make it as user configurable item in armbianEnv.txt This workaround might applies to Clearfog too. Refer to Commit 59af84c07c09 ("Helios4: Add SPI bootloader install feature (#1126)") Signed-off-by: Aditya Prayoga <aditya@kobol.io> * Bootscripts: Fixed boot-mvebu-next.cmd The environment setting (armbianEnv.txt) is loaded to RAM located on ${load_addr} but the env import use wrong address (${pxefile_addr_r}). bootargs still expect ${boot_interface} which carried over from boot- marvell.cmd. Upstream's distro configuration use ${devtype} instead. Signed-off-by: Aditya Prayoga <aditya@kobol.io> * uboot: mvebu-next: only apply DT fixup script if it exists * [ buildscript ] Add FORCE_BOOTSCRIPT_UPDATE option If enabled bootscript will get updated during bsp upgrade. * Helios4: Enable FORCE_BOOTSCRIPT_UPDATE by default in board config. * Helios4: Added boot-marvell.cmd compability to u-boot 2018 Revert the changes to use boot-mvebu-next.cmd instead of boot- marvell.cmd to prevent unbootable system due to incompatibility between u-boot 2013.01 and boot-mvebu-next.cmd This reverts commit 0f17ecb233babe ("Helios4: Use boot-mvebu-next bootscript") U-Boot 2018 will failed load dtb and script due to missing some variables on boot-marvell.cmd. This will render the system unbootable. Re-added and update loading-boot-scr.patch for backward compatibility Signed-off-by: Aditya Prayoga <aditya@kobol.io>
2018-11-29 13:58:39 +08:00
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# if boot script does not exits its recreated
EOF
fi
cat <<-EOF >> "${destination}"/DEBIAN/postinst
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
# move bootscript to /usr/share/armbian
# create a backup
[ -f /etc/armbian-release ] && . /etc/armbian-release
[ -z \${VERSION} ] && VERSION=$(echo \`date +%s\`)
if [ -f /boot/$bootscript_dst ]; then
cp /boot/$bootscript_dst /usr/share/armbian/${bootscript_dst}-\${VERSION} >/dev/null 2>&1
echo "NOTE: You can find previous bootscript versions in /usr/share/armbian !"
fi
# cleanup old bootscript backup
ls /usr/share/armbian/boot.cmd-* >/dev/null 2>&1 | head -n -5 | xargs rm -f --
ls /usr/share/armbian/boot.ini-* >/dev/null 2>&1 | head -n -5 | xargs rm -f --
echo "Recreating boot script"
cp /usr/share/armbian/$bootscript_dst /boot >/dev/null 2>&1
rootdev=\$(sed -e 's/^.*root=//' -e 's/ .*\$//' < /proc/cmdline)
rootfstype=\$(sed -e 's/^.*rootfstype=//' -e 's/ .*$//' < /proc/cmdline)
# recreate armbianEnv.txt only not exists
if [ ! -f /boot/armbianEnv.txt ]; then
cp /usr/share/armbian/armbianEnv.txt /boot >/dev/null 2>&1
echo "rootdev="\$rootdev >> /boot/armbianEnv.txt
echo "rootfstype="\$rootfstype >> /boot/armbianEnv.txt
fi
[ -f /boot/boot.ini ] && sed -i "s/setenv rootdev.*/setenv rootdev \\"\$rootdev\\"/" /boot/boot.ini
[ -f /boot/boot.ini ] && sed -i "s/setenv rootfstype.*/setenv rootfstype \\"\$rootfstype\\"/" /boot/boot.ini
[ -f /boot/boot.cmd ] && mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr >/dev/null 2>&1
fi
[ ! -f "/etc/network/interfaces" ] && cp /etc/network/interfaces.default /etc/network/interfaces
2016-06-08 19:49:47 +03:00
ln -sf /var/run/motd /etc/motd
rm -f /etc/update-motd.d/00-header /etc/update-motd.d/10-help-text
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
2017-07-24 16:38:00 +03:00
if [ ! -f "/etc/default/armbian-motd" ]; then
mv /etc/default/armbian-motd.dpkg-dist /etc/default/armbian-motd
2017-07-24 16:38:00 +03:00
fi
if [ ! -f "/etc/default/armbian-ramlog" ]; then
mv /etc/default/armbian-ramlog.dpkg-dist /etc/default/armbian-ramlog
fi
if [ ! -f "/etc/default/armbian-zram-config" ]; then
mv /etc/default/armbian-zram-config.dpkg-dist /etc/default/armbian-zram-config
fi
if [ -L "/usr/lib/chromium-browser/master_preferences.dpkg-dist" ]; then
mv /usr/lib/chromium-browser/master_preferences.dpkg-dist /usr/lib/chromium-browser/master_preferences
fi
sed -i "s/^PRETTY_NAME=.*/PRETTY_NAME=\"Armbian $REVISION "${RELEASE^}"\"/" /etc/os-release
echo "Armbian ${REVISION} ${RELEASE^} \\l \n" > /etc/issue
echo "Armbian ${REVISION} ${RELEASE^}" > /etc/issue.net
systemctl --no-reload enable armbian-hardware-monitor.service armbian-hardware-optimize.service armbian-zram-config.service >/dev/null 2>&1
2016-06-08 19:49:47 +03:00
exit 0
EOF
chmod 755 "${destination}"/DEBIAN/postinst
2016-04-08 18:26:32 +03:00
# won't recreate files if they were removed by user
2016-08-20 22:53:50 +03:00
# TODO: Add proper handling for updated conffiles
#cat <<-EOF > "${destination}"/DEBIAN/conffiles
2016-08-20 23:18:39 +03:00
#EOF
2016-06-08 19:49:47 +03:00
2017-07-24 16:38:00 +03:00
# copy common files from a premade directory structure
rsync -a ${SRC}/packages/bsp/common/* ${destination}
2017-07-24 16:38:00 +03:00
# trigger uInitrd creation after installation, to apply
# /etc/initramfs/post-update.d/99-uboot
cat <<-EOF > "${destination}"/DEBIAN/triggers
2016-06-08 19:49:47 +03:00
activate update-initramfs
EOF
2016-04-08 18:26:32 +03:00
2016-06-07 12:15:07 +03:00
# armhwinfo, firstrun, armbianmonitor, etc. config file
cat <<-EOF > "${destination}"/etc/armbian-release
2016-06-07 12:15:07 +03:00
# PLEASE DO NOT EDIT THIS FILE
BOARD=$BOARD
BOARD_NAME="$BOARD_NAME"
BOARDFAMILY=${BOARDFAMILY}
BUILD_REPOSITORY_URL=${BUILD_REPOSITORY_URL}
BUILD_REPOSITORY_COMMIT=${BUILD_REPOSITORY_COMMIT}
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
DISTRIBUTION_CODENAME=${RELEASE}
DISTRIBUTION_STATUS=${DISTRIBUTION_STATUS}
2016-06-07 12:15:07 +03:00
VERSION=$REVISION
2016-06-08 19:49:47 +03:00
LINUXFAMILY=$LINUXFAMILY
BRANCH=$BRANCH
ARCH=$ARCHITECTURE
IMAGE_TYPE=$IMAGE_TYPE
BOARD_TYPE=$BOARD_TYPE
INITRD_ARCH=$INITRD_ARCH
2017-08-18 16:59:06 +03:00
KERNEL_IMAGE_TYPE=$KERNEL_IMAGE_TYPE
2016-06-07 12:15:07 +03:00
EOF
# this is required for NFS boot to prevent deconfiguring the network on shutdown
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
sed -i 's/#no-auto-down/no-auto-down/g' "${destination}"/etc/network/interfaces.default
Remove K<4, change branches, new features (#1586) AR-1 - Adding support category for distributions AR-4 - Remove Allwinner legacy AR-5 - Drop Udoo family and move Udoo board into newly created imx6 family AR-9 - Rename sunxi-next to sunxi-legacy AR-10 - Rename sunxi-dev to sunxi-current AR-11 - Adding Radxa Rockpi S support AR-13 - Rename rockchip64-default to rockchip64-legacy AR-14 - Add rockchip64-current as mainline source AR-15 - Drop Rockchip 4.19.y NEXT, current become 5.3.y AR-16 - Rename RK3399 default to legacy AR-17 - Rename Odroid XU4 next and default to legacy 4.14.y, add DEV 5.4.y AR-18 - Add Odroid N2 current mainline AR-19 - Move Odroid C1 to meson family AR-20 - Rename mvebu64-default to mvebu64-legacy AR-21 - Rename mvebu-default to mvebu-legacy AR-22 - Rename mvebu-next to mvebu-current AR-23 - Drop meson64 default and next, current becomes former DEV 5.3.y AR-24 - Drop cubox family and move Cubox/Hummingboard boards under imx6 AR-26 - Adjust motd AR-27 - Enabling distribution release status AR-28 - Added new GCC compilers AR-29 - Implementing Ubuntu Eoan AR-30 - Add desktop packages per board or family AR-31 - Remove (Ubuntu/Debian) distribution name from image filename AR-32 - Move arch configs from configuration.sh to separate arm64 and armhf config files AR-33 - Revision numbers for beta builds changed to day_in_the_year AR-34 - Patches support linked patches AR-35 - Break meson64 family into gxbb and gxl AR-36 - Add Nanopineo2 Black AR-38 - Upgrade option from old branches to new one via armbian-config AR-41 - Show full timezone info AR-43 - Merge Odroid N2 to meson64 AR-44 - Enable FORCE_BOOTSCRIPT_UPDATE for all builds
2019-11-19 23:25:39 +01:00
if [[ $LINUXFAMILY == sunxi* ]]; then
# add mpv config for x11 output - slow, but it works compared to no config at all
# TODO: Test which output driver is better with DRM
mkdir -p "${destination}"/etc/mpv/
cp "${SRC}"/packages/bsp/mpv/mpv_mainline.conf "${destination}"/etc/mpv/mpv.conf
fi
# execute $LINUXFAMILY-specific tweaks
[[ $(type -t family_tweaks_bsp) == function ]] && family_tweaks_bsp
# add some summary to the image
fingerprint_image "${destination}/etc/armbian.txt"
2016-04-08 18:26:32 +03:00
2017-12-13 15:33:19 +03:00
# fixing permissions (basic), reference: dh_fixperms
find "${destination}" -print0 2>/dev/null | xargs -0r chown --no-dereference 0:0
find "${destination}" ! -type l -print0 2>/dev/null | xargs -0r chmod 'go=rX,u+rw,a-s'
2017-12-13 15:33:19 +03:00
# create board DEB file
2016-04-08 18:26:32 +03:00
display_alert "Building package" "$CHOSEN_ROOTFS" "info"
fakeroot dpkg-deb -b "${destination}" "${destination}.deb" >> "${DEST}"/debug/install.log 2>&1
Build all targets RFC (#1515) * Introducing build-all-ng * Implementing REBUILD_IMAGES='board1,board2,...' for rebuilding certain images only * Add optimisations when building kernels - only cycle trough needed targets. Adding variable for defining whether an image is build, otherwise only BSP is made. * repository manipulating RFC * Add bianco deb file that is added by default if repository is clean * Switch to gpg2 signing method, small bugfix * Create subdir for debs and debs-beta * Synaptic bugfix: installing indexing tools https://forum.armbian.com/topic/8021-orange-pi-one-synaptic-package-manager-search-very-slow/?do=findComment&comment=74918 * add all modules by default to Odroid N2, but leave them commented * Bugfix: not making any builds when selecting kernel_only * Remove EXTERNAL=yes ... move armbian-config and armbian-firmware into main compilation area, drop others since they are deprecated anyway. This will also enable multi threaded images making * Move armbian.list to create_sources_list function. Replace NTP by Chrony. Remove armbian-firmware from PACKAGE_LIST and RockPi 4A (#1528) * Replace NTP by chrony. Remove installion of outdated armbian-firmware from reposity. * added RockPi 4A * New format for board config * Fix Bluetooth dependencies for minimal package - add rfkill to family related installs * Moving networkd-dispatcher from minimal image * Cubox-i: update default config * Improving umount process * Add purgesource feature * Add FULL_DESKTOP to install few more applications on top of our desktop - notebooks should * rk3399 default: adjust patches and configuration * Enable full desktop on most powerfull boards and notebooks Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2019-09-01 22:13:13 +02:00
mkdir -p "${DEB_STORAGE}/${RELEASE}/"
rsync --remove-source-files -rq "${destination}.deb" "${DEB_STORAGE}/${RELEASE}/"
2016-06-08 19:49:47 +03:00
# cleanup
rm -rf ${bsptempdir}
2016-01-21 12:56:00 +01:00
}