§2023-10-17
alexlai@orangepi5plus:/boot$ file uInitrd-5.10.110+
uInitrd-5.10.110+: u-boot legacy uImage, uInitrd, Linux/ARM 64-bit, RAMDisk Image (gzip), 20013857 bytes, Sat Oct 14 04:49:33 2023, Load Address: 00000000, Entry Point: 00000000, Header CRC: 0X3503C960, Data CRC: 0XACD8079E
alexlai@orangepi5plus:~/build/uInitrd$ cp -v /boot/uInitrd-5.10.110+ ./
'/boot/uInitrd-5.10.110+' -> './uInitrd-5.10.110+'
alexlai@orangepi5plus:~/build/uInitrd$ file uInitrd-5.10.110+
uInitrd-5.10.110+: u-boot legacy uImage, uInitrd, Linux/ARM 64-bit, RAMDisk Image (gzip), 20013857 bytes, Sat Oct 14 04:49:33 2023, Load Address: 00000000, Entry Point: 00000000, Header CRC: 0X3503C960, Data CRC: 0XACD8079E
alexlai@orangepi5plus:~/build/uInitrd$ dd if=uInitrd-5.10.110+ of=initrd.gz skip=64 bs=1
20013857+0 records in
20013857+0 records out
20013857 bytes (20 MB, 19 MiB) copied, 47.1611 s, 424 kB/s
alexlai@orangepi5plus:~/build/uInitrd$ ls
initrd.gz uInitrd-5.10.110+
alexlai@orangepi5plus:~/build/uInitrd$ gunzip initrd.gz
alexlai@orangepi5plus:~/build/uInitrd$ ls
initrd uInitrd-5.10.110+
mkdir initrd_dir
cd initrd_dir
cpio -id < ../initrd
alexlai@orangepi5plus:~/build/uInitrd$ mkdir initrd_dir
alexlai@orangepi5plus:~/build/uInitrd$ cd initrd_dir/
alexlai@orangepi5plus:~/build/uInitrd/initrd_dir$ cpio -id < ../initrd
104940 blocks
alexlai@orangepi5plus:~/build/uInitrd/initrd_dir$ ls
bin conf etc init lib run sbin scripts usr var
``
2) create
#!/bin/bash
mkdir -p initramfs_dir/{bin,conf,etc,init,lib,run,sbin,scripts,usr,var}
find initramfs_dir | cpio -H newc -o > initramfs.cpio
gzip initramfs.cpio
mkimage -A arm64 -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n "Initramfs Image" -d initramfs.cpio.gz uInitrd
rm -r initramfs_dir rm initramfs.cpio.gz
#!/bin/bash
mkdir -p initramfs_dir
cp -rv {bin,conf,etc,init,lib,run,sbin,scripts,usr,var} initramfs_dir
find initramfs_dir | cpio -H newc -o > initramfs.cpio
gzip initramfs.cpio
mkimage -A arm64 -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n "Initramfs Image" -d initramfs.cpio.gz uInitrd
rm -r initramfs_dir rm initramfs.cpio.gz
Return to Top