[Wiki] How to contribute to Manjaro ARM

Please check manajro wiki page of amlogiv tv boxes. One of the contributor and documented hours to build own dtb.

I am currently in the process of trying to port a new arm target to Manjaro.
Its based on a RK3399 so i started with trying to build a pre-existing image, but it fails.
Specifically, when I run sudo buildarmimg -d rockpro64
The first error i notice is:

(12/16) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k 5.15.0-2-MANJARO-ARM -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.15.0-2-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]
==> ERROR: file not found: `fsck.zfs'
==> WARNING: No fsck helpers found. fsck will not be run on boot.
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> WARNING: errors were encountered during the build. The image may not be complete.
error: command failed to execute correctly

There is no ZFS on the target, so it looks like something in my PC setup is leaking into the build.

Followed shortly later by:

==> Finishing image for rockpro64 minimal edition...
  -> Creating partitions...
  -> Copying files to image...
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/libgo.so.16.0.0': No space left on device
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/libmagic.so.1.0.0': No space left on device
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/libnpth.so.0.1.2': No space left on device
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/liblz4.so.1.9.3': No space left on device
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/libss.so.2.0': No space left on device
cp: error writing '/var/lib/manjaro-arm-tools/tmp/root/usr/lib/libdl.a': No space left on device

Which repeats for what looks like every possible file. I have 1.5TB of available disk space, and 128GB of ram, so i don’t think its really a “No space left on device” issue, but I can’t work out what could be causing it.

Any ideas?

Full log is on ghostbin dot com / 5bE4C

Hi @nl.smart ,
I did read and follow the docs. My target is headless, so all i need to build is minimal images which is what -e defaults to. -v also has a reasonable default for the purpose of my testing to see if i can build an existing target faithfully, before trying to build my new target. The only option i didn’t add was -n and that was because i had already downloaded the rootfs previously. But I did try your suggestion and I get the exact same errors.

log is at https://ghostbin.com/q5SJn

I feel like this may be an incompatibility between the build process and ZFS in some way, but I want to make sure I haven’t screwed up something before digging deeper. I am going to try and format a USB drive as Ext4 and try a build on that, to rule out ZFS peculiarities.

I have never seen that zfs thing before, but I haven’t ever run the tools on a zfs based system. Don’t know why it would try to include it in the initramfs though, if you haven’t changed the arm-profile at all.

Regarding the “No space left on device”, what version of the tools are you using?

We increased the size of the .img file in 2.10.3, because I was starting to get similar issues when building images. So if your version is 2.10.2 or below you will likely run into the same issue.

Actually that guide on the wiki is wrong. You need to run some parser first but you need the kernel sources for that.

Device Tree - linux-sunxi.org

This guide works but the question is how to efficiently get the ARM patched kernel sources and then use those.

1 Like

Hi @Strit, Well I switched to staging branch of Manjaro to pick up 2.10.4.
Sadly that didn’t help, I still get the no space left on device errors with it.
I also tried formatting a USB stick as Ext4 (My whole system is Full ZFS) and pointing manjaro-arm-tools.conf to that, but that didn’t help either, but the error is different.
on the USB Ext4 drive I am getting:

==> Creating package list: [/tmp/build/var/cache/manjaro-arm-tools/img/Manjaro-ARM-minimal-rockpro64-21.11-pkgs.txt]
mv: cannot move '/tmp/build/var/lib/manjaro-arm-tools/img/rootfs_aarch64/var/tmp/pkglist.txt' to '/tmp/build/var/cache/manjaro-arm-tools/img/Manjaro-ARM-minimal-rockpro64-21.11-pkgs.txt': No such file or directory
  -> Cleaning rootfs for unwanted files...
  -> Prune and unmount pkg-cache...
==> no candidate packages found for pruning
umount: /tmp/build/var/lib/manjaro-arm-tools/img/rootfs_aarch64/var/cache/pacman/pkg: not mounted.
==> rockpro64 minimal rootfs complete
==> Finishing image for rockpro64 minimal edition...
  -> Creating partitions...
  -> Copying files to image...
mount: /tmp/build/var/lib/manjaro-arm-tools/tmp/boot: can't read superblock on /dev/loop0p1.
mount: /tmp/build/var/lib/manjaro-arm-tools/tmp/root: can't read superblock on /dev/loop0p2.
  -> Flashing bootloader...
  -> Writing PARTUUIDs...
Boot PARTUUID is ...
Root PARTUUID is ...
  -> Cleaning up image...
umount: /tmp/build/var/lib/manjaro-arm-tools/tmp/root: not mounted.
umount: /tmp/build/var/lib/manjaro-arm-tools/tmp/boot: not mounted.
chmod: cannot access '/tmp/build/var/cache/manjaro-arm-tools/img/Manjaro-ARM-minimal-rockpro64-21.11.img': No such file or directory
  -> Compressing Manjaro-ARM-minimal-rockpro64-21.11.img...
/usr/share/manjaro-arm-tools/lib/functions.sh: line 815: cd: /tmp/build/var/cache/manjaro-arm-tools/img: No such file or directory
Manjaro-ARM-minimal-rockpro64-21.11.img (1/1)
xz: Manjaro-ARM-minimal-rockpro64-21.11.img: No such file or directory
chmod: cannot access '/tmp/build/var/cache/manjaro-arm-tools/img/Manjaro-ARM-minimal-rockpro64-21.11.img.xz': No such file or directory
  -> Removing rootfs_aarch64
==> Time : 7.95 minutes...

/tmp/build is the USB drive mount point.

Looks like I need to get serious. I will clone the latest source for manjaro-arm-tools and try and debug what the issue really is with my system. Once I work out what the actual command/s that fail, I should be able to work out a fix.

Yeah, it’s weird. I don’t have such issues, maybe the zfs thing could be the issue.

Yeah, I think your right. It could be a file system option thats not enabled, or it could be a tooling issue. I will get to the bottom of it.

Hi, I’m interested in building my own Manjaro image for my Pinephone so I can change a kernel config. However I’m a beginner so it’s not clear to me if the process in the OP here will let me do that (it seems like it uses a pre-built kernel?). Any pointers on how to include a custom kernel in the build process explained here are appreciated, thanks in advance!

The image building process only uses pre-built packages.

But you can add your own pre-built package with the -i <package file> argument. You just need to comment out the kernel line from the pinephone profile while doing it, so it does not conflict with your custom package.

1 Like

Ok, so I think the ZFS issue is related to bind mounts, but I got around that by building in tmpfs, which also doesn’t work.

But the reason it doesn’t work is /var/cache/manjaro-arm-tools/ is assumed to exist. Which is the root of both $PKGDIR and $IMGDIR. I moved those to /tmp, and it breaks the build because they don’t exist in /tmp.

So, I added this, after the conf file is loaded in functions.sh, and I can now build in tmpfs:

#import conf file
source /etc/manjaro-arm-tools/manjaro-arm-tools.conf

# PKGDIR & IMGDIR may not exist if they were changed by configuration, make sure they do.
mkdir -p ${PKGDIR}
mkdir -p ${IMGDIR}

I would like to submit a patch for this. Whats the process? I have an account on the manjaro gitlab but it doesn’t seem possible to make PR’s (at least for me).

There is one outstanding issue I notice though, and that is the bind mount is not cleaned up at the end of the build.

> tmpfs on /tmp/build/var/lib/manjaro-arm-tools/img/rootfs_aarch64/var/cache/pacman/pkg type tmpfs (rw,nosuid,nodev,relatime,size=50331648k,nr_inodes=2097152,inode64)

is left behind which is evident in the build when it goes:

 -> Removing rootfs_aarch64
+ rm -rf /tmp/build/var/lib/manjaro-arm-tools/img/rootfs_aarch64
rm: cannot remove '/tmp/build/var/lib/manjaro-arm-tools/img/rootfs_aarch64/var/cache/pacman/pkg': Device or resource busy

So I would fix that before making the PR.

As the Manjaro gitlab is reserved for Manjaro developers, the best you can do, is open an issue on the project in question and supply a .patch file that can be git apply'd.

4 posts were split to a new topic: How to change kernel config with buildarmpkg

Just want to say my thanks to the maintainers for developing these tools. As a pretty clueless beginner I was able to configure and build the kernel and flash the new image to my Pinephone to get midi working.

Could someone give a pointer though on how I would do this same thing using a release version of Manjaro ARM? It seems to me like the process I followed (building a new kernel from source, creating a new image with buildarmimg) builds a ‘bleeding edge’ image. I think I’d like to use a release image, but just reconfigure the kernel if that makes sense.

The “release” image is just snapshots of what is in the Stable repo at the time.

So as long as you didn’t define a branch when using the tools, you will have what would essentially be an up-to-date release image, when building the image with buildarmimg.

1 Like

4 posts were split to a new topic: [Request] Add support for ClockworkPi A06

Hey, I quickly and easily was able to build an OEM image for the jetson nano. That worked great. Thanks for the tool. :+1:

The image doesn’t boot though.

Or at least it hasn’t in the 15 or so minutes it’s been trying. I got the nvidia splash screen, and that’s it.

I am trying to learn patience, and the jetson is powered on as I type this.

I think for jetpack 4.5 nvidia changed something with it’s bootloader, I am wondering if that has something to do with it.

Suggestions welcome.

Thanks!

Jetson Nano is not working yet, no.

That’s why it’s not listed inthe documentation yet.

2 Likes

Sorry, I just saw your reply. I haven’t looked further into it after a certain point because a system without stable telephony wouldn’t be much use to me and since ofono seems to be not so reliable and is being left behind, I didn’t want to put a lot of resources in this. I may revisit this at some point.

4 posts were split to a new topic: Add support for NanoPi 4M