Community
cancel
Showing results for 
Search instead for 
Did you mean: 

Initramfs Update

Initramfs Update




The initramfs is enabled in kernel config with,

General setup -->

(../romfs ../vendors/Altera/nios2nommu/romfs_list) Initramfs source

(500) User ID to map to 0 (user root)

(500) Group ID to map to 0 (group root)

The ../romfs dir contains the apps and config files in the filesystem.

The ../vendors/Altera/nios2nommu/romfs_list contains the dev nodes.

If your user ID and group ID in Linux PC are not 500:500, you need to change these ID fields to your ID number.


You must not assign any other root dev in kernel command line. You should keep it empty.

Processor type and features -->

() Default kernel command string

[ ] Passed kernel command line from u-boot 


Starting from kernel 2.6.17 or later, the gen script of initramfs changed to improve dependency. And the initramfs will always update if the contents changed.


A dependency file will be created from the initramfs source dir and file list, linux-2.6.x/usr/.initramfs_data.cpio.gz.d

, which will contain the list of files, should look like this (more or less),


deps_initramfs := \\\

../romfs \\\

../romfs/bin \\\

../romfs/bin/boa \\\

../romfs/bin/busybox \\\

../romfs/bin/dd \\\

../romfs/bin/netstat \\\

../romfs/bin/ping \\\

../romfs/bin/dhcpcd \\\

../romfs/bin/ftp \\\

../romfs/bin/ftpd \\\

../romfs/bin/inetd \\\

../romfs/bin/init \\\

../romfs/bin/sh \\\

../romfs/bin/telnetd \\\

../romfs/dev \\\

../romfs/etc \\\

../romfs/etc/config \\\

../romfs/etc/config/config \\\

../romfs/etc/config/options \\\

../romfs/etc/config/start \\\

../romfs/etc/default \\\

../romfs/etc/dhcp \\\

../romfs/etc/inetd.conf \\\

../romfs/etc/services \\\

../romfs/etc/motd \\\

../romfs/etc/inittab \\\

../romfs/etc/rc \\\

../romfs/etc/TZ \\\

../romfs/etc/passwd \\\

../romfs/etc/group \\\

../romfs/etc/hosts \\\

../romfs/etc/host.conf \\\

../romfs/etc/ftpwelcome \\\

../romfs/etc/ftpusers \\\

../romfs/etc/boa.conf \\\

../romfs/etc/mime.types \\\

../romfs/etc/version \\\

../romfs/home \\\

../romfs/home/ftp \\\

../romfs/home/httpd \\\

../romfs/home/httpd/cgi-bin \\\

../romfs/home/httpd/cgi-bin/cgi_demo \\\

../romfs/home/httpd/index.html \\\

../romfs/home/httpd/boa.conf \\\

../romfs/lib \\\

../romfs/lib/liberror.txt \\\

../romfs/lib/modules \\\

../romfs/lib/modules/2.6.17-uc1 \\\

../romfs/lib/modules/2.6.17-uc1/kernel \\\

../romfs/lib/modules/2.6.17-uc1/net \\\

../romfs/lib/modules/2.6.17-uc1/net/zd1211.ko \\\

../romfs/lib/modules/2.6.17-uc1/net/zd1211b.ko \\\

../romfs/lib/modules/modules.dep \\\

../romfs/mnt \\\

../romfs/proc \\\

../romfs/usr \\\

../romfs/usr/bin \\\

../romfs/usr/bin/ftpget \\\

../romfs/usr/bin/ftpput \\\

../romfs/usr/bin/telnet \\\

../romfs/usr/bin/wget \\\

../romfs/var \\\

../romfs/sys \\\

../romfs/tmp \\\

../romfs/init \\\

../romfs/sbin \\\

../romfs/sbin/ifconfig \\\

../romfs/sbin/insmod \\\

../romfs/sbin/lsmod \\\

../romfs/sbin/modprobe \\\

../romfs/sbin/rmmod \\\

../romfs/sbin/route \\\


The most important item is ../romfs/init ,which is the hint for kernel to enable initramfs.


Other important files created in linux-2.6.x/usr dir,

initramfs_data.cpio.gz , the gziped cpio archive.

initramfs_data.o , the archive as a binary object.

For defualt user apps config, both should be around 400-500KB.


If you have the error in booting,

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

It may be problem in initramfs, you can remove the romfs dir, and create again.

rm -rf romfs

mkdir romfs

make


Version history
Revision #:
1 of 1
Last update:
‎06-27-2019 05:15 PM
Updated by:
 
Contributors