BMC building questions
# │forum


04/26/2023, 10:38 PM
Hi, I got my Turing Pi2 some days ago, and experimented a bit with it. Nice! Now I want to automate the BMC a bit more. I found several things while until I got my own BMC rootfs running. 1. /mnt/sdcard is missing from official 1.0.1, preventing updates. 2. The docs state for the BMC it is a 1G flash, but in fact it seems a only 1GBits = 128MBytes flash. What is correct? 2. There is a two partion scheme for updating ubi0_5 vs ubi0_6. So when swupdate or OTA does not work. You could do something like this (when booted from ubi0_6):
Copy code
swupdate -i $PWD/turingpi-1.0.2.swu  -e stable,upgrade_ubi5
fw_setenv nand_root ubi0_5
In fact this is what the BMC webapp is doing. 3. The switch on the TPi2 is according to the docs in a "default bridge on all ports". How can I change this? I like to have VLANs on the Switch ports. Is this planned? Or better in OpenWRT is Distribute Switch Architecure driver, which makes all ports of the switch individual network devices, but the switching is offloaded to the hardware. That would be nice. 4. ADB is not working when the UBI filesystem is in readonly, eg. when it is to large. This is do to /system/bin/sh is created by the initscript as a link ot /bin/busybox. 5. The kernel is not part of the UBI image. I am a bit puzzled how the kernel is updated. As it is a small linux device, I wonder if certain features like wireguard, f2fs, proper NTFS support via NTFS-3G(needs fuse) can be included. How is the kernel updated? I guest it is in ubi0_4 but never touched by any images generated by the official sources, so far I see. What I am missing? ...
6. The kernel device tree is in UBI though, but it is a full blown device tree, also including the not used HDMI of the t113-s3 and some more things are defined there and thus activated in the kernel whcih will never work. 6. The BMC app is claimed to be opensource but there is an binary blob for the ASP/GoAhead engine in the git. ...
7. Is there a description of the flash layout, or can someone give some insights: I did a dump of all partions an I am puzzled:
Copy code
mtd0-boot0.bin:           SysEx File -
mtd1-uboot.bin:           data
mtd2-secure_storage.bin:  data
mtd3-sys.bin:             UBI image, version 1
ubi0_0-mbr.bin:           data
ubi0_1-boot-resource.bin: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, root entries 512, sectors 4096 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 3, sectors/track 32, heads 64, serial number 0xa7734277, unlabeled, FAT (12 bit)
ubi0_2-env.bin:           data
ubi0_3-env-redund.bin:    data
ubi0_4-boot.bin:          Android bootimg, kernel (0x40200000), ramdisk (0x41200000), page size: 2048
ubi0_5-rootfs.bin:        UBIfs image, sequence number 19617, length 4096, CRC 0xd8c7d38f
ubi0_6-recovery.bin:      UBIfs image, sequence number 20007, length 4096, CRC 0x2e35dbf3
ubi0_7-dsp0.bin:          ELF 32-bit LSB executable, Tensilica Xtensa, version 1 (SYSV), statically linked, stripped
ubi0_8-private.bin:       ISO-8859 text, with very long lines (65536), with no line terminators
ubi0_9-UDISK.bin:         ISO-8859 text, with very long lines (65536), with no line terminators

# cat mtd.txt 
dev:    size   erasesize  name
mtd0: 00100000 00040000 "boot0"
mtd1: 00300000 00040000 "uboot"
mtd2: 00100000 00040000 "secure_storage"
mtd3: 07b00000 00040000 "sys"

# cat ubi.txt 
name          size
mbr           16777216
boot-resource 2322432
env           1290240
env-redund    1290240
boot          18063360
rootfs        33804288
recovery      33804288
dsp0          1290240
private       1290240
UDISK         10579968
Why is there an xtensa Image? This looks like the demo application for the Allwinner T113-s3. Pretty useless without HDMI or sound 😉 ...
8. How to enter Uboot? CTRL-C does not work. 9. The random MAC address issue I solved by adding an mac variable to UBoots environement if it is empty or not defined. This is automagically given as kernel parameter and then might be extracted by the ifupdown script. best regards


10/18/2023, 6:38 PM


10/19/2023, 4:50 PM
I figured that out a while ago: Which ended in a pre 1.0 firmware repository with some reversing docs here: (! this repos is not latest and update anymore)