Jump to content

billymore

Members
  • Posts

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    billymore reacted to Nick A in Have Armbian for Tanix TX1 QHZIW_H313_TX1_EMCP_V2.0?   
    @billymore I got this from AI. It's not perfect. I haven't done this before. 

    To convert a standard Armbian root filesystem (typically an ext4 partition) into the rootfs.cpio.lzma.uboot format required for RAM booting, you must package the file tree into a CPIO archive, compress it with LZMA, and then wrap it with a U-Boot header.
     
    1. Extract the Armbian RootFS 
    First, you need the actual files from your Armbian image. Mount the image to a temporary directory on your Linux PC:
    mkdir -p /tmp/armbian_root
     
    If you have your Armbian .img file ready, run this command to find the start sector of the root partition (usually the second partition):
    fdisk -l armbian_image.img
     
    Multiply that Start number by 512 to get the exact offset for the mount command.
    sudo mount -o loop,offset=YOUR_OFFSET armbian_image.img /tmp/armbian_root
     
    A standard Armbian rootfs doesn't have an init file in the root directory; it uses sbin/init (a symlink to systemd). A RAM disk requires an executable at /init. 
    sudo ln -s sbin/init /tmp/armbian_root/init
     
    2. Create the CPIO Archive
    Pack the entire filesystem into a newc format CPIO archive. It is critical to perform this step as root to preserve file permissions. 
    cd /tmp/armbian_root
    sudo find . | sudo cpio -H newc -o > /tmp/rootfs.cpio
     
    3. Compress with LZMA 
    Compress the archive using the LZMA algorithm to minimize its size for RAM loading:
    lzma -9 /tmp/rootfs.cpio                # This creates /tmp/rootfs.cpio.lzma
     
    4. Add the U-Boot Header 
    Use the mkimage tool (from the u-boot-tools package) to add the 64-byte legacy header that U-Boot uses to identify the ramdisk. 
    mkimage -A  arm64 -O linux -T ramdisk -C lzma -n "Armbian Initramfs" -d /tmp/rootfs.cpio.lzma /tmp/rootfs.cpio.lzma.uboot
     
    -A arm: Target architecture (use arm64 if applicable).
    -T ramdisk: Identifies the image type as a RAM filesystem.
    -C lzma: Specifies the compression used.
    -d: Input data file. 
     
    sunxi-fel -v uboot u-boot-sunxi-with-spl.bin \ write 0x40080000 Image \ write 0x4fa00000 dtbs/allwinner/sun50i-h313-tanix-tx1.dtb \ write 0x4fe00000 rootfs.cpio.lzma.uboot (Note: If you are using a raw Image instead of a uImage, use booti instead of bootm).

     
    Once U-Boot initializes over the USB cable, it will drop to a prompt. You must run this to start the OS:
    Armbian’s default kernel might not have a large enough ramdisk_size allocated in its config.
    Update your bootargs to include a size limit (in KB). If your rootfs is 500MB:
    setenv bootargs "console=ttyS0,115200 root=/dev/ram0 rw" booti 0x40080000 0x4fe00000 0x4fa00000 ramdisk_size=600000  
  2. Like
    billymore reacted to Nick A in Have Armbian for Tanix TX1 QHZIW_H313_TX1_EMCP_V2.0?   
    @billymore The "Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)" error indicates that the Linux kernel could not locate or mount the root file system during startup. . 
     
     This is commonly caused by a missing or corrupted initial RAM filesystem (initramfs), an incorrect root= boot parameter
     
    write 0x4ff00000 rootfs.cpio.lzma.uboot
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines