Skip to content

Instantly share code, notes, and snippets.

@FlorianHeigl
Last active October 30, 2025 21:58
Show Gist options
  • Save FlorianHeigl/32fc39779295c385ffa32253f3e92e95 to your computer and use it in GitHub Desktop.
Save FlorianHeigl/32fc39779295c385ffa32253f3e92e95 to your computer and use it in GitHub Desktop.
reality check, revive, xen alpine cubietruck2
startsituation, altes alpine setup, fehlendes modloop.
aktuell bekommen und dann strip down wg. RAM
u-boot tricks mitnehmen und fuer mips benutzen
rpi kernel bootet nicht auf cubietruck
problem war wohl u.a. dass ich mit kernelupdate das NAND nicht mehr hatte
jahre spaeter beim versuch, das auf aktuelles alpine zu ziehen versehentlich noch die packages geloescht
dann schritt fuer schritt reparatur
(tarball auspacken, apk.static, 3.20 packages)
hatte dann xen package mismatch - und dann hat der update mir die bootoptionen aus der extlinux.conf gemoppst
xen config muss ich desswegen am ende neu machen
cpu info
https://linux-sunxi.org/A20
referenz zum loesen
https://wiki.alpinelinux.org/wiki/DIY_Fully_working_Alpine_Linux_for_Allwinner_and_Other_ARM_SOCs
nand geht noch nicht, sollte aber (mainline format braucht neuformatieren)
https://linux-sunxi.org/MTD_Driver
https://linux-sunxi.org/Mainline_NAND_Howto
weitere alpine specifics
- armhf-generic-uboot build existiert nicht mehr (sh hier https://dl-cdn.alpinelinux.org/alpine/v3.10/releases/armhf/)
- https://wiki.alpinelinux.org/wiki/Upgrading_Alpine_Linux_to_a_new_release_branch
- https://community.riocities.com/alpine_rpi_upgrade.html (nur rpi lbu mode, kein xen)
mirageos xen arm builder (OS, baut cubietruck SD image)
https://github.com/mirage/xen-arm-builder
export TARGET=Cubietruck
funktioniert nicht mehr ganz (insb. Xen) weil es pakete aus edge nehmen will, gibt wohl kein passendes edge fuer armhf oder so.
# build deps
apk add alpine-sdk bison ccache flex ncurses-dev perl rsync
# build dir
apk add lvm2
vgchange -ay
modprobe ext4
mkdir /build
mount /dev/cubie2/build /build
swapon /dev/cubie2/swap
https://linux-sunxi.org/Mainline_Kernel_Howto
https://linux-sunxi.org/Linux_Kernel#Compilation
https://linux-sunxi.org/Script.bin
cd /build/linux
# hat noch fehler, wird nicht aktiv
export CCACHE_DIR=/build/ccache
export CCACHE_NOCOMPRESS=true
export CC="ccache gcc"
export CXX="ccache g++"
# hier erst make defconfig wie in anleitung machen
# laedt sunxi/allwinner defaults
export TERM=putty
# arch=arm - unoptimierter kernel, raspi1 etc.
# loesung waere -march, -mtune, s.u. ungetestet.
# https://gist.github.com/fm4dd/c663217935dc17f0fc73c9c81b0aa845
# https://wits-hep.blogspot.com/2013/11/arm-cortex-a7-gcc-flags-allwinner-a20.html - s.u.
# https://wits-hep.blogspot.com/2014/08/optimal-compiler-flags-for-arm.html - s.u.
export CFLAGS="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -funsafe-math-optimizations -mfloat-abi=hard -O3 -ffastmath"
export CFLAGS="-mcpu=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -funsafe-math-optimizations -mfloat-abi=hard -O3 -ffastmath"
export CXXFLAGS="${CFLAGS}"
make ARCH=arm menuconfig
- squashfs [*]
- cramfs [*]
- overlayfs [*]
- pstore [*] # https://stackoverflow.com/questions/28538091/using-persistent-storage-in-linux-kernel
- tmpfs [*]
CONFIG_BLK_DEV_DM=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_DM_UEVENT=y
CONFIG_MD=y
(ich hab dann die ganze.config genommen von https://github.com/mirage/xen-arm-builder/blob/master/linux.sh
weil schon 5 versuche oder so)
mtd pruefen
? drivers/media/rc/keymaps/rc...
war bei den IRDA treibern, oberster punkt, einfach ausmachen
man muss noch einige optionen nacharbeiten, insb. auch fuer hw crypto
# make -j4 war sys(%) bound auch mit ssd
ARCH=arm make -j2 olddefconfig &&
ARCH=arm make -j2 zImage &&
ARCH=arm make -j2 dtbs &&
ARCH=arm INSTALL_HDR_PATH=/build/headers make headers_install &&
ARCH=arm INSTALL_MOD_PATH=/build/squashfs-root make modules modules_install
mount -o remount,rw /media/mmcblk0p1
cd /build/linux
cp arch/arm/boot/zImage /media/mmcblk0p1/boot/vmlinuz-sunxi
cp arch/arm/boot/dts/allwinner/sun7i-a20-cubietruck.dtb /media/mmcblk0p1/boot/dtbs/
cd /build/squashfs-root
mksquashfs lib/ modloop-sunxi -noappend -always-use-fragments
cp modloop-sunxi /media/mmcblk0p1/boot/modloop-sunxi
extlinux.conf sieht so aus:
prompt funktioniert nicht glaub ich
bei problemen auf vanilla (4.19) zurueck
TIMEOUT 20
PROMPT 1
DEFAULT vanilla # das da immer anpassen zum testen
LABEL vanilla
MENU LABEL Linux vanilla
KERNEL /boot/vmlinuz-vanilla
INITRD /boot/initramfs-vanilla
DEVICETREEDIR /boot/dtbs
APPEND modules=loop,squashfs,sd-mod,usb-storage quiet modloop=/boot/modloop-vanilla
LABEL sunxi
MENU LABEL Linux sunxi
KERNEL /boot/vmlinuz-sunxi
DEVICETREEDIR /boot/dtbs
APPEND modules=loop,squashfs,sd-mod,usb-storage quiet modloop=/boot/modloop-sunxi modloop_verify=no
out of scope im moment:
(hatte ich 2019 schon erledigt)
u-boot, boot.scr, ...
todo nach gitlab
dockerfile aktualisieren
grsec raus
ftd memory erhoehen (128M root ist zu klein?)
was ist $V
tmem / zswap aktivieren + swap auf ssd bei boot
andere SSD suchen?
generic-uboot build cherrypick + CI
image testboot per qemu wenn mgl oder sonst wie?
reboot problem loesen
https://forum.armbian.com/topic/31698-armbian-hangs-on-reboot/
oder workaround (CI freundlich) mit arduino ich glaub es gab was
reset button hat loetstellen :-)
nand boot
https://stevensaunderson.com/CTNandBoot.htm
https://linux-sunxi.org/Mainline_NAND_Howto
openqa
https://github.com/grisu48/openqa-serial/blob/main/README.md
3. cubietruck besorgen
+SD karte
+Arduino
an gitlab tun
build ID in image in MOTD tun
serial oder ssh -> build id pruefen
modloop erklaerungen und zum spicken
https://superuser.com/questions/1290314/what-is-modloop-option-in-alpine
https://gist.github.com/alexalouit/37c6726d60f1ed19dcf95540331d90ff
Xen specific
https://wiki.alpinelinux.org/wiki/Xen_Dom0
LBU specific
https://wiki.alpinelinux.org/wiki/Diskless_Mode
LBU apkvol edit
https://wiki.alpinelinux.org/wiki/Manually_editing_a_existing_apkovl
LBU upgrade commands
https://wiki.alpinelinux.org/wiki/Upgrading_Alpine_Linux_to_a_new_release_branch
@FlorianHeigl
Copy link
Author

tmem wurde gecancelled :-(

@FlorianHeigl
Copy link
Author

FlorianHeigl commented Oct 30, 2025

stripping:

  • busybox (statt chrony), dropbear (start openssh)
  • kann man avahi wegmachen?
  • kann man dbus wegmachen?
  • kann man hg statt git fuer etckeeper nehmen
  • was brauchte gnutls
  • unterstuetzt irgendwas seccomp
  • braucht etwas zstd, lzo, xz, ...

aktuell:

Filesystem                Size      Used Available Use% Mounted on
tmpfs                   400.0M    129.6M    270.4M  32% /

ziel 100MB, dann ist gut...

zswap ca. 200MB plus 1-2GB SSD swap sollten passen.

groesse von /var/log beachten, auslagern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment