Issue during build image process after manjaro-arm-tools update

Hi,

I tried to build arm image today (08/14) issue during the build process

manjaro-arm-tools update yesterday (08/13) => Slowdown in Manjaro ARM development? - #16 by nl.smart

No issue during the build process before the manjaro-arm-tools update (08/13), no issue during the build process with the last arm images I built the 08/12

qemu-user-static-binfmt is already installed…

[nls@lap ~]$ sudo buildarmimg -d oc4 -e kde-plasma -v 2024.08.14 -b unstable n
ERROR: This utility requires package 'qemu-user-static-binfmt'\n
[nls@lap ~]$ sudo pacman -S qemu-user-static-binfmt
warning: qemu-user-static-binfmt-9.0.2-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) qemu-user-static-binfmt-9.0.2-1

Total Installed Size:  0,05 MiB
Net Upgrade Size:      0,00 MiB

:: Proceed with installation? [Y/n] y
(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%
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
:: Processing package changes...
(1/1) reinstalling qemu-user-static-binfmt                                                     [########################################################] 100%
:: Running post-transaction hooks...
(1/3) Registering binary formats...
(2/3) Arming ConditionNeedsUpdate...
(3/3) Refreshing PackageKit...
[nls@lap ~]$ sudo buildarmimg -d oc4 -e kde-plasma -v 2024.08.14 -b unstable n
ERROR: This utility requires package 'qemu-user-static-binfmt'\n
[nls@lap ~]$

Thanks for your help. I build manjaro arm images for years, first time I encounter this issue.

This is on x86_64 system?

As the qemu was made an optional dependency I created a check that only trigger if

  • host is x86_64
  • and qemu-aarch64-static not present

I am sure I checked the condition without the binary installed - but alas it is flawed - my mistake somehow.

I can see I goofed it somehow.

Edit the file /usr/share/manjaro-arm-tools/lib/functions.sh and replace lines 199-201 with

if [[ $(uname -m) == "x86_64" ]] && [[ $(command -v qemu-aarch64-static)x == "x" ]]; then
    echo "ERROR: This utility requires package 'qemu-user-static-binfmt'"
    exit 1
fi
1 Like

Yes. I had the same issue on GitHub Actions runners (x86_64). The new logic is not working as it should.

1 Like

I just realized that the =~ returns true because the qemu-aarch64-static is mentioned in the result even when it does not exist.

I think that you can use ! which qemu-aarch64-static > /dev/null as it will return -1 when executable is not found

Something like [[ $(uname -m) == "x86_64" ]] && ! which qemu-aarch64-static > /dev/null && { echo -e "ERROR: This utility requires package 'qemu-user-static-binfmt'\n"; exit 1; } might work…

I don’t why - but I have mistakenly use uname -r instead of uname -m - a stupid keyboard error

This one works as I intended - my apoligies for the inconvenience

if [[ $(uname -m) == "x86_64" ]] && [[ $(command -v qemu-aarch64-static)x == "x" ]]; then
    echo "ERROR: This utility requires package 'qemu-user-static-binfmt'"
    exit 1
fi

My test (test.sh)
Move binary

 $ sudo mv /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static.bak

run script snippet (generate error message)

 $ bash test.sh
ERROR: This utility requires package 'qemu-user-static-binfmt'

move binary back

 $ sudo mv /usr/bin/qemu-aarch64-static.bak /usr/bin/qemu-aarch64-static

run test script again (no output) - binary exist

 $ bash test.sh
1 Like

Thanks for your reply.

Yes, I build manjaro arm images with x86_64 system

Edit 1 : I replace the lines 199-201, now the build image is running, I hope a nice image in the end of the process.

Edit 2 : the build image finished graceful, image not tested…

 . . .
==> Creating kde-plasma edition image for oc4...
  -> Creating ext4 partitions...
  -> Copying files to image...
  -> Writing the boot loader images...
Boot PARTUUID is ca6b25a3-01...
Root PARTUUID is ca6b25a3-02...
Root UUID is 9f096697-9e5b-4ec7-852e-aafd5547ffaa...
  -> Cleaning up image...
  -> Compressing Manjaro-ARM-kde-plasma-oc4-2024.08.14.img with xz...
Manjaro-ARM-kde-plasma-oc4-2024.08.14.img: 1 709,0 MiB / 9 163,0 MiB = 0,187, 15 MiB/s, 10:03
  -> Removing rootfs_aarch64...

==> Time elapsed: 33.90 minute(s)
[nls@lap ~]$ 
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.