[BPI-R4] Imagebuilder R4 ArchlinuxArm

Rebased my atf patches to the latest atf.

For the 8 GB R4, it is now an option in the build script. I do not have one to test it.

The special 8gb version of the atf is selected. Also the memory node in the devicetree is adapted (for booting from atf directly to linux).

Will need all packages updated (including bpir-atf-git). Building new with the script all packages are the newest.

From old images:

su root
echo -n 8 > /boot/bootcfg/ddrsize
pacman -Syu bpir-atf-git
bpir-toolbox --atf
exit

Bootloaders are about to get way less annoying

Arm system ready still uses u-boot, so it is still bootrom-atf-uboot. That does not change.

Here it is simpler because uboot is left out of the bootchain. The initramdisk has a menu if you want one.

Why not dracut?

One is always free to implement a initrd of one’s choice.

I’ m working on a much more functional, more tailor suited, initrd, with many possibilities For now it is running on R3, but when all functional I will add R4.

Just a few things working on:

Uboot Distro-boot sd/emmc - nvme - nand. Scanning for extlinux.conf on the devices in that order. Where on nand there is also a resque initrd.

This initrd can make connection through dhcp-client. Run my installscript or debootstrap, to install any linux on the R3 directly from initrd.

Anyway, still in development, partly functional. Maybe in a month or so it is usable.

It is all tested and looks good, setting up a usefull NAND image, from where it is quite easy to install any linux distro on nvme (or emmc), or use some linux tools to fix the reason the board is not booting correctly.

In case the R3-Mini (or any other board) is bricked, this is how to get linux running and fix whatever is needed:

with your nand distro-boot + recovery i made a ubuntu image and installed it on emmc. No i am having troubles getting ipv6 working from the router itself. its no prob from the lan side but using wan times out. when checking if all modules have been loaded i noticed the absence of nf_conntrack_ipv6 module, so this seems kinda important ;). when building a new kernel did you somewhere outlined the procedure on how to get the new kernel and modules on the emmc afterwords? I would be greatful for some hints :). Also i would like to thank you for your great work. When im done i will post my config (systemd-networkd, nftables, suricata etc ) on this board in case anyone might wanna use it. i will include a setup script for the most important stuff.So far your builds are working fine ipv4 and ipv6 wise when not on the router itself. Thanks again for all the great work you and Frank W. are making. Appreciate it alot.

Something else i missed mentioning entirely…When using bpir-build -F from the nand-rescue one has to change the https links in the bpir-build script since the nand is missing correct time and the ssl certificates needed to do the build. One can ignore the failing of verification by using curl -k in the script.

The time should get set when using `bpir-dhcpc’ command, see line 224

Have you used this command or setup manually?

1 Like

It is no longer an option after 4.18

https://cateee.net/lkddb/web-lkddb/NF_CONNTRACK_IPV6.html

In my images the kernel is build as archlinux package.

Altering the PKGBUILD or defconfig and rebuilding on x86 or aarch64. When not running archlinux, then you can use (arch-)chroot.

https://github.com/ericwoud/archlinuxarm-repo/tree/linux-bpir-git

https://github.com/tokland/arch-bootstrap

Thanks will have a look tomorrow. Yeah it works perfectly fine with bpir-dhcpc but Environment was static in that Case. So had to do it manually. nice way of obtaining time…reminds me of kicksecures sdwdate. I have used the Ubuntu Image build that you provide in bpir-build.Alarm doesnt support suricata/hyperscan in Aur yet. So took the easy way. After editing the SSL Errors Out it worked Like a Charm and Image started fine from emmc.

Today after upgrading my old Arch eMMC installation and later trying to convert from systemd-networkd to network-manager service I managed to cut-off my R3 from the network.

Now I want to re-install Arch from NAND but can’t find any pre-made SDcard image for installation of the NAND-DISTRO-BOOT. I don’t have other Linux machine nor UART-cable, just Windows notebook available. Could you please help me find such emergency SDcard image for NAND installation (with working DHCP client)?

The first post in this topic has a link to sd card images.

When booting from this image, you can flash emmc. nand

Several possibilities then, some described here:

On R3/R4 there is only one mmc controller so you can access sd or emmc based on hw config.

Have you solved the simultanous access to sd+emmc?

Whoops typo, I meant nand, as was asked

Thank you guys. I had problems to get IP my from DHCP when booting from latest Arch AP sdmmc R3 image and default IP 192.168.1.33 was not responding. But I found some serial cable and got UARTboot working and install recovery image to NAND which seems to work but is finishing with error:

ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 980, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1544839306
ubi0: available PEBs: 0, total reserved PEBs: 980, PEBs reserved for bad PEB handling: 20
UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs", R/O mode
UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS (ubi0:3): FS size: 118341632 bytes (112 MiB, 932 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS (ubi0:3): reserved for root: 0 bytes (0 KiB)
UBIFS (ubi0:3): media format: w4/r0 (latest is w4/r0), UUID 2B3CB900-E7C8-4164-85E0-67BE00D3DF24, small LPT model
Scanning ubi ubi0:rootfs...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
1:      Archlinux ARM for BananaPi Routers
Retrieving file: /boot/Image.gz
Retrieving file: /boot/initramfs-bpir.img
Retrieving file: /tmp/bpir-toolbox-tmp/atfdtb
Skipping linux-bpir-git for failure retrieving FDT
EXTLINUX FAILED: continuing...
Unmounting UBIFS volume rootfs!
BPI-R3>

Maybe the previously installed OpenWRT recovery in NAND was not completely erased and still occupies some NAND space, don’t know.

I see there is an error in the creation of the extlinux.conf file. The path to dts is wrong.

I will look in to this coming week.

OK, thanks a lot. Will wait for your updated image and test it on my R3.

Finally I fixed my R3 Arch installation via UARTBoot function bpir-build(chroot) which allowed to modify my existing eMMC installation (disable network-manager service and enable systemd-networkd back).

Now I can wait for your update to fix my NAND installation (installed via “bpir-toolbox --nand-format” in UARTboot).

I think I removed the problematic code. Update the build-r64-arch-utils-git package, or get a new image after about an hour (images are going to be rebuild).

pacman -Sy build-r64-arch-utils-git

It may complain the first time you run it, try it again (I did not bump rev).

Since you already formatted it, it is enough to:

bpir-toolbox --nand-update