Fixes building on Linux Mint Tricia (Bionic based) (#1914)

* Replace apt with apt-get unless in chroot
* Improve support for Buster and Mint Debbie

Co-authored-by: Igor Pečovnik <igorpecovnik@users.noreply.github.com>
This commit is contained in:
Werner
2020-04-25 21:25:05 +02:00
committed by GitHub
parent c25a1b96b0
commit f78591db5b
5 changed files with 24 additions and 24 deletions

View File

@@ -44,7 +44,7 @@ build tools</h3>
## How to build an image or a kernel? ## How to build an image or a kernel?
```text ```text
apt -y install git apt-get -y install git
git clone https://github.com/armbian/build git clone https://github.com/armbian/build
cd build cd build
./compile.sh ./compile.sh

View File

@@ -86,15 +86,15 @@ rm $TMPFILE
# Check for required packages for compiling # Check for required packages for compiling
if [[ -z "$(which dialog)" ]]; then if [[ -z "$(which dialog)" ]]; then
sudo apt update sudo apt-get update
sudo apt install -y dialog sudo apt-get install -y dialog
fi fi
# Check for Vagrant # Check for Vagrant
if [[ "$1" == vagrant && -z "$(which vagrant)" ]]; then if [[ "$1" == vagrant && -z "$(which vagrant)" ]]; then
display_alert "Vagrant not installed." "Installing" display_alert "Vagrant not installed." "Installing"
sudo apt update sudo apt-get update
sudo apt install -y vagrant virtualbox sudo apt-get install -y vagrant virtualbox
fi fi
if [[ "$1" == dockerpurge && -f /etc/debian_version ]]; then if [[ "$1" == dockerpurge && -f /etc/debian_version ]]; then
@@ -129,12 +129,12 @@ if [[ "$1" == docker && -f /etc/debian_version && -z "$(which docker)" ]]; then
do do
[[ ! $(which $i) ]] && install_packages+=$i" " [[ ! $(which $i) ]] && install_packages+=$i" "
done done
[[ -z $install_packages ]] && apt update;apt install -y -qq --no-install-recommends $install_packages [[ -z $install_packages ]] && apt-get update;apt-get install -y -qq --no-install-recommends $install_packages
curl -fsSL "https://download.docker.com/linux/${codeid}/gpg" | apt-key add -qq - > /dev/null 2>&1 curl -fsSL "https://download.docker.com/linux/${codeid}/gpg" | apt-key add -qq - > /dev/null 2>&1
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt update apt-get update
apt install -y -qq --no-install-recommends docker-ce apt-get install -y -qq --no-install-recommends docker-ce
display_alert "Add yourself to docker group to avoid root privileges" "" "wrn" display_alert "Add yourself to docker group to avoid root privileges" "" "wrn"
"$SRC/compile.sh" "$@" "$SRC/compile.sh" "$@"
exit $? exit $?

View File

@@ -157,7 +157,7 @@ chroot_build_packages()
local t=$target_dir/root/.update-timestamp local t=$target_dir/root/.update-timestamp
if [[ ! -f $t || $(( ($(date +%s) - $(<$t)) / 86400 )) -gt 7 ]]; then if [[ ! -f $t || $(( ($(date +%s) - $(<$t)) / 86400 )) -gt 7 ]]; then
display_alert "Upgrading packages" "$release/$arch" "info" display_alert "Upgrading packages" "$release/$arch" "info"
systemd-nspawn -a -q -D $target_dir /bin/bash -c "apt -q update; apt -q -y upgrade; apt clean" systemd-nspawn -a -q -D $target_dir /bin/bash -c "apt-get -q update; apt-get -q -y upgrade; apt-get clean"
date +%s > $t date +%s > $t
fi fi
@@ -220,8 +220,8 @@ chroot_build_packages()
for packet in $package_builddeps; do grep -q -x -e "\$packet" <<< "\$installed" || deps+=("\$packet"); done for packet in $package_builddeps; do grep -q -x -e "\$packet" <<< "\$installed" || deps+=("\$packet"); done
if [[ \${#deps[@]} -gt 0 ]]; then if [[ \${#deps[@]} -gt 0 ]]; then
display_alert "Installing build dependencies" display_alert "Installing build dependencies"
apt -y -q update apt-get -y -q update
apt -y -q --no-install-recommends --show-progress -o DPKG::Progress-Fancy=1 install "\${deps[@]}" apt-get -y -q --no-install-recommends --show-progress -o DPKG::Progress-Fancy=1 install "\${deps[@]}"
fi fi
fi fi
display_alert "Copying sources" display_alert "Copying sources"
@@ -334,17 +334,17 @@ chroot_installpackages()
cat <<-EOF > "${SDCARD}"/tmp/install.sh cat <<-EOF > "${SDCARD}"/tmp/install.sh
#!/bin/bash #!/bin/bash
[[ "$remote_only" != yes ]] && apt-key add /tmp/buildpkg.key [[ "$remote_only" != yes ]] && apt-key add /tmp/buildpkg.key
apt $apt_extra -q update apt-get $apt_extra -q update
# uncomment to debug # uncomment to debug
# /bin/bash # /bin/bash
# TODO: check if package exists in case new config was added # TODO: check if package exists in case new config was added
#if [[ -n "$remote_only" == yes ]]; then #if [[ -n "$remote_only" == yes ]]; then
# for p in $install_list; do # for p in $install_list; do
# if grep -qE "apt.armbian.com|localhost" <(apt-cache madison \$p); then # if grep -qE "apt.armbian.com|localhost" <(apt-cache madison \$p); then
# if apt -s -qq install \$p; then # if apt-get -s -qq install \$p; then
#fi #fi
apt -q $apt_extra --show-progress -o DPKG::Progress-Fancy=1 install -y $install_list apt-get -q $apt_extra --show-progress -o DPKG::Progress-Fancy=1 install -y $install_list
apt clean apt-get clean
[[ "$remote_only" != yes ]] && apt-key del "925644A6" [[ "$remote_only" != yes ]] && apt-key del "925644A6"
rm /etc/apt/sources.list.d/armbian-temp.list 2>/dev/null rm /etc/apt/sources.list.d/armbian-temp.list 2>/dev/null
rm /etc/apt/preferences.d/90-armbian-temp.pref 2>/dev/null rm /etc/apt/preferences.d/90-armbian-temp.pref 2>/dev/null

View File

@@ -141,7 +141,7 @@ create_rootfs_cache()
# stage: debootstrap base system # stage: debootstrap base system
if [[ $NO_APT_CACHER != yes ]]; then if [[ $NO_APT_CACHER != yes ]]; then
# apt-cacher-ng apt proxy parameter # apt-cacher-ng apt-get proxy parameter
local apt_extra="-o Acquire::http::Proxy=\"http://${APT_PROXY_ADDR:-localhost:3142}\"" local apt_extra="-o Acquire::http::Proxy=\"http://${APT_PROXY_ADDR:-localhost:3142}\""
local apt_mirror="http://${APT_PROXY_ADDR:-localhost:3142}/$APT_MIRROR" local apt_mirror="http://${APT_PROXY_ADDR:-localhost:3142}/$APT_MIRROR"
else else
@@ -200,7 +200,7 @@ create_rootfs_cache()
eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "setupcon --save"' eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "setupcon --save"'
fi fi
# stage: create apt sources list # stage: create apt-get sources list
create_sources_list "$RELEASE" "$SDCARD/" create_sources_list "$RELEASE" "$SDCARD/"
# add armhf arhitecture to arm64 # add armhf arhitecture to arm64

View File

@@ -759,13 +759,13 @@ prepare_host_basic()
# need lsb_release to decide what to install # need lsb_release to decide what to install
if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' lsb-release 2>/dev/null) != *ii* ]]; then if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' lsb-release 2>/dev/null) != *ii* ]]; then
display_alert "Installing package" "lsb-release" display_alert "Installing package" "lsb-release"
apt -q update && apt install -q -y --no-install-recommends lsb-release apt-get -q update && apt-get install -q -y --no-install-recommends lsb-release
fi fi
# need to install dialog if person is starting with a interactive mode # need to install dialog if person is starting with a interactive mode
if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' dialog 2>/dev/null) != *ii* ]]; then if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' dialog 2>/dev/null) != *ii* ]]; then
display_alert "Installing package" "dialog" display_alert "Installing package" "dialog"
apt -q update && apt install -q -y --no-install-recommends dialog apt-get -q update && apt-get install -q -y --no-install-recommends dialog
fi fi
} }
@@ -837,7 +837,7 @@ prepare_host()
exit_with_error "Windows subsystem for Linux is not a supported build environment" exit_with_error "Windows subsystem for Linux is not a supported build environment"
fi fi
if [[ -z $codename || "focal" == "$codename" || "eoan" == "$codename" ]]; then if [[ -z $codename || "focal" == "$codename" || "eoan" == "$codename" || "debbie" == "$codename" || "buster" == "$codename" ]]; then
hostdeps="${hostdeps/lib32ncurses5 lib32tinfo5/lib32ncurses6 lib32tinfo6}" hostdeps="${hostdeps/lib32ncurses5 lib32tinfo5/lib32ncurses6 lib32tinfo6}"
fi fi
@@ -886,9 +886,9 @@ prepare_host()
if [[ ${#deps[@]} -gt 0 ]]; then if [[ ${#deps[@]} -gt 0 ]]; then
display_alert "Installing build dependencies" display_alert "Installing build dependencies"
apt -q update apt-get -q update
apt -y upgrade apt-get -y upgrade
apt -q -y --no-install-recommends install -o Dpkg::Options::='--force-confold' "${deps[@]}" | tee -a $DEST/debug/hostdeps.log apt-get -q -y --no-install-recommends install -o Dpkg::Options::='--force-confold' "${deps[@]}" | tee -a $DEST/debug/hostdeps.log
update-ccache-symlinks update-ccache-symlinks
fi fi
@@ -899,7 +899,7 @@ prepare_host()
fi fi
if [[ $(dpkg-query -W -f='${db:Status-Abbrev}\n' 'zlib1g:i386' 2>/dev/null) != *ii* ]]; then 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 apt-get install -qq -y --no-install-recommends zlib1g:i386 >/dev/null 2>&1
fi fi
# enable arm binary format so that the cross-architecture chroot environment will work # enable arm binary format so that the cross-architecture chroot environment will work