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?
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
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
That is exactly what it is created for. Easily fixing the problem through chroot, when normal boot is broken.
Maybe more can discover this method.
Thank you, will test the nand-update methodā¦Seems itās still not working for my R3. After nand-update was the same error so I tried nand-format with this result:
input = /tmp/bpir-toolbox-tmp/fixed.dtb
output = /tmp/bpir-toolbox-tmp/atf.dtb
overlay[0] = /tmp/bpir-toolbox-tmp/dtbos/*.dtbo
Couldn't open blob from '/tmp/bpir-toolbox-tmp/dtbos/*.dtbo': No such file or di rectory
Failed to read '/tmp/bpir-toolbox-tmp/dtbos/*.dtbo'
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
BOOTARGS = root= console=ttyS0,115200 debug=7 rw rootwait audit=0
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
/usr/bin/bpir-toolbox: line 124: du: command not found
/usr/bin/bpir-toolbox: line 124: 0x48000000 + : arithmetic syntax error: operan d expected (error token is "+ ")
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
Couldn't open blob from '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directo ry
diff: /tmp/bpir-toolbox-tmp/atf.dtb: No such file or directory
diff: /tmp/bpir-toolbox-tmp/mnt/tmp/bpir-toolbox-tmp/atfdtb: No such file or dir ectory
Updating atf.dtb on NAND:
cp: cannot stat '/tmp/bpir-toolbox-tmp/atf.dtb': No such file or directory
DEFAULT linux-bpir-git
MENU title U-Boot menu
PROMPT 0
TIMEOUT 50
LABEL linux-bpir-git
MENU LABEL Archlinux ARM for BananaPi Routers
LINUX /boot/Image.gz
INITRD /boot/initramfs-bpir.img
FDT /tmp/bpir-toolbox-tmp/atfdtb
diff: /tmp/bpir-toolbox-tmp/mnt/boot/extlinux/extlinux.conf: No such file or dir ectory
Updating extlinux.conf on NAND:
'/tmp/bpir-toolbox-tmp/extlinux.conf' -> '/tmp/bpir-toolbox-tmp/mnt/boot/extlinu x/extlinux.conf'
diff: /tmp/bpir-toolbox-tmp/mnt/boot/Image.gz: No such file or directory
Updating Image.gz on NAND:
'/boot/Image.gz' -> '/tmp/bpir-toolbox-tmp/mnt/boot/Image.gz'
diff: /tmp/bpir-toolbox-tmp/mnt/boot/initramfs-bpir.img: No such file or directo ry
Updating initramfs-bpir.img on NAND:
'/boot/initramfs-bpir.img' -> '/tmp/bpir-toolbox-tmp/mnt/boot/initramfs-bpir.img '
/tmp/bpir-toolbox-tmp/mnt:
total 0
drwxr-xr-x 4 0 0 448 Sep 16 18:40 boot
/tmp/bpir-toolbox-tmp/mnt/boot:
total 23784
-rw------- 1 0 0 7842262 Sep 16 18:40 Image.gz
drwxr-xr-x 2 0 0 160 Sep 16 18:40 dtbs
drwxr-xr-x 2 0 0 232 Sep 16 18:40 extlinux
-rw-r--r-- 1 0 0 16510491 Sep 16 18:40 initramfs-bpi[ 173.402962] UBIFS (ubi0:3 ): un-mount UBI device 0
r.img
after reboot from NAND the result is the same:
UBIFS (ubi0:3): reserved for root: 0 bytes (0 KiB)
UBIFS (ubi0:3): media format: w4/r0 (latest is w4/r0), UUID FC3F2FC2-6AB1-40F6-A467-1072C5C45E01, 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!
Can you download a fresh sd image, boot it and run the --nand-format command?
If this is unsuccessful, Iāll need to do some debugging to see where this goes wrong.