0

I built a custom initramfs on an udoo-neo using the following instructions:

mkdir -p /usr/src/initramfs/{bin,dev,etc,lib,lib64,mnt/root,proc,root,sbin,sys}

cp -a /dev/{null,console,tty,mmcblk0p2} /usr/src/initramfs/dev/

sudo apt-get install busybox-static

cp -a /bin/busybox /usr/src/initramfs/bin/busybox

My init file is:

#!/bin/busybox sh

# Mount the /proc and /sys filesystems.
mount -t proc none /proc
mount -t sysfs none /sys

# Do your stuff here.
echo "This script just mounts and boots the rootfs, nothing else!"

# Mount the root filesystem.
mount -o ro /dev/mmcblk0p2/mnt/root

# Clean up.
umount /proc
umount /sys

# Boot the real thing.
exec switch_root /mnt/root /sbin/init
And then I do

chmod +x /usr/src/initramfs/init

After setting the initramfs source file to "/usr/src/initramfs", rebuilding, copying it back to the SD card and rebooting, i just boot into my normal screen, and the echo message does not appear. I've checked if zImage is being written properly (it is). How can I fix this?

  • open the initram, and check it. it is a regular arquive, maybe cpio to open it, cant remember. – Rui F Ribeiro Jul 19 '18 at 17:45
  • its a .gz file, and it contains all the files in /usr/src/initramfs – JHarden13 Jul 19 '18 at 20:29
  • So, are all the files there? Are you running update-grub after creating the initrd btw? – Rui F Ribeiro Jul 19 '18 at 20:29
  • All the files are there, and the udoo-neo doesn't use grub. I copy the zImage and dts files to the bootable SD card and it works. The zImage is also being overwritten, I checked. – JHarden13 Jul 19 '18 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.