manjaro-arm-tools issueshttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues2018-08-08T19:18:33Zhttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/8[buildarmimg] Add the new resize-fs.service to be run on first boot2018-08-08T19:18:33ZGhost User[buildarmimg] Add the new resize-fs.service to be run on first bootThe `manjaro-system` package recently got a new resize-fs script, to automaticly resize the image on first boot.
It needs to be enabled in the build script/profile.The `manjaro-system` package recently got a new resize-fs script, to automaticly resize the image on first boot.
It needs to be enabled in the build script/profile.2.0https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/7Clean up terminal spam2018-08-08T19:18:51ZGhost UserClean up terminal spamThe build tools produce a lot of terminal spam, because of the nature of `systemd-nspawn` and `qemu`.
Would be great if only errors was shown for most parts of the build processes.The build tools produce a lot of terminal spam, because of the nature of `systemd-nspawn` and `qemu`.
Would be great if only errors was shown for most parts of the build processes.2.0https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/6Replace basestrap with pacstrap2018-08-08T19:19:09ZGhost UserReplace basestrap with pacstrapReplace `basestrap` with `pacstrap` so the tools work on all Arch Linux derivatives and not just Manjaro.Replace `basestrap` with `pacstrap` so the tools work on all Arch Linux derivatives and not just Manjaro.2.0https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/57[generic-efi] Images using btrfs does not boot2022-10-06T19:19:03ZGhost User[generic-efi] Images using btrfs does not bootA couple of small changes is needed to the default grub.cfg to be able to boot from btrfs, but even with `rootflags=subvol=@` and `rootfstype=btrfs` added, when we boot we still get:
```
error: sparse not found
error: extent not found
e...A couple of small changes is needed to the default grub.cfg to be able to boot from btrfs, but even with `rootflags=subvol=@` and `rootfstype=btrfs` added, when we boot we still get:
```
error: sparse not found
error: extent not found
error: kernel image needs to be loaded first
```
As far as I can tell, the extent error point to errors on the btrfs filesystem it self, but it does not happen with other profiles. Only the EFI/GRUB based one.https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/56[generic-efi] Some images don't get $ROOT_UUID defined2022-10-04T12:43:23ZGhost User[generic-efi] Some images don't get $ROOT_UUID definedFor some reason, currently unknown to me, some `generic-efi` images do not get a proper `$ROOT_UUID` set for Grub, while others, in the same CI run does. This results in the affected images to "Not able to find root" error after selectin...For some reason, currently unknown to me, some `generic-efi` images do not get a proper `$ROOT_UUID` set for Grub, while others, in the same CI run does. This results in the affected images to "Not able to find root" error after selecting the entry in Grub.
I have only seen this issue happen on the Github CI and I currently have no idea why.
Example:
In the last Dev image run today Minimal and Sway editions got the UUID, while the rest did not. There is nothing in the tools, as far as I can tell, that would prohibit the other editions from getting it.
I have verified that creating a `kde-plasma` (one of the failed ones) image on my local desktop, gets UUID just fine.https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/55[buildarmimg] generic-efi device has no functuonal grub2022-09-18T17:33:39ZGhost User[buildarmimg] generic-efi device has no functuonal grubThe `generic-efi` device currently just boots to a grub rescue shell.
I believe this is because the step where we create the grub.cfg config currently fails with a "No canonical path to /dev/loop2" error, when we run `grub-mkconfig` ins...The `generic-efi` device currently just boots to a grub rescue shell.
I believe this is because the step where we create the grub.cfg config currently fails with a "No canonical path to /dev/loop2" error, when we run `grub-mkconfig` inside the rootfs.
I've tried running the step from the host, but that results in all the hosts kernels getting probed and added to the rootfs config. Which is not what we want.
Good news is, this should be the last issue, before we have a working generic EFI based image.https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/54Cannot install local pkg2022-08-19T10:27:31ZDanny WaserCannot install local pkgI've build some packages for aarch64 (`aarch64-none-linux-gnu-gcc-10.3-bin` and `bazelisk`). I need them as build dependencies for another package (`stt`) so I try to install the local package to build but this happens:
```zsh
❯ sudo bui...I've build some packages for aarch64 (`aarch64-none-linux-gnu-gcc-10.3-bin` and `bazelisk`). I need them as build dependencies for another package (`stt`) so I try to install the local package to build but this happens:
```zsh
❯ sudo buildarmpkg -p stt -a aarch64 -i aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst,bazelisk-1.12.0-1-aarch64.pkg.tar.zst
declare -a packages=([0]="aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst" [1]=$'bazelisk-1.12.0-1-aarch64.pkg.tar.zst\n')
File found: aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst
aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst is compatible with aarch64
File found: bazelisk-1.12.0-1-aarch64.pkg.tar.zst
bazelisk-1.12.0-1-aarch64.pkg.tar.zst is compatible with aarch64
==> Building stt for aarch64...
-> Removing old rootfs...
==> Creating rootfs...
-> Switching branch to stable...
==> Creating install root at /var/lib/manjaro-arm-tools/pkg/aarch64
==> Installing packages to /var/lib/manjaro-arm-tools/pkg/aarch64
...
~~~
...
==> Configuring rootfs for building...
:: Synchronizing package databases...
core 270.6 KiB 307 KiB/s 00:01 [######################] 100%
extra 2.5 MiB 1060 KiB/s 00:02 [######################] 100%
community 6.6 MiB 1964 KiB/s 00:03 [######################] 100%
-> Installing local package {aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst,bazelisk-1.12.0-1-aarch64.pkg.tar.zst} to rootfs...
declare -a packages=([0]="aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst" [1]=$'bazelisk-1.12.0-1-aarch64.pkg.tar.zst\n')
List of packages to add:
/home/waser/Repository/aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst
/home/waser/Repository/bazelisk-1.12.0-1-aarch64.pkg.tar.zst
loading packages...
error: '/var/cache/pacman/pkg/aarch64-none-linux-gnu-gcc-10.3-bin.pkg.tar.zst': could not find or read package
error: '/var/cache/pacman/pkg/bazelisk-1.12.0-1-aarch64.pkg.tar.zst': could not find or read package
ERROR:
There was a problem with installing the local package/s.
Please,check the logs.
```
The readme says to make a dir with the pkg(s) inside but that changed a while ago. I never needed a local pkg so maybe I'm doing something wrong here...
```
Manjaro ARM Tools: 2.10.9-1
Linux Manjaro 5.15.55-1-MANJARO #1 SMP PREEMPT Fri Jul 15 09:45:39 UTC 2022 x86_64 GNU/Linux
```https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/53add rpi4-cutiepi device because specific cmdline.txt2022-04-24T17:52:12ZJozef Mlichadd rpi4-cutiepi device because specific cmdline.txtSee discussion at https://forum.manjaro.org/t/shiping-different-config-txt-and-cmdline-txt-for-cutiepi/109175/7
[0001-rpi4-cutiepi-cmdline.txt.patch](/uploads/5978f97f2a574edf34aa4a490a205e32/0001-rpi4-cutiepi-cmdline.txt.patch)
There ...See discussion at https://forum.manjaro.org/t/shiping-different-config-txt-and-cmdline-txt-for-cutiepi/109175/7
[0001-rpi4-cutiepi-cmdline.txt.patch](/uploads/5978f97f2a574edf34aa4a490a205e32/0001-rpi4-cutiepi-cmdline.txt.patch)
There are some related changes in arm-profiles
https://gitlab.manjaro.org/manjaro-arm/applications/arm-profiles/-/issues/14
There are two related packages which must be added yet
https://github.com/jmlich/nemo-packaging/tree/master/cutiepi-kernel-config
https://github.com/jmlich/nemo-packaging/tree/master/cutiepi-cutoffhttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/52[buildarmimg] loop devices do not work on kernel 5.16 and above2022-04-25T10:06:38ZGhost User[buildarmimg] loop devices do not work on kernel 5.16 and above`buildarmimg` uses Loop devices to create the image with partitions and such.
Kernel 5.16 seems to have changed something in the loop driver though, resulting in partitions created on a loopX device to not be listed with `lsblk`, `parte...`buildarmimg` uses Loop devices to create the image with partitions and such.
Kernel 5.16 seems to have changed something in the loop driver though, resulting in partitions created on a loopX device to not be listed with `lsblk`, `parted -l` etc. Because of this, the image generation step fails.
Workaround for now is to use kernel 5.15 or below, until we figure out how we can do this in the future.https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/51Add nemomobile edition2022-01-28T13:17:09ZChupligin SergeyAdd nemomobile editionPlz add nemomobile edition patch https://pastebin.com/Nhym9ChuPlz add nemomobile edition patch https://pastebin.com/Nhym9Chuhttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/50manjaro user is not in autologin group2022-02-23T22:52:21ZJozef Mlichmanjaro user is not in autologin groupIt seems that manjaro-arm-tools creates autologin group and add user manjaro into that group. See
https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/lib/functions.sh#L394
This code doesn't work anymore f...It seems that manjaro-arm-tools creates autologin group and add user manjaro into that group. See
https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/lib/functions.sh#L394
This code doesn't work anymore for some reason. As consequence we have created following ugly hack:
https://github.com/neochapay/nemo-device-dont_be_evil/blob/master/sparse/usr/bin/nemomobile-post-install.shhttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/49Less code duplication2022-01-17T13:21:33ZyarlLess code duplication```
The following changes since commit 28bab50823c3d634724b918c08a09a92c0b649cc:
add maui-shell (experimental) (2022-01-13 10:43:18 +0100)
are available in the Git repository at:
https://gitlab.com/yarl-manjaro/manjaro-arm-tools.g...```
The following changes since commit 28bab50823c3d634724b918c08a09a92c0b649cc:
add maui-shell (experimental) (2022-01-13 10:43:18 +0100)
are available in the Git repository at:
https://gitlab.com/yarl-manjaro/manjaro-arm-tools.git less-code-duplication
for you to fetch changes up to e13f71bc01aad96d25c051b62dad4b3508584b85:
Less code duplication (2022-01-17 11:09:00 +0100)
----------------------------------------------------------------
yarl (1):
Less code duplication
bin/buildarmimg | 17 +++--------------
bin/buildarmpkg | 18 ++++--------------
bin/builddockerimg | 12 ++----------
bin/buildemmcinstaller | 12 ++----------
bin/buildrootfs | 12 ++----------
bin/getarmprofiles | 5 +----
lib/functions.sh | 25 +++++++++++++++++++++++++
7 files changed, 39 insertions(+), 62 deletions(-)
diff --git a/bin/buildarmimg b/bin/buildarmimg
index 29122d6..371430d 100755
--- a/bin/buildarmimg
+++ b/bin/buildarmimg
@@ -14,18 +14,10 @@ CHROOTDIR=$ROOTFS_IMG/rootfs_$ARCH
PKG_CACHE=$CHROOTDIR/var/cache/pacman/pkg
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
# check if script is already running
-for pid in $(pidof -x buildarmimg); do
- if [ $pid != $$ ]; then
- echo "[$(date)] : buildarmimg : Process is already running with PID $pid"
- exit 1
- fi
-done
+checkrunning
#Arguments
opt=":e:d:v:i:b:nfxhk:mos:p:c"
@@ -103,10 +95,7 @@ if [ ! -d "$PROFILES/arm-profiles" ]; then
fi
#Make sure only a known branch is used
-if [[ "$BRANCH" != "stable" && "$BRANCH" != "testing" && "$BRANCH" != "unstable" ]]; then
- msg "Unknown branch. Please use either, stable, testing or unstable!"
- exit 1
-fi
+checkbranch
# start the timer
timer_start=$(get_timer)
diff --git a/bin/buildarmpkg b/bin/buildarmpkg
index dacbcba..f2b9551 100755
--- a/bin/buildarmpkg
+++ b/bin/buildarmpkg
@@ -11,18 +11,10 @@ CHROOTDIR=$BUILDDIR/$ARCH
PKG_CACHE=$CHROOTDIR/var/cache/pacman/pkg
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
# check if script is already running
-for pid in $(pidof -x buildarmpkg); do
- if [ $pid != $$ ]; then
- echo "[$(date)] : buildarmpkg : Process is already running with PID $pid"
- exit 1
- fi
-done
+checkrunning
#Arguments
opt=":p:a:i:r:nb:kh"
@@ -80,10 +72,8 @@ if [ $ARCH == "any" ]; then
fi
#Make sure only a known branch is used
-if [[ "$BRANCH" != "stable" && "$BRANCH" != "testing" && "$BRANCH" != "unstable" ]]; then
- msg "Unknown branch. Please use either, stable, testing or unstable!"
- exit 1
-fi
+checkbranch
+
# start the timer
timer_start=$(get_timer)
diff --git a/bin/builddockerimg b/bin/builddockerimg
index c9b0f16..19bcd5a 100644
--- a/bin/builddockerimg
+++ b/bin/builddockerimg
@@ -10,18 +10,10 @@ source $LIBDIR/functions.sh
enable_colors
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
# check if script is already running
-for pid in $(pidof -x builddockerimg); do
- if [ $pid != $$ ]; then
- echo "[$(date)] : builddockerimg : Process is already running with PID $pid"
- exit 1
- fi
-done
+checkrunning
# Functions
diff --git a/bin/buildemmcinstaller b/bin/buildemmcinstaller
index b28aaea..ef1cb2f 100755
--- a/bin/buildemmcinstaller
+++ b/bin/buildemmcinstaller
@@ -11,18 +11,10 @@ CHROOTDIR=$ROOTFS_IMG/rootfs_$ARCH
PKG_CACHE=$CHROOTDIR/var/cache/pacman/pkg
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
# check if script is already running
-for pid in $(pidof -x buildemmcinstaller); do
- if [ $pid != $$ ]; then
- echo "[$(date)] : buildemmcinstaller : Process is already running with PID $pid"
- exit 1
- fi
-done
+checkrunning
#Arguments
opt=":e:d:v:i:f:nxh"
diff --git a/bin/buildrootfs b/bin/buildrootfs
index 41531e9..21967d1 100644
--- a/bin/buildrootfs
+++ b/bin/buildrootfs
@@ -9,18 +9,10 @@ source $LIBDIR/functions.sh
enable_colors
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
# check if script is already running
-for pid in $(pidof -x buildrootfs); do
- if [ $pid != $$ ]; then
- echo "[$(date)] : buildrootfs : Process is already running with PID $pid"
- exit 1
- fi
-done
+checkrunning
# Functions
diff --git a/bin/getarmprofiles b/bin/getarmprofiles
index e46d5ad..3acd97a 100755
--- a/bin/getarmprofiles
+++ b/bin/getarmprofiles
@@ -4,10 +4,7 @@ LIBDIR=/usr/share/manjaro-arm-tools/lib
source $LIBDIR/functions.sh
# check if root
-if [ "$EUID" -ne 0 ]
- then echo "This script requires root permissions to run. Please run as root or with sudo!"
- exit
-fi
+checkroot
#Arguments
opt="fhp"
diff --git a/lib/functions.sh b/lib/functions.sh
index 2d2beb8..1580e59 100755
--- a/lib/functions.sh
+++ b/lib/functions.sh
@@ -28,6 +28,8 @@ COLORS=true
FILESYSTEM='ext4'
srv_list=/tmp/services_list
+PROGNAME=${0##*/}
+
#import conf file
source /etc/manjaro-arm-tools/manjaro-arm-tools.conf
@@ -180,6 +182,29 @@ create_torrent() {
mktorrent -v -a udp://tracker.opentrackr.org:1337 -w https://osdn.net/dl/manjaro-arm/$IMAGE -o $IMAGE.torrent $IMAGE
}
+checkroot () {
+ if [ "$EUID" -ne 0 ]
+ then echo "This script requires root permissions to run. Please run as root or with sudo!"
+ exit
+ fi
+}
+
+checkbranch () {
+ if [[ "$BRANCH" != "stable" && "$BRANCH" != "testing" && "$BRANCH" != "unstable" ]]; then
+ msg "Unknown branch. Please use either, stable, testing or unstable!"
+ exit 1
+ fi
+}
+
+checkrunning() {
+ for pid in $(pidof -x $PROGNAME); do
+ if [ $pid != $$ ]; then
+ echo "[$(date)] : $PROGNAME : Process is already running with PID $pid"
+ exit 1
+ fi
+ done
+}
+
checksum_img() {
# Create checksums for the image
info "Creating checksums for [$IMAGE]..."
```https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/48request: build a Plasma Mobile SDK container image with CI2022-01-17T12:39:33ZAndreyrequest: build a Plasma Mobile SDK container image with CITo keep [an SDK images](https://invent.kde.org/butirsky/plasma-mobile-sdk) up to date, could we add building of [Dockerfile.sysroot](https://invent.kde.org/butirsky/plasma-mobile-sdk/-/blob/master/Dockerfile.sysroot) image to CI to rebui...To keep [an SDK images](https://invent.kde.org/butirsky/plasma-mobile-sdk) up to date, could we add building of [Dockerfile.sysroot](https://invent.kde.org/butirsky/plasma-mobile-sdk/-/blob/master/Dockerfile.sysroot) image to CI to rebuild it every time new PP firmware images are out?https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/47manjaro-aarch64-base: exec user process caused: exec format error2022-01-01T17:06:35ZAndreymanjaro-aarch64-base: exec user process caused: exec format errorCan't run the container on [Play with Docker](https://labs.play-with-docker.com/):
```sh
$ docker run manjaroarm/manjaro-aarch64-base bash
Unable to find image 'manjaroarm/manjaro-aarch64-base:latest' locally
latest: Pulling from manja...Can't run the container on [Play with Docker](https://labs.play-with-docker.com/):
```sh
$ docker run manjaroarm/manjaro-aarch64-base bash
Unable to find image 'manjaroarm/manjaro-aarch64-base:latest' locally
latest: Pulling from manjaroarm/manjaro-aarch64-base
f6af84fcc245: Pull complete
Digest: sha256:167957f783232e4736793b30eae2f41fb0c8529346bede9999747a6eb046c87c
Status: Downloaded newer image for manjaroarm/manjaro-aarch64-base:latest
standard_init_linux.go:219: exec user process caused: exec format error
```
I'm not sure is it's something to do with Docker-in-Docker configuration there or it's a common problem..
@Strithttps://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/46[Improvement] Early file type check for multiple packages - doc clarification...2021-12-22T18:57:01ZPakoSt[Improvement] Early file type check for multiple packages - doc clarification and formatting### Overview
There are missing white spaces in `verifyLocalPackage()` that make it hard to read:
https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/lib/functions.sh#L994
The `zstd` inclusion in the READ...### Overview
There are missing white spaces in `verifyLocalPackage()` that make it hard to read:
https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/lib/functions.sh#L994
The `zstd` inclusion in the README.md is not entirely correct in it's explanation:
https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/README.md#L23
### Patches
Patch to include the missing white spaces for the if-else statements making them easier to read:
[0001-Fix-Formatting.patch](/uploads/c594a435ad39b46cf345517ed428c440/0001-Fix-Formatting.patch)
Patch to annotate properly why `unzstd` is need - early verification instead of the implied overall verification (which pacman is doing when attempting to install the package):
[0001-Doc-improve-zstd-annotation.patch](/uploads/c88b7ebe0b823c44585e401b85cda263/0001-Doc-improve-zstd-annotation.patch)https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/45[Improvement][buildarmimg] Early file type check when installing multiple loc...2021-12-21T08:25:01ZPakoSt[Improvement][buildarmimg] Early file type check when installing multiple local packages### Overview
The new functionality to install multiple local packages with `buildarmimg` appear to function as expected.
Additional early checks can be added to prevent building the image before realising something is wrong with the sel...### Overview
The new functionality to install multiple local packages with `buildarmimg` appear to function as expected.
Additional early checks can be added to prevent building the image before realising something is wrong with the selected packages.
### Main goals:
- [x] 1) Confirm the file is of package type
- [x] 2) Update to `README.md` to demonstrate the new function
##### Great to have if possible:
- [x] 3) Possible methods to verify the package is compatible with `aarch64` ?
1) Should be relatively straight forward. Probably matching of the mime-type will be sufficient [here](https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/bin/buildarmimg#L54)?
2) Straight forward - maybe a separate example would be better in this [section](https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/blob/master/README.md#L171) of README.md?
3) This appears to be the difficult one. How is `pacman` verifying that the package is for the compatible architecture? (need to find further information)
Will post update to point 1) tonight or tomorrow and try to find more on 3)https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/44Building arm image - can't add multiple packages2021-12-16T10:54:58ZPakoStBuilding arm image - can't add multiple packages### Issue
With the current version as of cec49d19c92c76e7f04376dd2a68df67a4429325 , it is not possible to mark multiple packages for installing when building an arm image.
This affects mostly cases where a package has a dependency or if...### Issue
With the current version as of cec49d19c92c76e7f04376dd2a68df67a4429325 , it is not possible to mark multiple packages for installing when building an arm image.
This affects mostly cases where a package has a dependency or if you attempt to try a new kernel - the kernel is split into `linux-***` and `linux-headers-****` packages.
### Usage
Here is a simplistic version affecting just `buildarmimg` that allows for several local packages to be installed via:
```
sudo buildarmimg -d rockpro64 -e kde-plasma -i linux-5.15.1-4-aarch64.pkg.tar.zst,linux-headers-5.15.1-4-aarch64.pkg.tar.zst
```
Flag and how to add more than 1 package using `,` separator:
```
-i <package>,<package2>
```
### Results
This results in the desired functionality of installing the packages at the end of the build process as can be seen here:
<details>
<summary> Installing local package linux,linux-headers to rootfs... </summary>
```
::INFO => Mirror pool: https://repo.manjaro.org/mirrors.json
::INFO => Mirror status: https://repo.manjaro.org/status.json
hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.
(27/28) Updating the info directory file...
(28/28) Updating the desktop file MIME type cache...
-> Installing local package {linux-5.15.1-4-aarch64.pkg.tar.zst,linux-headers-5.15.1-4-aarch64.pkg.tar.zst} to rootfs...
declare -a packages=([0]="linux-5.15.1-4-aarch64.pkg.tar.zst" [1]=$'linux-headers-5.15.1-4-aarch64.pkg.tar.zst\n')
List of packages to add:
loading packages...
warning: downgrading package linux (5.15.7-1 => 5.15.1-4)
resolving dependencies...
looking for conflicting packages...
Packages (1) linux-5.15.1-4
Total Installed Size: 78.32 MiB
Net Upgrade Size: -0.03 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
:: Processing package changes...
(1/1) downgrading linux [######################] 100%
WARNING: /boot appears to be a separate partition but is not mounted.
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating module dependencies...
(3/4) Updating linux module dependencies...
(4/4) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k 5.15.1-4-MANJARO-ARM -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.15.1-4-MANJARO-ARM
-> Running build hook: [base]
-> Running build hook: [udev]
-> Running build hook: [plymouth]
-> Running build hook: [autodetect]
-> Running build hook: [modconf]
-> Running build hook: [block]
-> Running build hook: [filesystems]
-> Running build hook: [keyboard]
-> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
loading packages...
resolving dependencies...
looking for conflicting packages...
Packages (1) linux-headers-5.15.1-4
Total Installed Size: 84.21 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
:: Processing package changes...
(1/1) installing linux-headers [######################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating module dependencies...
(3/3) Updating linux module dependencies...
-> Generating mirrorlist...
-> Enabling services...
Enabling sshd.service ...
Enabling sddm.service ...
Enabling NetworkManager.service ...
Enabling bluetooth.service ...
Enabling tlp.service ...
Enabling firewalld.service ...
Enabling zswap-arm.service ...
Enabling systemd-oomd.service ...
bootsplash-hide-when-booted.service not found in rootfs. Skipping.
bootsplash-show-on-shutdown.service not found in rootfs. Skipping.
-> Applying overlay for kde-plasma edition...
-> Setting up system settings...
Creating OEM user...
Correcting permissions from overlay...
==> Creating package list: [/var/cache/manjaro-arm-tools/img/Manjaro-ARM-kde-plasma-rock64-21.12-pkgs.txt]
-> Cleaning rootfs for unwanted files...
-> Prune and unmount pkg-cache...
==> no candidate packages found for pruning
==> rock64 kde-plasma rootfs complete
==> Finishing image for rock64 kde-plasma edition...
-> Creating partitions...
-> Copying files to image...
-> Flashing bootloader...
-> Writing PARTUUIDs...
Boot PARTUUID is bd0e3698-3da5-427c-8ad5-b7b5760acd92...
Root PARTUUID is fde932f5-1436-468e-9f3c-6dc2c5def12b...
-> Cleaning up image...
```
</details>
### File doesn't exist
In the case of the local package not existing, the script will fail early as can be seen here:
<details>
<summary> Example of file not found </summary>
```
sudo buildarmimg -d rock64 -e xfce -i linux-headers-5.15.1-6-aarch64.pkg.tar.zst
[sudo] password for pak0stpc:
declare -a packages=([0]=$'linux-headers-5.15.1-6-aarch64.pkg.tar.zst\n')
Can't find such file: linux-headers-5.15.1-6-aarch64.pkg.tar.zst
```
</details>
### Empty list of packages
In case the local package flag has been supplied but it's empty - I didn't do anything and let if fail as usual:
```
➜ linux-5.15.1-4 sudo buildarmimg -d rock64 -e xfce -i -x
declare -a packages=([0]=$'-x\n')
Can't find such file: -x
```
### Things that can be improved:
- Use utility function instead of the similar methods in `bin` and `lib`
- Add similar functionality to `buildarmemmcinstaller` or one of the other methods?
### Patch with multi-package install functionality
Patch to apply to add the additional functionality in this repo: [0001-Add-multi-package-install-when-building-an-image.patch](/uploads/d43c704a39e068317b9a6f0c19e0e9cb/0001-Add-multi-package-install-when-building-an-image.patch)
#### Random questions
- Possibly check with lf / crlf env?
- Any other oddities with the host machine?https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/43No Overview for manjaroarm Docker images2021-12-18T12:44:35ZAndreyNo Overview for manjaroarm Docker imageshttps://hub.docker.com/u/manjaroarm
It's not clear how these images were produced.
For example, https://hub.docker.com/r/archlinux/archlinux/ contains much more info.
https://forum.manjaro.org/t/manjaroarm-docker-sources/94625https://hub.docker.com/u/manjaroarm
It's not clear how these images were produced.
For example, https://hub.docker.com/r/archlinux/archlinux/ contains much more info.
https://forum.manjaro.org/t/manjaroarm-docker-sources/94625https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/42Problems building in tmpfs2021-11-21T08:56:10ZSteven JohnsonProblems building in tmpfsWhen building in tmpfs build will fail. This is because the build currently relies on:
`${PKGDIR}/pkg-cache` and `${IMGDIR}` existing. Which they may not when those options have been changed in the config file.
The attached patch corre...When building in tmpfs build will fail. This is because the build currently relies on:
`${PKGDIR}/pkg-cache` and `${IMGDIR}` existing. Which they may not when those options have been changed in the config file.
The attached patch corrects that by ensuring they exist after sourcing the configuration.
There is also an issue where `$ROOTFS_IMG/rootfs_$ARCH/var/cache/pacman/pkg` is not being unmounted before the CHROOT is removed, which causes that cleanup step to fail.
And a third small issue where `IMGNAME=Manjaro-ARM-$EDITION-$DEVICE-$VERSION` is defined, None of `$EDITION` or `$DEVICE` or `$VERSION` has been yet set. So I moved those defs up to be under `BRANCH` which makes sure that `$IMGNAME` will get defaulted properly.
Please see attached proposed patch with corrections, from my downstream fork (https://gitlab.com/stevenj/manjaro-arm-tools):
[manjaro-arm-tools-tmpfs-fixes.patch](/uploads/9652491d45c3f57317717a27662dd7e9/manjaro-arm-tools-tmpfs-fixes.patch)https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-tools/-/issues/41Device specific packages should be allowed for any device2021-10-24T07:52:18ZJozef MlichDevice specific packages should be allowed for any deviceThe buildarmimg contain exceptions for pinephone to allow adding extra packages. The same behaviour with extra packagess is suitable also for other devices.
Example of such configuration is at
https://github.com/nemomobile-ux/arm-profil...The buildarmimg contain exceptions for pinephone to allow adding extra packages. The same behaviour with extra packagess is suitable also for other devices.
Example of such configuration is at
https://github.com/nemomobile-ux/arm-profiles/blob/nemomobile/editions/nemomobile#L4
```
# Device specific packages
>pinephone nemo-device-pinephone
>pinetab nemo-device-pinetab
```
[0001-Allow-specific-packages-for-any-device-not-just-only.patch](/uploads/ae0a3a766ad1ce2d5d646b5829fae698/0001-Allow-specific-packages-for-any-device-not-just-only.patch)