Add exceptions to support native Ubuntu 20.04 building (#1764)

* Add exceptions to support native Ubuntu 20.04 building, fix small bug related to SD card write verification.

* Improve first install steps by installing Dialog and lsb_release first. This left out since we moved host install after we choose what we will do ... dialog is essential for this. Second we don't wait properly for APT manager to finish the process. Fixed with this commit

* Suppress output

* Update OdroidXU4 dev config & patches
This commit is contained in:
Igor Pečovnik
2020-02-02 10:31:30 +01:00
committed by GitHub
parent 6da5760a5a
commit 89a5a394ba
6 changed files with 6761 additions and 22 deletions

View File

@@ -113,8 +113,13 @@ fi
# Install Docker if not there but wanted. We cover only Debian based distro install. Else, manual Docker install is needed # Install Docker if not there but wanted. We cover only Debian based distro install. Else, manual Docker install is needed
if [[ "$1" == docker && -f /etc/debian_version && -z "$(which docker)" ]]; then if [[ "$1" == docker && -f /etc/debian_version && -z "$(which docker)" ]]; then
# add exception for Ubuntu Focal until Docker provides dedicated binary
codename=$(lsb_release -sc)
[[ $codename == focal ]] && codename="bionic"
display_alert "Docker not installed." "Installing" "Info" display_alert "Docker not installed." "Installing" "Info"
echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}') $(lsb_release -cs) edge" > /etc/apt/sources.list.d/docker.list echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}') ${codename} edge" > /etc/apt/sources.list.d/docker.list
# minimal set of utilities that are needed for prep # minimal set of utilities that are needed for prep
packages=("curl" "gnupg" "apt-transport-https") packages=("curl" "gnupg" "apt-transport-https")

View File

@@ -1 +0,0 @@
linux-odroidxu4-current.config

File diff suppressed because it is too large Load Diff

View File

@@ -613,7 +613,7 @@ create_image()
COMPRESS_OUTPUTIMAGE="sha,gpg,7z" COMPRESS_OUTPUTIMAGE="sha,gpg,7z"
fi fi
if [[ $COMPRESS_OUTPUTIMAGE == *sha* ]]; then if [[ $COMPRESS_OUTPUTIMAGE == *sha* || -n $CARD_DEVICE ]]; then
cd $DESTIMG cd $DESTIMG
display_alert "SHA256 calculating" "${version}.img" "info" display_alert "SHA256 calculating" "${version}.img" "info"
sha256sum -b ${version}.img > ${version}.img.sha sha256sum -b ${version}.img > ${version}.img.sha

View File

@@ -18,6 +18,8 @@
# distro_menu # distro_menu
# addtorepo # addtorepo
# repo-remove-old-packages # repo-remove-old-packages
# wait_for_package_manager
# prepare_host_basic
# prepare_host # prepare_host
# webseed # webseed
# download_and_verify # download_and_verify
@@ -657,6 +659,52 @@ repo-remove-old-packages() {
# wait_for_package_manager
#
# * installation will break if we try to install when package manager is running
#
wait_for_package_manager()
{
# exit if package manager is running in the back
while true; do
if [[ "$(fuser /var/lib/dpkg/lock 2>/dev/null; echo $?)" != 1 && "$(fuser /var/lib/dpkg/lock-frontend 2>/dev/null; echo $?)" != 1 ]]; then
display_alert "Package manager is running in the background." "Please wait! Retrying in 30 sec" "wrn"
sleep 30
else
break
fi
done
}
# prepare_host_basic
#
# * installs only basic packages
#
prepare_host_basic()
{
# wait until package manager finishes possible system maintanace
wait_for_package_manager
# 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"
apt -q update && apt install -q -y --no-install-recommends lsb-release
fi
# 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
display_alert "Installing package" "dialog"
apt -q update && apt install -q -y --no-install-recommends dialog
fi
}
# prepare_host # prepare_host
# #
# * checks and installs necessary packages # * checks and installs necessary packages
@@ -673,37 +721,33 @@ prepare_host()
exit_with_error "Running this tool on non x86-x64 build host in not supported" exit_with_error "Running this tool on non x86-x64 build host in not supported"
fi fi
# exit if package manager is running in the back # wait until package manager finishes possible system maintanace
while true; do wait_for_package_manager
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
# temporally fix for Locales settings # temporally fix for Locales settings
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
# 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"
apt -q update && apt install -q -y --no-install-recommends lsb-release
fi
# packages list for host # packages list for host
# NOTE: please sync any changes here with the Dockerfile and Vagrantfile # NOTE: please sync any changes here with the Dockerfile and Vagrantfile
local hostdeps="wget ca-certificates device-tree-compiler pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate \ local hostdeps="wget ca-certificates device-tree-compiler pv bc lzop zip binfmt-support build-essential ccache debootstrap ntpdate \
gawk gcc-arm-linux-gnueabihf qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev fakeroot \ gawk gcc-arm-linux-gnueabihf qemu-user-static u-boot-tools uuid-dev zlib1g-dev unzip libusb-1.0-0-dev fakeroot \
parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev \ parted pkg-config libncurses5-dev whiptail debian-keyring debian-archive-keyring f2fs-tools libfile-fcntllock-perl rsync libssl-dev \
nfs-kernel-server btrfs-progs ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross \ nfs-kernel-server btrfs-progs ncurses-term p7zip-full kmod dosfstools libc6-dev-armhf-cross \
curl patchutils python liblz4-tool libpython2.7-dev linux-base swig libpython-dev aptly acl \ curl patchutils liblz4-tool libpython2.7-dev linux-base swig aptly acl \
locales ncurses-base pixz dialog systemd-container udev lib32stdc++6 libc6-i386 lib32ncurses5 lib32tinfo5 \ locales ncurses-base pixz dialog systemd-container udev lib32stdc++6 libc6-i386 lib32ncurses5 lib32tinfo5 \
bison libbison-dev flex libfl-dev cryptsetup gpgv1 gnupg1 cpio aria2 pigz dirmngr" bison libbison-dev flex libfl-dev cryptsetup gpgv1 gnupg1 cpio aria2 pigz dirmngr"
local codename=$(lsb_release -sc) local codename=$(lsb_release -sc)
# Getting ready for Ubuntu 20.04
if [[ $codename == focal ]]; then
hostdeps+=" python2 python3 libpython3-dev"
ln -fs /usr/bin/python2.7 /usr/bin/python2
ln -fs /usr/bin/python2.7 /usr/bin/python
else
hostdeps+=" python libpython-dev"
fi
display_alert "Build host OS release" "${codename:-(unknown)}" "info" display_alert "Build host OS release" "${codename:-(unknown)}" "info"
# Ubuntu Xenial x86_64 is the only fully supported host OS release # Ubuntu Xenial x86_64 is the only fully supported host OS release
@@ -776,7 +820,7 @@ prepare_host()
display_alert "Installing build dependencies" display_alert "Installing build dependencies"
apt -q update apt -q update
apt -y upgrade apt -y upgrade
apt -q -y --no-install-recommends install "${deps[@]}" | tee -a $DEST/debug/hostdeps.log apt -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

View File

@@ -126,6 +126,9 @@ if [[ -n $REPOSITORY_UPDATE ]]; then
fi fi
# we need dialog to display the menu in case not installed. Other stuff gets installed later
prepare_host_basic
# if KERNEL_ONLY, KERNEL_CONFIGURE, BOARD, BRANCH or RELEASE are not set, display selection menu # if KERNEL_ONLY, KERNEL_CONFIGURE, BOARD, BRANCH or RELEASE are not set, display selection menu
if [[ -z $KERNEL_ONLY ]]; then if [[ -z $KERNEL_ONLY ]]; then

View File

@@ -1 +0,0 @@
odroidxu4-current