Closed iysheng closed 1 year ago
Jira ticket: AR-1896
Riscv64 support is overall not yet in the best shape but using unsupported build host is just asking for troubles. I am not familiar with how Solus is different from Debian / Ubuntu so its difficult to say, but I was not able to reproduce on officially supported Jammy build host:
./compile.sh build BOARD=licheepi-4a BRANCH=legacy BUILD_DESKTOP=no BUILD_MINIMAL=yes KERNEL_CONFIGURE=yes RELEASE=jammy SHARE_LOG=yes
https://paste.next.armbian.com/rilutepeta
As I don't have hardware nor time to check, I don't know if resulted image boots.
More things are missing too:
--> (3) COMMAND: update-binfmts --enable qemu-arm bash: line 1: update-binfmts: command not found
this is again binfmt / qemu stuff which is host-dependent.
Riscv64 support is overall not yet in the best shape but using unsupported build host is just asking for troubles. I am not familiar with how Solus is different from Debian / Ubuntu so its difficult to say, but I was not able to reproduce on officially supported Jammy build host:
./compile.sh build BOARD=licheepi-4a BRANCH=legacy BUILD_DESKTOP=no BUILD_MINIMAL=yes KERNEL_CONFIGURE=yes RELEASE=jammy SHARE_LOG=yes
https://paste.next.armbian.com/rilutepetaAs I don't have hardware nor time to check, I don't know if resulted image boots.
More things are missing too:
--> (3) COMMAND: update-binfmts --enable qemu-arm bash: line 1: update-binfmts: command not found
Thanks for your patient reply. I missed install package binfmt-support. After I installed binfmt-support package, now there have update-binfmts now.
this is again binfmt / qemu stuff which is host-dependent.
yeah, and after I install binfmt-support from source , now I can do command with update-binfmts. But when I try do command with update-binfmts --enable qemu-arm
I get these errors:
▸ sudo update-binfmts --enable qemu-riscv64
[sudo] password for yangyongsheng:
update-binfmts: warning: qemu-riscv64not in database of installed binary formats.
update-binfmts: exiting due to previous errors
After I google this, then I do command with sudo update-binfmts --install qemu-riscv64 /bin/qemu-riscv64 --magic '\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00'
to register qemu-riscv64
support. Then After I do command sudo update-binfmts --enable qemu-riscv64
, something terrible happened as:
the host OS is broken, I must repower the laptop. is there anything wrong? thanks in advance.
is there anything wrong?
Nothing is wrong with our builds tools apparently. As it works for us and in CI. We can't reproduce, we don't have resources to work on task that is officially rejected - supporting "all" Linux distributions as a build host. There are many many real support problems elsewhere ...
This can not be recognized as an issue.
I hope you accept this with understanding.
is there anything wrong?
Nothing is wrong with our builds tools apparently. As it works for us and in CI. We can't reproduce, we don't have resources to work on task that is officially rejected - supporting "all" Linux distributions as a build host. There are many many real support problems elsewhere ...
This can not be recognized as an issue.
I hope you accept this with understanding.
Yeah, After I solve the problems with binfmt-support package, now I can build the image under Solus, but not checked 😅 . What I do just rebuild qemu with -static flag refer to https://gitlab.archlinux.org/archlinux/packaging/packages/qemu. Then I move qemu-riscv64/arm/aarch64-static to /usr/bin directory and use commands with:
sudo update-binfmts --install qemu-riscv64 /usr/bin/qemu-riscv64-static --magic '\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
sudo update-binfmts --install qemu-aarch64 /usr/bin/qemu-aarch64-static --magic '\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
sudo update-binfmts --install qemu-arm /usr/bin/qemu-arm-static --magic '\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
to registe these arch releate interpreter。Besides I get these magic and mask form package https://packages.debian.org/sid/qemu-user-static,a file named binfmt-install
list these magic and mask. Then I use command below test success.
▸ sudo chroot . /bin/echo "abc"
[sudo] password for yangyongsheng:
abc
┏─╼ [yangyongsheng]╾╼ [14:13:06]╾╼ [0]
┗─╼ [~/LearnProjects/licheepi_4a/jammy_root]
▸ file bin/echo
bin/echo: ELF 64-bit LSB pie executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=3919109b52e98cf5ae25f271fc73679bc96466c8, for GNU/Linux 4.15.0, stripped
Final I rebuild licheepi 4a img, and It's success with log https://paste.next.armbian.com/esunirisuh and these images as :
If anyone has a seemingly similar issue on Ubuntu 23.10 or 24.04:
qemu-user-static
has removed binfmt-support registration from version 8.0.0 onwards (see changelog)
From version 8 the qemu files for binfmt
are only stored in /usr/lib/binfmt.d/
Usually, the systemd service systemd-binfmt.service
will load these config files automatically on boot.
On WSL though, this is prevented:
sudo systemctl status systemd-binfmt.service
○ systemd-binfmt.service - Set Up Additional Binary Formats
Loaded: loaded (/usr/lib/systemd/system/systemd-binfmt.service; static)
Drop-In: /etc/systemd/system/systemd-binfmt.service.d
└─00-wsl.conf
/usr/lib/systemd/system/systemd-binfmt.service.d
└─wsl.conf
Active: inactive (dead)
Condition: start condition unmet at Fri 2024-03-29; 1h 27min ago
Docs: man:systemd-binfmt.service(8)
man:binfmt.d(5)
https://docs.kernel.org/admin-guide/binfmt-misc.html
https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
systemd[1]: systemd-binfmt.service - Set Up Additional Binary Formats was skipped because of an unmet condition check (ConditionVirtualization=!wsl).
Temporary workaround:
Edit both files
1) /usr/lib/systemd/system/systemd-binfmt.service.d/wsl.conf
2) /etc/systemd/system/systemd-binfmt.service.d/00-wsl.conf
and put the two existing lines in a comment (put a # in front of each line), like this:
#[Unit]
#ConditionVirtualization=!container
Then reboot.
What happened?
I have a laptop installed Solus OS。And I modified some build code to ignore some
apt releate
functions with ubuntu。Now I can build and package some deb packages with licheepi-4a as:But I stocked when pack rootfs。The error messages as below:
I wonder how could this happen? And I extrace file
rootfs-riscv64-jammy-minimal_202310-624a0304d910-H01ba47-B3ce5fd.tar.zst
under bash with commandzstdmt -dc rootfs-riscv64-jammy-minimal_202310-624a0304d910-H01ba47-B3ce5fd.tar.zst | tar xp --xattrs -C jammy_root/
to test. When I do command withThen I file with /bin/bash in
rootfs-riscv64-jammy-minimal_202310-624a0304d910-H01ba47-B3ce5fd.tar.zst
as:It's build with RISC-V platform, why there need do command
$(chroot "${basedir}" /bin/bash -c "apt --version | cut -d\" \" -f2")
in functionfunction create_sources_list_and_deploy_repo_key()
and failed?How to reproduce?
I do this build with command :
Branch
main (main development branch)
On which host OS are you observing this problem?
Other
Relevant log URL
https://paste.next.armbian.com/foferufita
Code of Conduct