mirror of
https://github.com/armbian/build.git
synced 2025-08-13 14:46:58 +02:00
Merging main libs into the stable. Hack for building Bionic on Xenial left out
This commit is contained in:
parent
b241f5bca0
commit
d1a9c8a768
@ -7,19 +7,6 @@
|
||||
# This file is a part of the Armbian build script
|
||||
# https://github.com/armbian/build/
|
||||
|
||||
# Include here to make "display_alert" and "prepare_host" available
|
||||
source $SRC/lib/general.sh
|
||||
|
||||
# Script parameters handling
|
||||
for i in "$@"; do
|
||||
if [[ $i == *=* ]]; then
|
||||
parameter=${i%%=*}
|
||||
value=${i##*=}
|
||||
display_alert "Command line: setting $parameter to" "${value:-(empty)}" "info"
|
||||
eval $parameter=$value
|
||||
fi
|
||||
done
|
||||
|
||||
FORCEDRELEASE=$RELEASE
|
||||
|
||||
# when we want to build from certain start
|
||||
@ -28,7 +15,7 @@ FORCEDRELEASE=$RELEASE
|
||||
|
||||
rm -rf /run/armbian
|
||||
mkdir -p /run/armbian
|
||||
RELEASE_LIST=("xenial" "jessie" "stretch")
|
||||
RELEASE_LIST=("xenial" "jessie" "stretch" "bionic")
|
||||
BRANCH_LIST=("default" "next" "dev")
|
||||
|
||||
pack_upload ()
|
||||
@ -84,15 +71,20 @@ create_images_list()
|
||||
#
|
||||
# if parameter is true, than we build beta list
|
||||
#
|
||||
local naming="$SRC/config/boards/*.conf";
|
||||
local naming="$SRC/config/boards/*.conf";
|
||||
if [[ "$EXPERT" == "yes" ]]; then naming=$naming" $SRC/config/boards/*.wip"; fi
|
||||
|
||||
for board in $naming; do
|
||||
BOARD=$(basename $board | cut -d'.' -f1)
|
||||
local file="${SRC}/config/boards/${BOARD}"
|
||||
if [[ -f $file".conf" ]]; then source $file".conf"; fi
|
||||
if [[ -f $file".wip" ]]; then source $file".wip"; fi
|
||||
|
||||
|
||||
# beta targets are the same as stable. To build the same set beta set as future stable.
|
||||
if [[ "$MERGETARGETS" == "yes" ]]; then
|
||||
CLI_BETA_TARGET=$CLI_TARGET
|
||||
DESKTOP_BETA_TARGET=$DESKTOP_TARGET
|
||||
fi
|
||||
|
||||
if [[ -n $CLI_TARGET && -z $1 ]]; then
|
||||
|
||||
|
@ -27,9 +27,11 @@ create_chroot()
|
||||
apt_mirror['jessie']="$DEBIAN_MIRROR"
|
||||
apt_mirror['stretch']="$DEBIAN_MIRROR"
|
||||
apt_mirror['xenial']="$UBUNTU_MIRROR"
|
||||
apt_mirror['bionic']="$UBUNTU_MIRROR"
|
||||
components['jessie']='main,contrib'
|
||||
components['stretch']='main,contrib'
|
||||
components['xenial']='main,universe,multiverse'
|
||||
components['bionic']='main,universe,multiverse'
|
||||
display_alert "Creating build chroot" "$release/$arch" "info"
|
||||
local includes="ccache,locales,git,ca-certificates,devscripts,libfile-fcntllock-perl,debhelper,rsync,python3,distcc"
|
||||
if [[ $NO_APT_CACHER != yes ]]; then
|
||||
@ -82,6 +84,7 @@ chroot_prepare_distccd()
|
||||
gcc_version['jessie']='4.9'
|
||||
gcc_version['stretch']='6.3'
|
||||
gcc_version['xenial']='5.4'
|
||||
gcc_version['bionic']='5.4'
|
||||
gcc_type['armhf']='arm-linux-gnueabihf-'
|
||||
gcc_type['arm64']='aarch64-linux-gnu-'
|
||||
rm -f $dest/cmdlist
|
||||
@ -107,7 +110,7 @@ chroot_build_packages()
|
||||
{
|
||||
local built_ok=()
|
||||
local failed=()
|
||||
for release in jessie xenial stretch; do
|
||||
for release in jessie xenial stretch bionic; do
|
||||
for arch in armhf arm64; do
|
||||
display_alert "Starting package building process" "$release/$arch" "info"
|
||||
|
||||
|
@ -39,6 +39,9 @@ compile_atf()
|
||||
local toolchain=$(find_toolchain "$ATF_COMPILER" "$ATF_USE_GCC")
|
||||
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${ATF_COMPILER}gcc $ATF_USE_GCC"
|
||||
|
||||
local toolchain_extra=$(find_toolchain "arm-linux-gnueabi-" "> 5.0")
|
||||
[[ -z $toolchain_extra ]] && exit_with_error "Could not find required toolchain" "arm-linux-gnueabi- > 5.0"
|
||||
|
||||
display_alert "Compiler version" "${ATF_COMPILER}gcc $(eval env PATH=$toolchain:$PATH ${ATF_COMPILER}gcc -dumpversion)" "info"
|
||||
|
||||
local target_make=$(cut -d';' -f1 <<< $ATF_TARGET_MAP)
|
||||
@ -50,7 +53,7 @@ compile_atf()
|
||||
# create patch for manual source changes
|
||||
[[ $CREATE_PATCHES == yes ]] && userpatch_create "atf"
|
||||
|
||||
eval CCACHE_BASEDIR="$(pwd)" env PATH=$toolchain:$PATH \
|
||||
eval CCACHE_BASEDIR="$(pwd)" env PATH=$toolchain:$toolchain_extra:$PATH \
|
||||
'make $target_make $CTHREADS CROSS_COMPILE="$CCACHE $ATF_COMPILER"' 2>&1 \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Compiling ATF..." $TTY_Y $TTY_X'} \
|
||||
@ -138,8 +141,17 @@ compile_uboot()
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/compilation.log'} \
|
||||
${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'}
|
||||
|
||||
# armbian specifics u-boot settings
|
||||
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-armbian"/g' .config
|
||||
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION_AUTO=.*/# CONFIG_LOCALVERSION_AUTO is not set/g' .config
|
||||
if [[ $BOOTBRANCH == 'tag:v2018.03' ]]; then
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_IN_EXT4.*/CONFIG_ENV_IS_IN_EXT4=y/g' .config
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_IN_MMC.*/# CONFIG_ENV_IS_IN_MMC is not set/g' .config
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_NOWHERE.*/# CONFIG_ENV_IS_NOWHERE is not set/g' .config | echo "# CONFIG_ENV_IS_NOWHERE is not set" >> .config
|
||||
[[ -f .config ]] && echo 'CONFIG_ENV_EXT4_INTERFACE="mmc"' >> .config
|
||||
[[ -f .config ]] && echo 'CONFIG_ENV_EXT4_DEVICE_AND_PART="0:auto"' >> .config
|
||||
[[ -f .config ]] && echo 'CONFIG_ENV_EXT4_FILE="/boot/boot.env"' >> .config
|
||||
fi
|
||||
[[ -f tools/logos/udoo.bmp ]] && cp $SRC/packages/blobs/splash/udoo.bmp tools/logos/udoo.bmp
|
||||
touch .scmversion
|
||||
|
||||
@ -296,6 +308,12 @@ compile_kernel()
|
||||
fi
|
||||
fi
|
||||
|
||||
# hack for OdroidXU4. Copy firmare files
|
||||
if [[ $BOARD == odroidxu4 ]]; then
|
||||
mkdir -p $SRC/cache/sources/$LINUXSOURCEDIR/firmware/edid
|
||||
cp $SRC/packages/blobs/odroidxu4/*.bin $SRC/cache/sources/$LINUXSOURCEDIR/firmware/edid
|
||||
fi
|
||||
|
||||
# hack for deb builder. To pack what's missing in headers pack.
|
||||
cp $SRC/patch/misc/headers-debian-byteshift.patch /tmp
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
# common options
|
||||
# daily beta build contains date in subrevision
|
||||
if [[ $BETA == yes && -z $SUBREVISION ]]; then SUBREVISION="."$(date --date="tomorrow" +"%y%m%d"); fi
|
||||
REVISION="5.41$SUBREVISION" # all boards have same revision
|
||||
REVISION="5.45$SUBREVISION" # all boards have same revision
|
||||
ROOTPWD="1234" # Must be changed @first login
|
||||
MAINTAINER="Igor Pecovnik" # deb signature
|
||||
MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature
|
||||
@ -103,43 +103,50 @@ esac
|
||||
|
||||
BOOTCONFIG_VAR_NAME=BOOTCONFIG_${BRANCH^^}
|
||||
[[ -n ${!BOOTCONFIG_VAR_NAME} ]] && BOOTCONFIG=${!BOOTCONFIG_VAR_NAME}
|
||||
|
||||
[[ -z $LINUXCONFIG ]] && LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}"
|
||||
|
||||
[[ -z $BOOTPATCHDIR ]] && BOOTPATCHDIR="u-boot-$LINUXFAMILY"
|
||||
[[ -z $KERNELPATCHDIR ]] && KERNELPATCHDIR="$LINUXFAMILY-$BRANCH"
|
||||
|
||||
if [[ $RELEASE == xenial ]]; then DISTRIBUTION="Ubuntu"; else DISTRIBUTION="Debian"; fi
|
||||
if [[ $RELEASE == xenial || $RELEASE == bionic ]]; then DISTRIBUTION="Ubuntu"; else DISTRIBUTION="Debian"; fi
|
||||
|
||||
|
||||
# Essential packages
|
||||
PACKAGE_LIST="bc bridge-utils build-essential cpufrequtils device-tree-compiler figlet fbset fping \
|
||||
iw fake-hwclock wpasupplicant psmisc ntp parted rsync sudo curl linux-base dialog crda \
|
||||
wireless-regdb ncurses-term python3-apt sysfsutils toilet u-boot-tools unattended-upgrades \
|
||||
usbutils wireless-tools console-setup unicode-data openssh-server initramfs-tools \
|
||||
ca-certificates resolvconf expect rcconf iptables"
|
||||
ca-certificates resolvconf expect iptables automake \
|
||||
bison flex libwrap0-dev libssl-dev libnl-3-dev libnl-genl-3-dev"
|
||||
|
||||
# development related packages. remove when they are not needed for building packages in chroot
|
||||
PACKAGE_LIST="$PACKAGE_LIST automake bison flex libwrap0-dev libssl-dev libnl-3-dev libnl-genl-3-dev"
|
||||
|
||||
# Non-essential packages
|
||||
PACKAGE_LIST_ADDITIONAL="alsa-utils btrfs-tools dosfstools hddtemp iotop iozone3 stress sysbench screen ntfs-3g vim pciutils \
|
||||
evtest htop pv lsof apt-transport-https libfuse2 libdigest-sha-perl libproc-processtable-perl aptitude dnsutils f3 haveged \
|
||||
hdparm rfkill vlan sysstat bash-completion hostapd git ethtool network-manager unzip ifenslave command-not-found \
|
||||
libpam-systemd iperf3 software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping armbian-firmware"
|
||||
PACKAGE_LIST_ADDITIONAL="armbian-firmware alsa-utils btrfs-tools dosfstools iotop iozone3 stress sysbench screen \
|
||||
ntfs-3g vim pciutils evtest htop pv lsof apt-transport-https libfuse2 libdigest-sha-perl \
|
||||
libproc-processtable-perl aptitude dnsutils f3 haveged hdparm rfkill vlan sysstat bash-completion \
|
||||
hostapd git ethtool network-manager unzip ifenslave command-not-found libpam-systemd iperf3 \
|
||||
software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping qrencode"
|
||||
|
||||
|
||||
# Dependent desktop packages
|
||||
PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-fuse xfonts-base xinit \
|
||||
x11-xserver-utils xfce4 lxtask xfce4-terminal thunar-volman gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf \
|
||||
libgtk2.0-bin libgnome2-perl network-manager-gnome xfce4-notifyd gnome-keyring gcr libgck-1-0 p11-kit pasystray pavucontrol \
|
||||
pulseaudio pavumeter pulseaudio-module-gconf bluez bluez-tools pulseaudio-module-bluetooth blueman libpam-gnome-keyring \
|
||||
libgl1-mesa-dri policykit-1 profile-sync-daemon gnome-orca numix-gtk-theme"
|
||||
|
||||
|
||||
# Recommended desktop packages
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS="mirage galculator hexchat xfce4-screenshooter network-manager-openvpn-gnome mpv fbi cups-pk-helper \
|
||||
cups geany atril xarchiver leafpad"
|
||||
|
||||
PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-fuse xfonts-base xinit x11-xserver-utils xfce4 lxtask xfce4-terminal mirage thunar-volman galculator hexchat \
|
||||
gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf libgtk2.0-bin gcj-jre-headless xfce4-screenshooter libgnome2-perl gksu \
|
||||
network-manager-gnome network-manager-openvpn-gnome xfce4-notifyd gnome-keyring gcr libgck-1-0 libgcr-3-common p11-kit pasystray pavucontrol pulseaudio \
|
||||
paman pavumeter pulseaudio-module-gconf bluez bluez-tools pulseaudio-module-bluetooth blueman libpam-gnome-keyring libgl1-mesa-dri mpv \
|
||||
libreoffice-writer libreoffice-style-tango libreoffice-gtk policykit-1 fbi profile-sync-daemon cups-pk-helper cups mesa-utils mesa-utils-extra gnome-orca numix-icon-theme numix-gtk-theme"
|
||||
|
||||
case $DISPLAY_MANAGER in
|
||||
nodm)
|
||||
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP nodm"
|
||||
PACKAGE_LIST_DISPLAY_MANAGER="nodm"
|
||||
;;
|
||||
|
||||
lightdm)
|
||||
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP lightdm lightdm-gtk-greeter"
|
||||
PACKAGE_LIST_DISPLAY_MANAGER="lightdm lightdm-gtk-greeter"
|
||||
;;
|
||||
|
||||
*)
|
||||
@ -147,23 +154,38 @@ case $DISPLAY_MANAGER in
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Release specific packages
|
||||
case $RELEASE in
|
||||
|
||||
jessie)
|
||||
PACKAGE_LIST_RELEASE="less kbd gnupg2 dirmngr"
|
||||
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mozo pluma iceweasel thunderbird policykit-1-gnome eject system-config-printer"
|
||||
PACKAGE_LIST_DESKTOP+=" paman libgcr-3-common gcj-jre-headless policykit-1-gnome eject numix-icon-theme"
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS+=" iceweasel pluma system-config-printer"
|
||||
;;
|
||||
|
||||
xenial)
|
||||
PACKAGE_LIST_RELEASE="man-db wget nano zram-config"
|
||||
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP thunderbird chromium-browser language-selector-gnome paprefs numix-gtk-theme system-config-printer-common system-config-printer-gnome"
|
||||
[[ $ARCH == armhf ]] && PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mate-utils ubuntu-mate-welcome mate-settings-daemon"
|
||||
PACKAGE_LIST_DESKTOP+=" paman libgcr-3-common gcj-jre-headless paprefs numix-icon-theme"
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS+=" chromium-browser language-selector-gnome system-config-printer-common system-config-printer-gnome"
|
||||
;;
|
||||
|
||||
stretch)
|
||||
PACKAGE_LIST_RELEASE="man-db less kbd net-tools netcat-openbsd gnupg2 dirmngr"
|
||||
PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP thunderbird chromium paprefs numix-gtk-theme dbus-x11 system-config-printer-common system-config-printer"
|
||||
PACKAGE_LIST_DESKTOP+=" paman libgcr-3-common gcj-jre-headless paprefs dbus-x11"
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS+=" chromium system-config-printer-common system-config-printer"
|
||||
;;
|
||||
|
||||
bionic)
|
||||
PACKAGE_LIST_RELEASE="man-db zram-config less kbd net-tools netcat-openbsd gnupg2 dirmngr nano wget"
|
||||
PACKAGE_LIST_DESKTOP+=" xserver-xorg-input-all paprefs dbus-x11"
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS+=" chromium-browser system-config-printer-common system-config-printer language-selector-gnome"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
DEBIAN_MIRROR='httpredir.debian.org/debian'
|
||||
UBUNTU_MIRROR='ports.ubuntu.com/'
|
||||
|
||||
@ -188,7 +210,7 @@ PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_RELEASE $PACKAGE_LIST_ADDITIONAL"
|
||||
#PACKAGE_LIST_DESKTOP="${PACKAGE_LIST_DESKTOP/iceweasel/iceweasel:armhf}"
|
||||
#PACKAGE_LIST_DESKTOP="${PACKAGE_LIST_DESKTOP/thunderbird/thunderbird:armhf}"
|
||||
#fi
|
||||
[[ $BUILD_DESKTOP == yes ]] && PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_DESKTOP"
|
||||
[[ $BUILD_DESKTOP == yes ]] && PACKAGE_LIST="$PACKAGE_LIST $PACKAGE_LIST_DESKTOP $PACKAGE_LIST_DESKTOP_RECOMMENDS"
|
||||
|
||||
# remove any packages defined in PACKAGE_LIST_RM in lib.config
|
||||
if [[ -n $PACKAGE_LIST_RM ]]; then
|
||||
|
@ -54,11 +54,9 @@ debootstrap_ng()
|
||||
# install additional applications
|
||||
[[ $EXTERNAL == yes ]] && install_external_applications
|
||||
|
||||
# install desktop files
|
||||
[[ $BUILD_DESKTOP == yes ]] && install_desktop
|
||||
|
||||
# install locally built packages
|
||||
[[ $EXTERNAL_NEW == compile ]] && chroot_installpackages_local
|
||||
|
||||
# install from apt.armbian.com
|
||||
[[ $EXTERNAL_NEW == prebuilt ]] && chroot_installpackages "yes"
|
||||
|
||||
@ -97,7 +95,7 @@ create_rootfs_cache()
|
||||
local packages_hash=$(get_package_list_hash)
|
||||
local cache_fname=$SRC/cache/rootfs/${RELEASE}-ng-$ARCH.$packages_hash.tar.lz4
|
||||
local display_name=${RELEASE}-ng-$ARCH.${packages_hash:0:3}...${packages_hash:29}.tar.lz4
|
||||
if [[ -f $cache_fname ]]; then
|
||||
if [[ -f $cache_fname && "$ROOT_FS_CREATE_ONLY" != "force" ]]; then
|
||||
local date_diff=$(( ($(date +%s) - $(stat -c %Y $cache_fname)) / 86400 ))
|
||||
display_alert "Extracting $display_name" "$date_diff days old" "info"
|
||||
pv -p -b -r -c -N "$display_name" "$cache_fname" | lz4 -dc | tar xp --xattrs -C $SDCARD/
|
||||
@ -117,7 +115,7 @@ create_rootfs_cache()
|
||||
[[ -z $OUTPUT_DIALOG ]] && local apt_extra_progress="--show-progress -o DPKG::Progress-Fancy=1"
|
||||
|
||||
display_alert "Installing base system" "Stage 1/2" "info"
|
||||
eval 'debootstrap --include=locales ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
||||
eval 'debootstrap --include=locales,gnupg,ifupdown ${PACKAGE_LIST_EXCLUDE:+ --exclude=${PACKAGE_LIST_EXCLUDE// /,}} \
|
||||
--arch=$ARCH --foreign $RELEASE $SDCARD/ $apt_mirror' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Debootstrap (stage 1/2)..." $TTY_Y $TTY_X'} \
|
||||
@ -203,7 +201,7 @@ create_rootfs_cache()
|
||||
|
||||
# stage: install additional packages
|
||||
display_alert "Installing packages for" "Armbian" "info"
|
||||
eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -q \
|
||||
eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt -y -q \
|
||||
$apt_extra $apt_extra_progress --no-install-recommends install $PACKAGE_LIST"' \
|
||||
${PROGRESS_LOG_TO_FILE:+' | tee -a $DEST/debug/debootstrap.log'} \
|
||||
${OUTPUT_DIALOG:+' | dialog --backtitle "$backtitle" --progressbox "Installing Armbian system..." $TTY_Y $TTY_X'} \
|
||||
@ -232,6 +230,16 @@ create_rootfs_cache()
|
||||
tar cp --xattrs --directory=$SDCARD/ --exclude='./dev/*' --exclude='./proc/*' --exclude='./run/*' --exclude='./tmp/*' \
|
||||
--exclude='./sys/*' . | pv -p -b -r -s $(du -sb $SDCARD/ | cut -f1) -N "$display_name" | lz4 -c > $cache_fname
|
||||
fi
|
||||
|
||||
# used for internal purposes. Faster rootfs cache rebuilding
|
||||
if [[ -n "$ROOT_FS_CREATE_ONLY" ]]; then
|
||||
[[ $use_tmpfs = yes ]] && umount $SDCARD
|
||||
rm -rf $SDCARD
|
||||
# remove exit trap
|
||||
trap - INT TERM EXIT
|
||||
exit
|
||||
fi
|
||||
|
||||
mount_chroot "$SDCARD"
|
||||
} #############################################################################
|
||||
|
||||
@ -385,13 +393,14 @@ prepare_partitions()
|
||||
# stage: create fs, mount partitions, create fstab
|
||||
rm -f $SDCARD/etc/fstab
|
||||
if [[ -n $rootpart ]]; then
|
||||
local rootdevice="${LOOP}p${rootpart}"
|
||||
display_alert "Creating rootfs" "$ROOTFS_TYPE"
|
||||
check_loop_device "${LOOP}p${rootpart}"
|
||||
mkfs.${mkfs[$ROOTFS_TYPE]} ${mkopts[$ROOTFS_TYPE]} ${LOOP}p${rootpart}
|
||||
[[ $ROOTFS_TYPE == ext4 ]] && tune2fs -o journal_data_writeback ${LOOP}p${rootpart} > /dev/null
|
||||
check_loop_device "$rootdevice"
|
||||
mkfs.${mkfs[$ROOTFS_TYPE]} ${mkopts[$ROOTFS_TYPE]} $rootdevice
|
||||
[[ $ROOTFS_TYPE == ext4 ]] && tune2fs -o journal_data_writeback $rootdevice > /dev/null
|
||||
[[ $ROOTFS_TYPE == btrfs ]] && local fscreateopt="-o compress-force=zlib"
|
||||
mount ${fscreateopt} ${LOOP}p${rootpart} $MOUNT/
|
||||
local rootfs="UUID=$(blkid -s UUID -o value ${LOOP}p${rootpart})"
|
||||
mount ${fscreateopt} $rootdevice $MOUNT/
|
||||
local rootfs="UUID=$(blkid -s UUID -o value $rootdevice)"
|
||||
echo "$rootfs / ${mkfs[$ROOTFS_TYPE]} defaults,noatime,nodiratime${mountopts[$ROOTFS_TYPE]} 0 1" >> $SDCARD/etc/fstab
|
||||
fi
|
||||
if [[ -n $bootpart ]]; then
|
||||
@ -486,8 +495,8 @@ create_image()
|
||||
cd $DESTIMG
|
||||
sha256sum -b ${version}.img > sha256sum.sha
|
||||
if [[ -n $GPG_PASS ]]; then
|
||||
echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes ${version}.img
|
||||
echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --batch --yes armbian.txt
|
||||
echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes ${version}.img
|
||||
echo $GPG_PASS | gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes sha256sum.sha
|
||||
fi
|
||||
display_alert "Compressing" "$DEST/images/${version}.img" "info"
|
||||
7za a -t7z -bd -m0=lzma2 -mx=3 -mfb=64 -md=32m -ms=on $DEST/images/${version}.7z ${version}.img armbian.txt *.asc sha256sum.sha >/dev/null 2>&1
|
||||
|
148
lib/desktop.sh
148
lib/desktop.sh
@ -7,78 +7,118 @@
|
||||
# This file is a part of the Armbian build script
|
||||
# https://github.com/armbian/build/
|
||||
|
||||
install_desktop ()
|
||||
create_desktop_package ()
|
||||
{
|
||||
display_alert "Installing desktop" "XFCE" "info"
|
||||
# cleanup package list
|
||||
PACKAGE_LIST_DESKTOP=${PACKAGE_LIST_DESKTOP// /,}; PACKAGE_LIST_DESKTOP=${PACKAGE_LIST_DESKTOP//[[:space:]]/}
|
||||
PACKAGE_LIST_DESKTOP_RECOMMENDS=${PACKAGE_LIST_DESKTOP_RECOMMENDS// /,}; PACKAGE_LIST_DESKTOP_RECOMMENDS=${PACKAGE_LIST_DESKTOP_RECOMMENDS//[[:space:]]/}
|
||||
|
||||
# add loading desktop splash service
|
||||
cp $SRC/packages/blobs/desktop/desktop-splash/desktop-splash.service $SDCARD/etc/systemd/system/desktop-splash.service
|
||||
local destination=$SRC/.tmp/${RELEASE}/${BOARD}/${CHOSEN_DESKTOP}_${REVISION}_all
|
||||
rm -rf $destination
|
||||
mkdir -p $destination/DEBIAN
|
||||
|
||||
# install optimized firefox configuration
|
||||
if [[ -d $SDCARD/usr/lib/firefox-esr/ ]]; then
|
||||
cp $SRC/packages/blobs/desktop/firefox.conf $SDCARD/usr/lib/firefox-esr/mozilla.cfg
|
||||
echo 'pref("general.config.obscure_value", 0);' > $SDCARD/usr/lib/firefox-esr/defaults/pref/local-settings.js
|
||||
echo 'pref("general.config.filename", "mozilla.cfg");' >> $SDCARD/usr/lib/firefox-esr/defaults/pref/local-settings.js
|
||||
fi
|
||||
# set up control file
|
||||
cat <<-EOF > $destination/DEBIAN/control
|
||||
Package: ${CHOSEN_DESKTOP}
|
||||
Version: $REVISION
|
||||
Architecture: all
|
||||
Maintainer: $MAINTAINER <$MAINTAINERMAIL>
|
||||
Installed-Size: 1
|
||||
Section: xorg
|
||||
Priority: optional
|
||||
Depends: ${PACKAGE_LIST_DESKTOP//[:space:]+/,}
|
||||
Recommends: ${PACKAGE_LIST_DESKTOP_RECOMMENDS//[:space:]+/,}
|
||||
Provides: ${CHOSEN_DESKTOP}
|
||||
Description: Armbian desktop for ${DISTRIBUTION} ${RELEASE}
|
||||
EOF
|
||||
|
||||
# install optimized chromium configuration
|
||||
[[ -d $SDCARD/etc/chromium-browser ]] && cp $SRC/packages/blobs/desktop/chromium.conf $SDCARD/etc/chromium-browser/default
|
||||
[[ -d $SDCARD/etc/chromium.d ]] && cp $SRC/packages/blobs/desktop/chromium.conf $SDCARD/etc/chromium.d/chromium.conf
|
||||
cat <<-EOF > $destination/DEBIAN/postinst
|
||||
#!/bin/sh -e
|
||||
|
||||
# install default desktop settings
|
||||
cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/etc/skel
|
||||
cp -R $SRC/packages/blobs/desktop/skel/. $SDCARD/root
|
||||
# overwrite stock chromium and firefox configuration
|
||||
if [ -d /etc/chromium-browser/ ]; then ln -sf /etc/armbian/chromium.conf /etc/chromium-browser/default; fi
|
||||
if [ -d /etc/chromium.d/ ]; then ln -sf /etc/armbian/chromium.conf /etc/chromium.d/chromium.conf; fi
|
||||
cp -R /etc/armbian/chromium /usr/share
|
||||
# overwrite stock lightdm greeter configuration
|
||||
if [ -d /etc/armbian/lightdm ]; then cp -R /etc/armbian/lightdm /etc/; fi
|
||||
|
||||
# install dedicated startup icons
|
||||
cp $SRC/packages/blobs/desktop/icons/${DISTRIBUTION,,}.png $SDCARD/usr/share/pixmaps
|
||||
sed 's/xenial.png/'${DISTRIBUTION,,}'.png/' -i $SDCARD/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
|
||||
|
||||
# install wallpapers
|
||||
mkdir -p $SDCARD/usr/share/backgrounds/xfce/
|
||||
cp $SRC/packages/blobs/desktop/wallpapers/armbian*.jpg $SDCARD/usr/share/backgrounds/xfce/
|
||||
|
||||
# Install custom icons and theme
|
||||
cp $SRC/packages/blobs/desktop/numix-icon-theme_0.3+922~201711061547~ubuntu16.04.1_all.deb $SDCARD/root/
|
||||
chroot $SDCARD /bin/bash -c "dpkg -x /root/numix-icon-theme_0.3+922~201711061547~ubuntu16.04.1_all.deb /" >> $DEST/debug/install.log 2>&1
|
||||
chroot $SDCARD /bin/bash -c "gtk-update-icon-cache /usr/share/icons/Numix" >> $DEST/debug/install.log 2>&1
|
||||
chroot $SDCARD /bin/bash -c "gtk-update-icon-cache /usr/share/icons/Numix-Light" >> $DEST/debug/install.log 2>&1
|
||||
chroot $SDCARD /bin/bash -c "dpkg -x /root/numix-icon-theme_0.3+922~201711061547~ubuntu16.04.1_all.deb /" >> $DEST/debug/install.log 2>&1
|
||||
rm $SDCARD/root/numix-icon-theme_0.3+922~201711061547~ubuntu16.04.1_all.deb
|
||||
|
||||
# Install theme under Jessie since not exists in repository
|
||||
if [[ "${RELEASE}" == "jessie" ]]; then
|
||||
install_deb_chroot "$SRC/packages/blobs/desktop/numix-gtk-theme_2.6.7+670~201710270712~ubuntu17.10.1_all.deb"
|
||||
if [ -d /usr/lib/firefox-esr/ ]; then
|
||||
ln -sf /etc/armbian/firefox.conf /usr/lib/firefox-esr/mozilla.cfg
|
||||
echo 'pref("general.config.obscure_value", 0);' > /usr/lib/firefox-esr/defaults/pref/local-settings.js
|
||||
echo 'pref("general.config.filename", "mozilla.cfg");' >> /usr/lib/firefox-esr/defaults/pref/local-settings.js
|
||||
fi
|
||||
|
||||
# Adjust menu
|
||||
sed -i '0,/xfce4-about.desktop/s//armbian-donate.desktop/' $SDCARD/etc/xdg/menus/xfce-applications.menu
|
||||
sed -i '/armbian-donate.desktop/a \\t<Filename>armbian-support.desktop</Filename>/' $SDCARD/etc/xdg/menus/xfce-applications.menu
|
||||
sed -i -n '/<Menuname>Settings<\/Menuname>/{p;:a;N;/<Filename>xfce4-session-logout.desktop<\/Filename>/!ba;s/.*\n/\
|
||||
\t<Separator\/>\n\t<Merge type="all"\/>\n <Separator\/>\n <Filename>armbian-donate.desktop<\/Filename>\
|
||||
\n <Filename>armbian-support.desktop<\/Filename>\n/};p' /etc/xdg/menus/xfce-applications.menu
|
||||
|
||||
# Hide few items
|
||||
[[ -f $SDCARD/usr/share/applications/display-im6.q16.desktop ]] && mv $SDCARD/usr/share/applications/display-im6.q16.desktop $SDCARD/usr/share/applications/display-im6.q16.desktop.hidden
|
||||
[[ -f $SDCARD/usr/share/applications/display-im6.desktop ]] && mv $SDCARD/usr/share/applications/display-im6.desktop $SDCARD/usr/share/applications/display-im6.desktop.hidden
|
||||
[[ -f $SDCARD/usr/share/applications/vim.desktop ]] && mv $SDCARD/usr/share/applications/vim.desktop $SDCARD/usr/share/applications/vim.desktop.hidden
|
||||
[[ -f $SDCARD/usr/share/applications/libreoffice-startcenter.desktop ]] && mv $SDCARD/usr/share/applications/libreoffice-startcenter.desktop $SDCARD/usr/share/applications/libreoffice-startcenter.desktop.hidden
|
||||
|
||||
# Enable network manager
|
||||
if [[ -f $SDCARD/etc/NetworkManager/NetworkManager.conf ]]; then
|
||||
sed "s/managed=\(.*\)/managed=true/g" -i $SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
# Disable DNS management withing NM for !Stretch
|
||||
[[ $RELEASE != stretch ]] && sed "s/\[main\]/\[main\]\ndns=none/g" -i $SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
printf '[keyfile]\nunmanaged-devices=interface-name:p2p0\n' >> $SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
fi
|
||||
if [ -f /usr/share/applications/display-im6.q16.desktop ]; then mv /usr/share/applications/display-im6.q16.desktop /usr/share/applications/display-im6.q16.desktop.hidden; fi
|
||||
if [ -f /usr/share/applications/display-im6.desktop ]]; then mv /usr/share/applications/display-im6.desktop /usr/share/applications/display-im6.desktop.hidden; fi
|
||||
if [ -f /usr/share/applications/vim.desktop ]]; then mv /usr/share/applications/vim.desktop /usr/share/applications/vim.desktop.hidden; fi
|
||||
if [ -f /usr/share/applications/libreoffice-startcenter.desktop ]]; then mv /usr/share/applications/libreoffice-startcenter.desktop /usr/share/applications/libreoffice-startcenter.desktop.hidden; fi
|
||||
|
||||
# Disable Pulseaudio timer scheduling which does not work with sndhdmi driver
|
||||
if [[ -f $SDCARD/etc/pulse/default.pa ]]; then
|
||||
sed "s/load-module module-udev-detect$/& tsched=0/g" -i $SDCARD/etc/pulse/default.pa
|
||||
if [ -f /etc/pulse/default.pa ]; then sed "s/load-module module-udev-detect$/& tsched=0/g" -i /etc/pulse/default.pa; fi
|
||||
|
||||
[ -f /etc/default/nodm ] && sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i /etc/default/nodm
|
||||
exit 0
|
||||
EOF
|
||||
chmod 755 $destination/DEBIAN/postinst
|
||||
|
||||
# add loading desktop splash service
|
||||
mkdir -p $destination/etc/systemd/system/
|
||||
cp $SRC/packages/blobs/desktop/desktop-splash/desktop-splash.service $destination/etc/systemd/system/desktop-splash.service
|
||||
|
||||
# install optimized browser configurations
|
||||
mkdir -p $destination/etc/armbian
|
||||
cp $SRC/packages/blobs/desktop/chromium.conf $destination/etc/armbian
|
||||
cp $SRC/packages/blobs/desktop/firefox.conf $destination/etc/armbian
|
||||
cp -R $SRC/packages/blobs/desktop/chromium $destination/etc/armbian
|
||||
|
||||
# install lightdm greeter
|
||||
cp -R $SRC/packages/blobs/desktop/lightdm $destination/etc/armbian
|
||||
|
||||
# install default desktop settings
|
||||
mkdir -p $destination/etc/skel
|
||||
cp -R $SRC/packages/blobs/desktop/skel/. $destination/etc/skel
|
||||
|
||||
# using different icon pack. Workaround due to this bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867779
|
||||
if [[ ${RELEASE} == bionic || ${RELEASE} == stretch ]]; then
|
||||
sed -i 's/<property name="IconThemeName" type="string" value=".*$/<property name="IconThemeName" type="string" value="Humanity-Dark">/g' \
|
||||
$destination/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
|
||||
fi
|
||||
|
||||
# Disable desktop mode autostart for now to enforce creation of normal user account
|
||||
[[ -f $SDCARD/etc/default/nodm ]] && sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i $SDCARD/etc/default/nodm
|
||||
[[ -d $SDCARD/etc/lightdm ]] && chroot $SDCARD /bin/bash -c "systemctl --no-reload disable lightdm.service >/dev/null 2>&1"
|
||||
# install dedicated startup icons
|
||||
mkdir -p $destination/usr/share/pixmaps $destination/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/
|
||||
cp $SRC/packages/blobs/desktop/icons/${DISTRIBUTION,,}.png $destination/usr/share/pixmaps
|
||||
sed 's/xenial.png/'${DISTRIBUTION,,}'.png/' -i $destination/etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
|
||||
|
||||
# install logo for login screen
|
||||
cp $SRC/packages/blobs/desktop/icons/armbian.png $SDCARD/usr/share/pixmaps
|
||||
cp $SRC/packages/blobs/desktop/icons/armbian.png $destination/usr/share/pixmaps
|
||||
|
||||
# install wallpapers
|
||||
mkdir -p $destination/usr/share/backgrounds/xfce/
|
||||
cp $SRC/packages/blobs/desktop/wallpapers/armbian*.jpg $destination/usr/share/backgrounds/xfce/
|
||||
|
||||
# create board DEB file
|
||||
display_alert "Building desktop package" "${CHOSEN_DESKTOP}_${REVISION}_all" "info"
|
||||
fakeroot dpkg-deb -b $destination ${destination}.deb >/dev/null
|
||||
mkdir -p ${DEST}/debs/${RELEASE}
|
||||
mv ${destination}.deb $DEST/debs/${RELEASE}
|
||||
# cleanup
|
||||
rm -rf $destination
|
||||
}
|
||||
|
||||
desktop_postinstall ()
|
||||
{
|
||||
# stage: install display manager
|
||||
display_alert "Installing" "display manager: $DISPLAY_MANAGER" "info"
|
||||
chroot $SDCARD /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $PACKAGE_LIST_DISPLAY_MANAGER" >> $DEST/debug/install.log 2>&1
|
||||
[[ -f $SDCARD/etc/default/nodm ]] && sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i $SDCARD/etc/default/nodm
|
||||
[[ -d $SDCARD/etc/lightdm ]] && chroot $SDCARD /bin/bash -c "systemctl --no-reload disable lightdm.service >/dev/null 2>&1"
|
||||
|
||||
# Compile Turbo Frame buffer for sunxi
|
||||
if [[ $LINUXFAMILY == sun* && $BRANCH == default ]]; then
|
||||
|
@ -48,6 +48,9 @@ install_common()
|
||||
|
||||
mkdir -p $SDCARD/selinux
|
||||
|
||||
# remove Ubuntu's legal text
|
||||
[[ -f $SDCARD/etc/legal ]] && rm $SDCARD/etc/legal
|
||||
|
||||
# console fix due to Debian bug
|
||||
sed -e 's/CHARMAP=".*"/CHARMAP="'$CONSOLE_CHAR'"/g' -i $SDCARD/etc/default/console-setup
|
||||
|
||||
@ -103,11 +106,16 @@ install_common()
|
||||
ff02::2 ip6-allrouters
|
||||
EOF
|
||||
|
||||
# install kernel and u-boot packages
|
||||
install_deb_chroot "$DEST/debs/${CHOSEN_KERNEL}_${REVISION}_${ARCH}.deb"
|
||||
|
||||
display_alert "Installing u-boot" "$CHOSEN_UBOOT" "info"
|
||||
install_deb_chroot "$DEST/debs/${CHOSEN_UBOOT}_${REVISION}_${ARCH}.deb"
|
||||
|
||||
if [[ $BUILD_DESKTOP == yes ]]; then
|
||||
install_deb_chroot "$DEST/debs/$RELEASE/armbian-${RELEASE}-desktop_${REVISION}_all.deb"
|
||||
# install display manager
|
||||
desktop_postinstall
|
||||
fi
|
||||
|
||||
if [[ $INSTALL_HEADERS == yes ]]; then
|
||||
install_deb_chroot "$DEST/debs/${CHOSEN_KERNEL/image/headers}_${REVISION}_${ARCH}.deb"
|
||||
fi
|
||||
@ -182,9 +190,21 @@ install_common()
|
||||
# save initial armbian-release state
|
||||
cp $SDCARD/etc/armbian-release $SDCARD/etc/armbian-image-release
|
||||
|
||||
# DNS fix. package resolvconf is not available everywhere
|
||||
if [ -d /etc/resolvconf/resolv.conf.d ]; then
|
||||
echo 'nameserver 8.8.8.8' > $SDCARD/etc/resolvconf/resolv.conf.d/head
|
||||
fi
|
||||
|
||||
# premit root login via SSH for the first boot
|
||||
sed -i 's/#\?PermitRootLogin .*/PermitRootLogin yes/' $SDCARD/etc/ssh/sshd_config
|
||||
|
||||
# enable PubkeyAuthentication. Enabled by default everywhere except on Jessie
|
||||
sed -i 's/#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' $SDCARD/etc/ssh/sshd_config
|
||||
|
||||
# configure network manager
|
||||
sed "s/managed=\(.*\)/managed=true/g" -i $SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
# disable DNS management withing NM for !Stretch
|
||||
[[ $RELEASE != stretch ]] && sed "s/\[main\]/\[main\]\ndns=none/g" -i $SDCARD/etc/NetworkManager/NetworkManager.conf
|
||||
if [[ -n $NM_IGNORE_DEVICES ]]; then
|
||||
mkdir -p $SDCARD/etc/NetworkManager/conf.d/
|
||||
cat <<-EOF > $SDCARD/etc/NetworkManager/conf.d/10-ignore-interfaces.conf
|
||||
@ -232,6 +252,36 @@ install_distribution_specific()
|
||||
EOF
|
||||
chmod +x $SDCARD/etc/rc.local
|
||||
;;
|
||||
bionic)
|
||||
# remove doubled uname from motd
|
||||
[[ -f $SDCARD/etc/update-motd.d/10-uname ]] && rm $SDCARD/etc/update-motd.d/10-uname
|
||||
# remove motd news from motd.ubuntu.com
|
||||
[[ -f $SDCARD/etc/default/motd-news ]] && sed -i "s/^ENABLED=.*/ENABLED=0/" $SDCARD/etc/default/motd-news
|
||||
# rc.local is not existing in bionic but we might need it
|
||||
cat <<-EOF > $SDCARD/etc/rc.local
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# rc.local
|
||||
#
|
||||
# This script is executed at the end of each multiuser runlevel.
|
||||
# Make sure that the script will "exit 0" on success or any other
|
||||
# value on error.
|
||||
#
|
||||
# In order to enable or disable this script just change the execution
|
||||
# bits.
|
||||
#
|
||||
# By default this script does nothing.
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x $SDCARD/etc/rc.local
|
||||
# Basic Netplan config. Let NetworkManager manage all devices on this system
|
||||
cat <<-EOF > $SDCARD/etc/netplan/armbian-default.yaml
|
||||
network:
|
||||
version: 2
|
||||
renderer: NetworkManager
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,13 @@ cleaning()
|
||||
# easier than dealing with variable expansion and escaping dashes in file names
|
||||
find $DEST/debs -name "${CHOSEN_UBOOT}_*.deb" -delete
|
||||
find $DEST/debs \( -name "${CHOSEN_KERNEL}_*.deb" -o \
|
||||
-name "armbian-*.deb" -o \
|
||||
-name "${CHOSEN_KERNEL/image/dtb}_*.deb" -o \
|
||||
-name "${CHOSEN_KERNEL/image/headers}_*.deb" -o \
|
||||
-name "${CHOSEN_KERNEL/image/source}_*.deb" -o \
|
||||
-name "${CHOSEN_KERNEL/image/firmware-image}_*.deb" \) -delete
|
||||
[[ -n $RELEASE ]] && rm -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_*.deb
|
||||
[[ -n $RELEASE ]] && rm -f $DEST/debs/$RELEASE/armbian-desktop-${RELEASE}_*.deb
|
||||
fi
|
||||
;;
|
||||
|
||||
@ -141,7 +143,7 @@ create_sources_list()
|
||||
EOF
|
||||
;;
|
||||
|
||||
xenial)
|
||||
xenial|bionic)
|
||||
cat <<-EOF > $basedir/etc/apt/sources.list
|
||||
deb http://${UBUNTU_MIRROR} $release main restricted universe multiverse
|
||||
#deb-src http://${UBUNTU_MIRROR} $release main restricted universe multiverse
|
||||
@ -344,7 +346,7 @@ addtorepo()
|
||||
# parameter "delete" remove incoming directory if publishing is succesful
|
||||
# function: cycle trough distributions
|
||||
|
||||
local distributions=("jessie" "xenial" "stretch")
|
||||
local distributions=("jessie" "xenial" "stretch" "bionic")
|
||||
local errors=0
|
||||
|
||||
for release in "${distributions[@]}"; do
|
||||
@ -352,26 +354,26 @@ addtorepo()
|
||||
local forceoverwrite=""
|
||||
|
||||
# let's drop from publish if exits
|
||||
if [[ -n $(aptly publish list -config=../config/aptly.conf -raw | awk '{print $(NF)}' | grep $release) ]]; then
|
||||
aptly publish drop -config=../config/aptly.conf $release > /dev/null 2>&1
|
||||
if [[ -n $(aptly publish list -config=${SCRIPTPATH}config/aptly.conf -raw | awk '{print $(NF)}' | grep $release) ]]; then
|
||||
aptly publish drop -config=${SCRIPTPATH}config/aptly.conf $release > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# create local repository if not exist
|
||||
if [[ -z $(aptly repo list -config=../config/aptly.conf -raw | awk '{print $(NF)}' | grep $release) ]]; then
|
||||
if [[ -z $(aptly repo list -config=${SCRIPTPATH}config/aptly.conf -raw | awk '{print $(NF)}' | grep $release) ]]; then
|
||||
display_alert "Creating section" "$release" "info"
|
||||
aptly repo create -config=../config/aptly.conf -distribution=$release -component="main" \
|
||||
aptly repo create -config=${SCRIPTPATH}config/aptly.conf -distribution=$release -component="main" \
|
||||
-comment="Armbian main repository" ${release}
|
||||
fi
|
||||
if [[ -z $(aptly repo list -config=../config/aptly.conf -raw | awk '{print $(NF)}' | grep "^utils") ]]; then
|
||||
aptly repo create -config=../config/aptly.conf -distribution=$release -component="utils" \
|
||||
if [[ -z $(aptly repo list -config=${SCRIPTPATH}config/aptly.conf -raw | awk '{print $(NF)}' | grep "^utils") ]]; then
|
||||
aptly repo create -config=${SCRIPTPATH}config/aptly.conf -distribution=$release -component="utils" \
|
||||
-comment="Armbian utilities (backwards compatibility)" utils
|
||||
fi
|
||||
if [[ -z $(aptly repo list -config=../config/aptly.conf -raw | awk '{print $(NF)}' | grep "${release}-utils") ]]; then
|
||||
aptly repo create -config=../config/aptly.conf -distribution=$release -component="${release}-utils" \
|
||||
if [[ -z $(aptly repo list -config=${SCRIPTPATH}config/aptly.conf -raw | awk '{print $(NF)}' | grep "${release}-utils") ]]; then
|
||||
aptly repo create -config=${SCRIPTPATH}config/aptly.conf -distribution=$release -component="${release}-utils" \
|
||||
-comment="Armbian ${release} utilities" ${release}-utils
|
||||
fi
|
||||
if [[ -z $(aptly repo list -config=../config/aptly.conf -raw | awk '{print $(NF)}' | grep "${release}-desktop") ]]; then
|
||||
aptly repo create -config=../config/aptly.conf -distribution=$release -component="${release}-desktop" \
|
||||
if [[ -z $(aptly repo list -config=${SCRIPTPATH}config/aptly.conf -raw | awk '{print $(NF)}' | grep "${release}-desktop") ]]; then
|
||||
aptly repo create -config=${SCRIPTPATH}config/aptly.conf -distribution=$release -component="${release}-desktop" \
|
||||
-comment="Armbian ${release} desktop" ${release}-desktop
|
||||
fi
|
||||
|
||||
@ -379,11 +381,11 @@ addtorepo()
|
||||
# adding main
|
||||
if find $POT -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
|
||||
display_alert "Adding to repository $release" "main" "ext"
|
||||
aptly repo add -config=../config/aptly.conf $release ${POT}*.deb
|
||||
aptly repo add -config=${SCRIPTPATH}config/aptly.conf $release ${POT}*.deb
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# try again with
|
||||
display_alert "Adding by force to repository $release" "main" "ext"
|
||||
aptly repo add -force-replace=true -config=../config/aptly.conf $release ${POT}*.deb
|
||||
aptly repo add -force-replace=true -config=${SCRIPTPATH}config/aptly.conf $release ${POT}*.deb
|
||||
if [[ $? -eq 0 ]]; then forceoverwrite="-force-overwrite"; else errors=$((errors+1)); fi
|
||||
fi
|
||||
else
|
||||
@ -395,11 +397,11 @@ addtorepo()
|
||||
# adding main distribution packages
|
||||
if find ${POT}${release} -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
|
||||
display_alert "Adding to repository $release" "root" "ext"
|
||||
aptly repo add -config=../config/aptly.conf $release ${POT}${release}/*.deb
|
||||
aptly repo add -config=${SCRIPTPATH}config/aptly.conf $release ${POT}${release}/*.deb
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# try again with
|
||||
display_alert "Adding by force to repository $release" "root" "ext"
|
||||
aptly repo add -force-replace=true -config=../config/aptly.conf $release ${POT}${release}/*.deb
|
||||
aptly repo add -force-replace=true -config=${SCRIPTPATH}config/aptly.conf $release ${POT}${release}/*.deb
|
||||
if [[ $? -eq 0 ]]; then forceoverwrite="-force-overwrite"; else errors=$((errors+1));fi
|
||||
fi
|
||||
else
|
||||
@ -409,11 +411,11 @@ addtorepo()
|
||||
# adding old utils and new jessie-utils for backwards compatibility with older images
|
||||
if find ${POT}extra/jessie-utils -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
|
||||
display_alert "Adding to repository $release" "utils" "ext"
|
||||
aptly repo add -config=../config/aptly.conf "utils" ${POT}extra/jessie-utils/*.deb
|
||||
aptly repo add -config=${SCRIPTPATH}config/aptly.conf "utils" ${POT}extra/jessie-utils/*.deb
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# try again with
|
||||
display_alert "Adding by force to repository $release" "utils" "ext"
|
||||
aptly repo add -force-replace=true -config=../config/aptly.conf "utils" ${POT}extra/jessie-utils/*.deb
|
||||
aptly repo add -force-replace=true -config=${SCRIPTPATH}config/aptly.conf "utils" ${POT}extra/jessie-utils/*.deb
|
||||
if [[ $? -eq 0 ]]; then forceoverwrite="-force-overwrite"; else errors=$((errors+1));fi
|
||||
fi
|
||||
else
|
||||
@ -424,11 +426,11 @@ addtorepo()
|
||||
# adding release-specific utils
|
||||
if find ${POT}extra/${release}-utils -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
|
||||
display_alert "Adding to repository $release" "${release}-utils" "ext"
|
||||
aptly repo add -config=../config/aptly.conf "${release}-utils" ${POT}extra/${release}-utils/*.deb
|
||||
aptly repo add -config=${SCRIPTPATH}config/aptly.conf "${release}-utils" ${POT}extra/${release}-utils/*.deb
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# try again with
|
||||
display_alert "Adding by force to repository $release" "${release}-utils" "ext"
|
||||
aptly repo add -force-replace=true -config=../config/aptly.conf "${release}-utils" ${POT}extra/${release}-utils/*.deb
|
||||
aptly repo add -force-replace=true -config=${SCRIPTPATH}config/aptly.conf "${release}-utils" ${POT}extra/${release}-utils/*.deb
|
||||
if [[ $? -eq 0 ]]; then forceoverwrite="-force-overwrite"; else errors=$((errors+1));fi
|
||||
fi
|
||||
else
|
||||
@ -439,11 +441,11 @@ addtorepo()
|
||||
# adding desktop
|
||||
if find ${POT}extra/${release}-desktop -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
|
||||
display_alert "Adding to repository $release" "desktop" "ext"
|
||||
aptly repo add -config=../config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
|
||||
aptly repo add -config=${SCRIPTPATH}config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# try again with
|
||||
display_alert "Adding by force to repository $release" "desktop" "ext"
|
||||
aptly repo add -force-replace=true -config=../config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
|
||||
aptly repo add -force-replace=true -config=${SCRIPTPATH}config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
|
||||
if [[ $? -eq 0 ]]; then forceoverwrite="-force-overwrite"; else errors=$((errors+1));fi
|
||||
fi
|
||||
else
|
||||
@ -451,13 +453,13 @@ addtorepo()
|
||||
fi
|
||||
COMPONENTS="${COMPONENTS} ${release}-desktop"
|
||||
|
||||
local mainnum=$(aptly repo show -with-packages -config=../config/aptly.conf $release | grep "Number of packages" | awk '{print $NF}')
|
||||
local utilnum=$(aptly repo show -with-packages -config=../config/aptly.conf ${release}-desktop | grep "Number of packages" | awk '{print $NF}')
|
||||
local desknum=$(aptly repo show -with-packages -config=../config/aptly.conf ${release}-utils | grep "Number of packages" | awk '{print $NF}')
|
||||
local mainnum=$(aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf $release | grep "Number of packages" | awk '{print $NF}')
|
||||
local utilnum=$(aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf ${release}-desktop | grep "Number of packages" | awk '{print $NF}')
|
||||
local desknum=$(aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf ${release}-utils | grep "Number of packages" | awk '{print $NF}')
|
||||
|
||||
if [ $mainnum -gt 0 ] && [ $utilnum -gt 0 ] && [ $desknum -gt 0 ]; then
|
||||
# publish
|
||||
aptly publish $forceoverwrite -passphrase=$GPG_PASS -origin=Armbian -label=Armbian -config=../config/aptly.conf -component=${COMPONENTS// /,} \
|
||||
aptly publish $forceoverwrite -passphrase=$GPG_PASS -gpg-provider=internal -origin=Armbian -label=Armbian -config=${SCRIPTPATH}config/aptly.conf -component=${COMPONENTS// /,} \
|
||||
--distribution=$release repo $release ${COMPONENTS//main/}
|
||||
if [[ $? -ne 0 ]]; then
|
||||
display_alert "Publishing failed" "$release" "err"
|
||||
@ -473,7 +475,7 @@ addtorepo()
|
||||
|
||||
# display what we have
|
||||
display_alert "List of local repos" "local" "info"
|
||||
(aptly repo list -config=../config/aptly.conf) | egrep packages
|
||||
(aptly repo list -config=${SCRIPTPATH}config/aptly.conf) | egrep packages
|
||||
|
||||
# remove debs if no errors found
|
||||
if [[ $errors -eq 0 ]]; then
|
||||
@ -503,6 +505,17 @@ prepare_host()
|
||||
exit_with_error "Running this tool on non x86-x64 build host in not supported"
|
||||
fi
|
||||
|
||||
# exit if package manager is running in the back
|
||||
while true; do
|
||||
fuser -s /var/lib/dpkg/lock
|
||||
if [[ $? = 0 ]]; then
|
||||
display_alert "Package manager is running in the background." "retrying in 30 sec" "wrn"
|
||||
sleep 30
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# need lsb_release to decide what to install
|
||||
if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' lsb-release 2>/dev/null) != *ii* ]]; then
|
||||
display_alert "Installing package" "lsb-release"
|
||||
@ -576,19 +589,26 @@ prepare_host()
|
||||
echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list
|
||||
fi
|
||||
|
||||
if [[ ${#deps[@]} -gt 0 ]]; then
|
||||
display_alert "Installing build dependencies"
|
||||
apt -q update
|
||||
apt -y upgrade
|
||||
apt -q -y --no-install-recommends install "${deps[@]}" | tee -a $DEST/debug/hostdeps.log
|
||||
update-ccache-symlinks
|
||||
fi
|
||||
|
||||
# Temorally broken in Bionic, reverting to prvious version
|
||||
# https://github.com/aptly-dev/aptly/issues/740
|
||||
if [[ $(dpkg -s aptly | grep '^Version:' | sed 's/Version: //') != "1.2.0" && "$codename" == "bionic" ]]; then
|
||||
apt -qq -y --allow-downgrades install aptly=1.2.0
|
||||
fi
|
||||
|
||||
# sync clock
|
||||
if [[ $SYNC_CLOCK != no ]]; then
|
||||
display_alert "Syncing clock" "host" "info"
|
||||
ntpdate -s ${NTP_SERVER:- time.ijs.si}
|
||||
fi
|
||||
|
||||
if [[ ${#deps[@]} -gt 0 ]]; then
|
||||
display_alert "Installing build dependencies"
|
||||
apt -q update
|
||||
apt -q -y --no-install-recommends install "${deps[@]}" | tee -a $DEST/debug/hostdeps.log
|
||||
update-ccache-symlinks
|
||||
fi
|
||||
|
||||
if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' 'zlib1g:i386' 2>/dev/null) != *ii* ]]; then
|
||||
apt install -qq -y --no-install-recommends zlib1g:i386 >/dev/null 2>&1
|
||||
fi
|
||||
|
@ -122,6 +122,6 @@ install_deb_chroot()
|
||||
local name=$(basename $package)
|
||||
cp $package $SDCARD/root/$name
|
||||
display_alert "Installing" "$name"
|
||||
chroot $SDCARD /bin/bash -c "dpkg -i /root/$name" >> $DEST/debug/install.log 2>&1
|
||||
chroot $SDCARD /bin/bash -c "dpkg -i /root/$name; apt-get -y -f install" >> $DEST/debug/install.log 2>&1
|
||||
rm -f $SDCARD/root/$name
|
||||
}
|
17
lib/main.sh
17
lib/main.sh
@ -41,7 +41,6 @@ source $SRC/lib/debootstrap-ng.sh # System specific install
|
||||
source $SRC/lib/image-helpers.sh # helpers for OS image building
|
||||
source $SRC/lib/distributions.sh # System specific install
|
||||
source $SRC/lib/desktop.sh # Desktop specific install
|
||||
source $SRC/lib/desktop-ng.sh # Desktop package creation
|
||||
source $SRC/lib/compilation.sh # Patching and compilation of kernel, uboot, ATF
|
||||
source $SRC/lib/makeboarddeb.sh # Create board support package
|
||||
source $SRC/lib/general.sh # General functions
|
||||
@ -55,16 +54,6 @@ date +"%d_%m_%Y-%H_%M_%S" > $DEST/debug/timestamp
|
||||
# delete compressed logs older than 7 days
|
||||
(cd $DEST/debug && find . -name '*.tgz' -mtime +7 -delete) > /dev/null
|
||||
|
||||
# Script parameters handling
|
||||
for i in "$@"; do
|
||||
if [[ $i == *=* ]]; then
|
||||
parameter=${i%%=*}
|
||||
value=${i##*=}
|
||||
display_alert "Command line: setting $parameter to" "${value:-(empty)}" "info"
|
||||
eval $parameter=$value
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $PROGRESS_DISPLAY == none ]]; then
|
||||
OUTPUT_VERYSILENT=yes
|
||||
elif [[ $PROGRESS_DISPLAY == dialog ]]; then
|
||||
@ -186,7 +175,7 @@ if [[ -z $BRANCH ]]; then
|
||||
options=()
|
||||
[[ $KERNEL_TARGET == *default* ]] && options+=("default" "Vendor provided / legacy (3.4.x - 4.4.x)")
|
||||
[[ $KERNEL_TARGET == *next* ]] && options+=("next" "Mainline (@kernel.org) (4.x)")
|
||||
[[ $KERNEL_TARGET == *dev* && $EXPERT=yes ]] && options+=("dev" "\Z1Development version (4.x)\Zn")
|
||||
[[ $KERNEL_TARGET == *dev* && $EXPERT = yes ]] && options+=("dev" "\Z1Development version (4.x)\Zn")
|
||||
# do not display selection dialog if only one kernel branch is available
|
||||
if [[ "${#options[@]}" == 2 ]]; then
|
||||
BRANCH="${options[0]}"
|
||||
@ -207,6 +196,7 @@ if [[ $KERNEL_ONLY != yes && -z $RELEASE ]]; then
|
||||
options+=("jessie" "Debian 8 Jessie")
|
||||
options+=("stretch" "Debian 9 Stretch")
|
||||
options+=("xenial" "Ubuntu Xenial 16.04 LTS")
|
||||
[[ $EXPERT = yes ]] && options+=("bionic" "Ubuntu Bionic 18.04 LTS")
|
||||
RELEASE=$(dialog --stdout --title "Choose a release" --backtitle "$backtitle" --menu "Select the target OS release" \
|
||||
$TTY_Y $TTY_X $(($TTY_Y - 8)) "${options[@]}")
|
||||
unset options
|
||||
@ -274,6 +264,7 @@ 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_DESKTOP=armbian-${RELEASE}-desktop
|
||||
CHOSEN_KSRC=linux-source-${BRANCH}-${LINUXFAMILY}
|
||||
|
||||
for option in $(tr ',' ' ' <<< "$CLEAN_LEVEL"); do
|
||||
@ -303,7 +294,7 @@ VER="${VER/-$LINUXFAMILY/}"
|
||||
[[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb ]] && create_board_package
|
||||
|
||||
# create desktop package
|
||||
[[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/armbian-desktop-${RELEASE}_${REVISION}_all.deb ]] && create_desktop_package
|
||||
[[ -n $RELEASE && ! -f $DEST/debs/$RELEASE/${CHOSEN_DESKTOP}_${REVISION}_all.deb ]] && create_desktop_package
|
||||
|
||||
# build additional packages
|
||||
[[ $EXTERNAL_NEW == compile ]] && chroot_build_packages
|
||||
|
@ -36,7 +36,7 @@ create_board_package()
|
||||
Provides: armbian-bsp
|
||||
Conflicts: armbian-bsp
|
||||
Suggests: armbian-config
|
||||
Replaces: base-files, mpv, lightdm-gtk-greeter, chromium-browser, chromium, armbian-tools-$RELEASE
|
||||
Replaces: base-files, armbian-tools-$RELEASE
|
||||
Recommends: bsdutils, parted, python3-apt, util-linux, toilet
|
||||
Description: Armbian tweaks for $RELEASE on $BOARD ($BRANCH branch)
|
||||
EOF
|
||||
@ -136,7 +136,7 @@ create_board_package()
|
||||
EOF
|
||||
|
||||
# this is required for NFS boot to prevent deconfiguring the network on shutdown
|
||||
[[ $RELEASE == xenial || $RELEASE == stretch ]] && sed -i 's/#no-auto-down/no-auto-down/g' $destination/etc/network/interfaces.default
|
||||
[[ $RELEASE == xenial || $RELEASE == stretch || $RELEASE == bionic ]] && sed -i 's/#no-auto-down/no-auto-down/g' $destination/etc/network/interfaces.default
|
||||
|
||||
# install copy of boot script & environment file
|
||||
local bootscript_src=${BOOTSCRIPT%%:*}
|
||||
@ -191,6 +191,13 @@ create_board_package()
|
||||
cp $SRC/packages/bsp/zz-override-wifi-powersave-off.conf $destination/usr/lib/NetworkManager/conf.d/
|
||||
cp $SRC/packages/bsp/10-override-random-mac.conf $destination/usr/lib/NetworkManager/conf.d/
|
||||
;;
|
||||
|
||||
bionic)
|
||||
mkdir -p $destination/usr/lib/NetworkManager/conf.d/
|
||||
cp $SRC/packages/bsp/zz-override-wifi-powersave-off.conf $destination/usr/lib/NetworkManager/conf.d/
|
||||
cp $SRC/packages/bsp/10-override-random-mac.conf $destination/usr/lib/NetworkManager/conf.d/
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# execute $LINUXFAMILY-specific tweaks
|
||||
@ -205,7 +212,7 @@ create_board_package()
|
||||
|
||||
# create board DEB file
|
||||
display_alert "Building package" "$CHOSEN_ROOTFS" "info"
|
||||
fakeroot dpkg-deb -b $destination ${destination}.deb
|
||||
fakeroot dpkg-deb -b $destination ${destination}.deb >> $DEST/debug/install.log 2>&1
|
||||
mkdir -p $DEST/debs/$RELEASE/
|
||||
mv ${destination}.deb $DEST/debs/$RELEASE/
|
||||
# cleanup
|
||||
|
@ -11,34 +11,37 @@
|
||||
|
||||
# This script shows packages in local repository
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||
SCRIPTPATH=${SCRIPTPATH//lib}
|
||||
|
||||
# load user config
|
||||
[[ -f "../userpatches/lib.config" ]] && source "../userpatches/lib.config"
|
||||
[[ -f "${SCRIPTPATH}userpatches/lib.config" ]] && source "${SCRIPTPATH}/userpatches/lib.config"
|
||||
|
||||
# define debs path
|
||||
POT="../output/debs/"
|
||||
POT="${SCRIPTPATH}/output/debs/"
|
||||
|
||||
# load functions
|
||||
source general.sh
|
||||
source ${SCRIPTPATH}lib/general.sh
|
||||
|
||||
DISTROS=("jessie" "xenial" "stretch")
|
||||
DISTROS=("jessie" "xenial" "stretch" "bionic")
|
||||
|
||||
ParseOptions() {
|
||||
case $@ in
|
||||
serve)
|
||||
# display repository content
|
||||
display_alert "Serving content" "common utils" "ext"
|
||||
aptly serve -listen=:8080 -config=../config/aptly.conf
|
||||
aptly serve -listen=:8080 -config=${SCRIPTPATH}config/aptly.conf
|
||||
exit 0
|
||||
;;
|
||||
show)
|
||||
# display repository content
|
||||
for release in "${DISTROS[@]}"; do
|
||||
display_alert "Displaying repository contents for" "$release" "ext"
|
||||
aptly repo show -with-packages -config=../config/aptly.conf $release | tail -n +7
|
||||
aptly repo show -with-packages -config=../config/aptly.conf ${release}-desktop | tail -n +7
|
||||
aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf $release | tail -n +7
|
||||
aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf ${release}-desktop | tail -n +7
|
||||
done
|
||||
display_alert "Displaying repository contents for" "common utils" "ext"
|
||||
aptly repo show -with-packages -config=../config/aptly.conf utils | tail -n +7
|
||||
aptly repo show -with-packages -config=${SCRIPTPATH}config/aptly.conf utils | tail -n +7
|
||||
echo "done."
|
||||
exit 0
|
||||
;;
|
||||
@ -47,14 +50,17 @@ ParseOptions() {
|
||||
# run repository update
|
||||
addtorepo "$@" ""
|
||||
# add a key to repo
|
||||
cp ../config/armbian.key ../output/repository/public
|
||||
cp ${SCRIPTPATH}config/armbian.key ${SCRIPTPATH}output/repository/public
|
||||
exit 0
|
||||
;;
|
||||
purge)
|
||||
for release in "${DISTROS[@]}"; do
|
||||
repo-remove-old-packages "$release" "armhf" "5"
|
||||
repo-remove-old-packages "$release" "arm64" "5"
|
||||
aptly -config=../config/aptly.conf -passphrase=$GPG_PASS publish update $release
|
||||
repo-remove-old-packages "$release" "all" "5"
|
||||
aptly -config=${SCRIPTPATH}config/aptly.conf -passphrase=$GPG_PASS publish update $release
|
||||
# example to remove all packages from bionic that contain source in the name
|
||||
# aptly repo remove -config=${SCRIPTPATH}config/aptly.conf bionic 'Name (% *-source*)'
|
||||
done
|
||||
exit 0
|
||||
;;
|
||||
@ -75,7 +81,7 @@ repo-remove-old-packages() {
|
||||
local arch=$2
|
||||
local keep=$3
|
||||
|
||||
for pkg in $(aptly repo search -config=../config/aptly.conf $repo "Architecture ($arch)" | grep -v "ERROR: no results" | sort -rV); do
|
||||
for pkg in $(aptly repo search -config=${SCRIPTPATH}config/aptly.conf $repo "Architecture ($arch)" | grep -v "ERROR: no results" | sort -rV); do
|
||||
local pkg_name=$(echo $pkg | cut -d_ -f1)
|
||||
if [ "$pkg_name" != "$cur_pkg" ]; then
|
||||
local count=0
|
||||
@ -86,7 +92,7 @@ repo-remove-old-packages() {
|
||||
let count+=1
|
||||
if [ $count -gt $keep ]; then
|
||||
pkg_version=$(echo $pkg | cut -d_ -f2)
|
||||
aptly repo remove -config=../config/aptly.conf $repo "Name ($pkg_name), Version (<= $pkg_version)"
|
||||
aptly repo remove -config=${SCRIPTPATH}config/aptly.conf $repo "Name ($pkg_name), Version (<= $pkg_version)"
|
||||
deleted='yes'
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user