Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare_host: Installing packages with the install_pkg_deb function #3374

Merged
merged 7 commits into from
Jan 5, 2022

Conversation

The-going
Copy link
Contributor

@The-going The-going commented Jan 2, 2022

Description

Installing packages using the install_pkg_deb function for the operating system of the build machine.

  • Test build image

Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@@ -1338,31 +1327,34 @@ prepare_host()
# packages list for host
# NOTE: please sync any changes here with the Dockerfile and Vagrantfile

# build aarch64
local hostdeps="acl aptly aria2 bc binfmt-support bison btrfs-progs \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I'd use bash arrays (declare -a) for hostdeps.
array syntax allows for multiline without needing \ so easier to reformat later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing packages using the install_pkg_deb function, which requires a list separated by a space, tab, or a newline character.

Verification code:

#!/bin/bash

	      hostdeps="acl aptly aria2 bc binfmt-support bison btrfs-progs       \
	build-essential  ca-certificates ccache cpio cryptsetup curl              \
	debian-archive-keyring debian-keyring debootstrap device-tree-compiler    \
	dialog dirmngr dosfstools dwarves f2fs-tools fakeroot flex gawk           \
	gcc-arm-linux-gnueabihf gdisk gnupg1 gpg imagemagick jq kmod libbison-dev \
	libc6-dev-armhf-cross libelf-dev libfdt-dev libfile-fcntllock-perl        \
	libfl-dev liblz4-tool libncurses-dev libpython2.7-dev libssl-dev          \
	libusb-1.0-0-dev linux-base locales lzop ncurses-base ncurses-term        \
	nfs-kernel-server ntpdate p7zip-full parted patchutils pigz pixz          \
	pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig   \
	systemd-container u-boot-tools udev unzip uuid-dev wget whiptail zip      \
	zlib1g-dev lib32ncurses-dev"

	list_deps="
	acl aptly aria2 bc binfmt-support bison btrfs-progs
	build-essential  ca-certificates ccache cpio cryptsetup curl
	debian-archive-keyring debian-keyring debootstrap device-tree-compiler
	dialog dirmngr dosfstools dwarves f2fs-tools fakeroot flex gawk
	gcc-arm-linux-gnueabihf gdisk gnupg1 gpg imagemagick jq kmod libbison-dev
	libc6-dev-armhf-cross libelf-dev libfdt-dev libfile-fcntllock-perl
	libfl-dev liblz4-tool libncurses-dev libpython2.7-dev libssl-dev
	libusb-1.0-0-dev linux-base locales lzop ncurses-base ncurses-term
	nfs-kernel-server ntpdate p7zip-full parted patchutils pigz pixz
	pkg-config pv python3-dev python3-distutils qemu-user-static rsync swig
	systemd-container u-boot-tools udev unzip uuid-dev wget whiptail zip
	zlib1g-dev lib32ncurses-dev
	"


test_print ()
{
	echo "$*"
	echo ""
	echo -e "$*"
	echo -e "\n=======\n"
}

test_print $hostdeps

test_print $list_deps

In this case, I want to show that if you want to write a long line,
then it should be separated by the "\" character at the 79th position of the line.
I.e., the line in script should not be longer than 80.

It is very difficult to read and correct the text of the code when you look at it through
a small screen panel in a console text editor. For example, directly on a working board.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. That's definitely not what I meant. Sorry.
I meant:

declare -a list_of_things=("one-thing" "another-thing"
                           "this-does-not-need-backslashes")
[[ a == a ]] && list_of_things+=("add_one_thing_later")
echo "${list_of_things[@]}" # expand the array correctly into a string, each thing a parameter
echo "${list_of_things[*]}" # expand into a single parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that you need a list of listed packages designed as an array but not as a string?
Is it easier for you to work with an array?

@The-going
Copy link
Contributor Author

It is most important to find out the opinion of users about the log that the install_pkg_deb function creates.

@igorpecovnik
Copy link
Member

opinion of users about the log that the install_pkg_deb function creates.

Do we need to have in and out list? Perhaps a list and exposed problematic one?

Bad package name: lib32ncurses-dev (on aarch64)

@The-going
Copy link
Contributor Author

Do we need to have in and out list? Perhaps a list and exposed problematic one?

Initially, I made this function for debugging build dependencies in projects that support older versions of debian. These packages cannot be built in the new ubuntu OS unless the build dependencies are fixed. It is for this reason that it is important for me to see this:

Incoming list:
pkg-config                     u-boot-tools                   binutils-arm-none-eabi         ruby                          
libusb-1.0-0-dev               libfdt-dev                     zlib1g-dev                                                   


status after installation:
binutils-arm-none-eabi      2.34-4ubuntu1+13ubuntu1 [ install ok installed ]
libfdt-dev                  1.5.1-1                 [ install ok installed ]
libusb-1.0-0-dev:arm64      2:1.0.23-2build1        [ install ok installed ]
pkg-config                  0.29.1-0ubuntu4         [ install ok installed ]
ruby                        1:2.7+1                 [ install ok installed ]
u-boot-tools                2021.01+dfsg-3ubuntu0~2 [ install ok installed ]
zlib1g-dev:arm64            1:1.2.11.dfsg-2ubuntu1. [ install ok installed ]

But we can make an additional parameter for debugging -V=1 or --verbose
and output by default only erroneous package names.
And with the parameter to make a complete output.

@The-going
Copy link
Contributor Author

Bad package name: lib32ncurses-dev (on aarch64)

Thanks. I'll fix it. But could this mean that not everything can be assembled for armhf on aarch64?

@igorpecovnik
Copy link
Member

igorpecovnik commented Jan 3, 2022

Thanks. I'll fix it. But could this mean that not everything can be assembled for armhf on aarch64?

Don't know for sure.

Probably unrelated - exotic legacy (u-)boot(s) might come with x86 binary tools for assembly or won't compile with distro compiler. So yes, not everything can be assembled on aarch64, but its not critical since those are going towards EOL.

Copy link
Member

@igorpecovnik igorpecovnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. If there is nothing more to change / add we are ready to merge.

@The-going
Copy link
Contributor Author

This stage, yes, can be merged. I'm still testing the next stage.

@igorpecovnik igorpecovnik merged commit 0282567 into armbian:master Jan 5, 2022
@rpardini
Copy link
Member

rpardini commented Jan 5, 2022

Tag for manual merge into logging branch

@igorpecovnik
Copy link
Member

@The-going host apt update should not run each time script is called. This has to be solved somehow or thrown under switch.

[ .... ] Installing build dependencies
Hit:1 http://si.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://si.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://si.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 https://download.docker.com/linux/ubuntu focal InRelease
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 http://packages.microsoft.com/repos/code stable InRelease
Hit:7 https://repo.skype.com/deb stable InRelease
Get:8 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:9 https://imola.armbian.com/beta focal InRelease
Fetched 114 kB in 1s (178 kB/s)
Reading package lists...

@The-going
Copy link
Contributor Author

host apt update should not run each time script is called. This has to be solved somehow or thrown under switch.

@igorpecovnik Before that it was:

	if [[ ${#deps[@]} -gt 0 ]]; then
		display_alert "Installing build dependencies"
		# don't prompt for apt cacher selection
		sudo echo "apt-cacher-ng    apt-cacher-ng/tunnelenable      boolean false" | sudo debconf-set-selections
		apt-get -q update
		apt-get -y upgrade
		apt-get -q -y --no-install-recommends install -o Dpkg::Options::='--force-confold' "${deps[@]}" | tee -a "${DEST}"/${LOG_SUBPATH}/hostdeps.log
		update-ccache-symlinks
	fi

If there is no target to install, then nothing happens.
I'll make this an exception.

rpardini pushed a commit to rpardini/armbian-build that referenced this pull request Jan 7, 2022
add ssv6051 driver for kernel 5.10 and 5.15

(cherry picked from commit f3388b9)

Add upstream patches (armbian#3380)

(cherry picked from commit d7794cc)

Fixes for Github Actions (armbian#3379)

* Update build-beta-images.yml

* Update build-kernel-on-merge-request.yml

* Update build-train.yml

(cherry picked from commit 6bfc83b)

Refactor armbian-bsp-cli package creation (armbian#3378)

* Refactor armbian-bsp-cli package creation

- added general distro status for all in separate file inside BSP
- remove branch and distro specifics

* Looking for prebuild pack

* Small fixes

(cherry picked from commit 310495d)

Cleanup. Remove deprecated build targets (armbian#3148)

* Update targets.conf

* Update targets-desktop-beta.conf

* Update targets-cli-beta.conf

* Update targets.conf

Update targets according ot current status of maintainer list
reduce userspaces to Focal
reduce to xfce default desktop
keep one minimal and one edge to check if they build at least.

* adjust support status according current maintainer sheet

* Readd pbp

* Readd pbp

* Readd C2

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
(cherry picked from commit 9d8a424)

prepare_host: Installing packages with the install_pkg_deb function (armbian#3374)

* separate joint and own lists for architecture

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Remove duplicate selection

* Final add Installing build dependencies

* libncurses: Do not use transitional package

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* add arch i386: Remove duplicate selection

* lib32ncurses-dev: Dependency only for amd64

* install_pkg_deb: parameter verbose to log

(cherry picked from commit 0282567)

Improve fist login UX (armbian#3375)

* Improve 1st login script

* Update packages/bsp/common/usr/lib/armbian/armbian-firstlogin

Co-authored-by: Manuel Rüger <manuel@rueg.eu>

* Address accessibility issue

Co-authored-by: Manuel Rüger <manuel@rueg.eu>
(cherry picked from commit e76a5b0)

fixes the manual launch of the installation script from USB media (armbian#3377)

(cherry picked from commit 3f8da05)

Bugfix - legacy kernels doesn't want to play nice with kernel options

When NFSD is enabled as module, kernel does not compile. But it works as build in. Since its pretty pointless to fix in the code, lets use this workaround.

FYI @patrickbkr

(cherry picked from commit 2b4e9e6)

Unify NFS configuration (armbian#3376)

* Unify NFS configuration
* Fix rk35xx kernel

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
(cherry picked from commit 7698848)

Limit sunxi-tools install to Allwinner family only

Close armbian#2941

(cherry picked from commit 181d0e2)

Re-enable rock-3a building now that it works (armbian#3373)

Revert a change in bddce2c now that rock-3a building succeeds and provides a usable image (armbian#3271)

(cherry picked from commit 32dc244)

sun50iw9 - bugfix - change phy driver to build-in since it breaks compilation when added as module

(cherry picked from commit 5a6b9b2)

Install debian packages using a special function (armbian#3368)

* Add new function install_pkg_deb

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Use the install_pkg_deb function

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* sunxi-tools: Calculate build dependencies

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* hostapd, hostapd-realtek: Calculate build dependencies

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Clean Environment for building as default

* upgrading: Repack a clean Environment archive

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
(cherry picked from commit fedc9c1)

fix kernel legacy for firefly-rk3399 (armbian#3369)

(cherry picked from commit e453e4d)

add station m2\p2 (armbian#3352)

(cherry picked from commit 08568a6)

Bump version to proceed on 22.02 Armbian Ratel

(cherry picked from commit 483c055)

Assemble needed runs into a GH Actions build train (armbian#3366)

(cherry picked from commit 7f556dc)

helios64: fix udev rules to let fancontrol work again (armbian#3367)

(cherry picked from commit 37662d8)

Fix the uboot for rock-3a (armbian#3271)

* Sync kernel config with radxa and remove packaging patch

* Merge the rockchip64 legacy config as well

* Lower priority of EFI partitioning against DOS partitioning which is used by Armbian

Co-authored-by: Catalin Toda <catalinii@yahoo.com>
(cherry picked from commit f6143ef)
useful64 pushed a commit to useful64/build that referenced this pull request Feb 4, 2022
…rmbian#3374)

* separate joint and own lists for architecture

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Remove duplicate selection

* Final add Installing build dependencies

* libncurses: Do not use transitional package

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* add arch i386: Remove duplicate selection

* lib32ncurses-dev: Dependency only for amd64

* install_pkg_deb: parameter verbose to log
useful64 pushed a commit to useful64/build that referenced this pull request Feb 4, 2022
…rmbian#3374)

* separate joint and own lists for architecture

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Remove duplicate selection

* Final add Installing build dependencies

* libncurses: Do not use transitional package

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* add arch i386: Remove duplicate selection

* lib32ncurses-dev: Dependency only for amd64

* install_pkg_deb: parameter verbose to log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants