cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
6,459 Views

how to make a initramfs by cpio?

Jump to solution

i have used sp605 and builded linux kernel with 'http://xilinx.wikidot.com/microblaze-linux'

now i have another problem.i want to generate my ramfs by busybox but failed.

so i try to modify initramfs_minimal.cpio.gz(download from http://git.xilinx.com/) and failed too.

by now,i only uncompress this file and compress again, the same result. i think maybe there is some problems with my command.

the commands are showed as follow:

gunzip initramfs_minimal.cpio.gz

cpio -ivdum < initramfs_minimal.cpio.gz
rm initramfs_minimal.cpio
find -print | cpio -ov > initramfs_minimal.cpio
gzip initramfs_minimal.cpio
 
Regards

0 Kudos
Reply
1 Solution

Accepted Solutions
Anonymous
Not applicable
7,736 Views

find the solution.

change:

find . | cpio -ov > xxx.cpio
to:
find . | cpio  -H newc -o > xxx.cpio

View solution in original post

0 Kudos
Reply
2 Replies
Anonymous
Not applicable
6,446 Views

 

[root@vmwarecentos5 ramfs_0810_1]# ls -l
total 808
-rw-rw-r-- 1 staff staff 821356 Oct 2 2009 initramfs_minimal.cpio.gz
[root@vmwarecentos5 ramfs_0810_1]# gunzip initramfs_minimal.cpio.gz
[root@vmwarecentos5 ramfs_0810_1]# cpio -ivdum < initramfs_minimal.cpio
.
bin
bin/busybox
bin/[
bin/[[
bin/addgroup
bin/adduser
bin/ar
bin/arping
bin/ash
bin/awk
bin/basename
bin/bbconfig
bin/bunzip2
bin/bzcat
bin/bzip2
bin/cal
bin/cat
bin/catv
bin/chat
bin/chattr
bin/chgrp
bin/chmod
bin/chown
bin/chpst
bin/chrt
bin/chvt
bin/cksum
bin/clear
bin/cmp
bin/comm
bin/cp
bin/cpio
bin/crontab
bin/cryptpw
bin/cttyhack
bin/cut
bin/date
bin/dc
bin/dd
bin/deallocvt
bin/delgroup
bin/deluser
bin/df
bin/diff
bin/dirname
bin/dmesg
bin/dos2unix
bin/dpkg
bin/dpkg-deb
bin/du
bin/dumpkmap
bin/dumpleases
bin/echo
bin/ed
bin/egrep
bin/eject
bin/env
bin/envdir
bin/envuidgid
bin/ether-wake
bin/expand
bin/expr
bin/false
bin/fdflush
bin/fdformat
bin/fgrep
bin/find
bin/fold
bin/free
bin/ftpget
bin/ftpput
bin/fuser
bin/getopt
bin/grep
bin/gunzip
bin/gzip
bin/hd
bin/head
bin/hexdump
bin/hostid
bin/hostname
bin/id
bin/install
bin/ip
bin/ipaddr
bin/ipcalc
bin/ipcrm
bin/ipcs
bin/iplink
bin/iproute
bin/iprule
bin/iptunnel
bin/kbd_mode
bin/kill
bin/killall
bin/killall5
bin/last
bin/length
bin/less
bin/linux32
bin/linux64
bin/ln
bin/logger
bin/login
bin/logname
bin/lpq
bin/lpr
bin/ls
bin/lsattr
bin/lzmacat
bin/makemime
bin/md5sum
bin/mesg
bin/microcom
bin/mkdir
bin/mkfifo
bin/mknod
bin/mktemp
bin/more
bin/mount
bin/mountpoint
bin/mt
bin/mv
bin/nc
bin/netstat
bin/nice
bin/nmeter
bin/nohup
bin/nslookup
bin/od
bin/openvt
bin/passwd
bin/patch
bin/pgrep
bin/pidof
bin/ping
bin/ping6
bin/pipe_progress
bin/pkill
bin/printenv
bin/printf
bin/ps
bin/pscan
bin/pwd
bin/readlink
bin/realpath
bin/reformime
bin/renice
bin/reset
bin/resize
bin/rm
bin/rmdir
bin/rpm
bin/rpm2cpio
bin/rtcwake
bin/run-parts
bin/runsv
bin/runsvdir
bin/rx
bin/script
bin/sed
bin/seq
bin/setarch
bin/setkeycodes
bin/setsid
bin/setuidgid
bin/sh
bin/sha1sum
bin/showkey
bin/sleep
bin/softlimit
bin/sort
bin/split
bin/stat
bin/strings
bin/stty
bin/su
bin/sum
bin/sv
bin/sync
bin/tac
bin/tail
bin/tar
bin/tcpsvd
bin/tee
bin/telnet
bin/test
bin/tftp
bin/tftpd
bin/time
bin/top
bin/touch
bin/tr
bin/traceroute
bin/true
bin/tty
bin/ttysize
bin/udpsvd
bin/umount
bin/uname
bin/uncompress
bin/unexpand
bin/uniq
bin/unix2dos
bin/unlzma
bin/unzip
bin/uptime
bin/usleep
bin/uudecode
bin/uuencode
bin/vi
bin/vlock
bin/watch
bin/wc
bin/wget
bin/which
bin/who
bin/whoami
bin/xargs
bin/yes
bin/zcat
dev
dev/ram
dev/mem
dev/null
dev/zero
dev/random
dev/ptyp0
dev/ptyp1
dev/ptyp2
dev/ttyp0
dev/ttyp1
dev/ttyp2
dev/tty0
dev/tty1
dev/tty2
dev/tty3
dev/tty4
dev/ttyS0
dev/tty
dev/console
dev/ptmx
dev/loop
dev/ttyUL0
dev/xsa1
dev/i2c
dev/i2c/0
sbin
sbin/adjtimex
sbin/arp
sbin/blkid
sbin/brctl
sbin/chpasswd
sbin/chroot
sbin/crond
sbin/devfsd
sbin/devmem
sbin/dhcprelay
sbin/dnsd
sbin/fakeidentd
sbin/fbset
sbin/fbsplash
sbin/findfs
sbin/freeramdisk
sbin/fsck
sbin/fsck.minix
sbin/getty
sbin/halt
sbin/hdparm
sbin/httpd
sbin/hwclock
sbin/ifconfig
sbin/ifdown
sbin/ifenslave
sbin/ifup
sbin/inetd
sbin/init
sbin/klogd
sbin/loadfont
sbin/loadkmap
sbin/logread
sbin/losetup
sbin/lpd
sbin/makedevs
sbin/man
sbin/mdev
sbin/mkfs.minix
sbin/mkswap
sbin/nameif
sbin/pivot_root
sbin/popmaildir
sbin/poweroff
sbin/raidautorun
sbin/rdate
sbin/rdev
sbin/readprofile
sbin/reboot
sbin/route
sbin/runlevel
sbin/sendmail
sbin/setconsole
sbin/setfont
sbin/setlogcons
sbin/slattach
sbin/start-stop-daemon
sbin/sulogin
sbin/svlogd
sbin/swapoff
sbin/swapon
sbin/switch_root
sbin/sysctl
sbin/syslogd
sbin/telnetd
sbin/udhcpc
sbin/udhcpd
sbin/vconfig
sbin/watchdog
sbin/zcip
etc
etc/rpc
etc/fstab
etc/init.d
etc/init.d/rcS
etc/inittab
init
mnt
proc
sys
tmp
var
var/log
3795 blocks
[root@vmwarecentos5 ramfs_0810_1]# rm initramfs_minimal.cpio
rm: remove regular file `initramfs_minimal.cpio'? y
[root@vmwarecentos5 ramfs_0810_1]# find -print |cpio -ov > ../initramfs_minimal.cpio
.
./bin
./bin/busybox
./bin/[
./bin/[[
./bin/addgroup
./bin/adduser
./bin/ar
./bin/arping
./bin/ash
./bin/awk
./bin/basename
./bin/bbconfig
./bin/bunzip2
./bin/bzcat
./bin/bzip2
./bin/cal
./bin/cat
./bin/catv
./bin/chat
./bin/chattr
./bin/chgrp
./bin/chmod
./bin/chown
./bin/chpst
./bin/chrt
./bin/chvt
./bin/cksum
./bin/clear
./bin/cmp
./bin/comm
./bin/cp
./bin/cpio
./bin/crontab
./bin/cryptpw
./bin/cttyhack
./bin/cut
./bin/date
./bin/dc
./bin/dd
./bin/deallocvt
./bin/delgroup
./bin/deluser
./bin/df
./bin/diff
./bin/dirname
./bin/dmesg
./bin/dos2unix
./bin/dpkg
./bin/dpkg-deb
./bin/du
./bin/dumpkmap
./bin/dumpleases
./bin/echo
./bin/ed
./bin/egrep
./bin/eject
./bin/env
./bin/envdir
./bin/envuidgid
./bin/ether-wake
./bin/expand
./bin/expr
./bin/false
./bin/fdflush
./bin/fdformat
./bin/fgrep
./bin/find
./bin/fold
./bin/free
./bin/ftpget
./bin/ftpput
./bin/fuser
./bin/getopt
./bin/grep
./bin/gunzip
./bin/gzip
./bin/hd
./bin/head
./bin/hexdump
./bin/hostid
./bin/hostname
./bin/id
./bin/install
./bin/ip
./bin/ipaddr
./bin/ipcalc
./bin/ipcrm
./bin/ipcs
./bin/iplink
./bin/iproute
./bin/iprule
./bin/iptunnel
./bin/kbd_mode
./bin/kill
./bin/killall
./bin/killall5
./bin/last
./bin/length
./bin/less
./bin/linux32
./bin/linux64
./bin/ln
./bin/logger
./bin/login
./bin/logname
./bin/lpq
./bin/lpr
./bin/ls
./bin/lsattr
./bin/lzmacat
./bin/makemime
./bin/md5sum
./bin/mesg
./bin/microcom
./bin/mkdir
./bin/mkfifo
./bin/mknod
./bin/mktemp
./bin/more
./bin/mount
./bin/mountpoint
./bin/mt
./bin/mv
./bin/nc
./bin/netstat
./bin/nice
./bin/nmeter
./bin/nohup
./bin/nslookup
./bin/od
./bin/openvt
./bin/passwd
./bin/patch
./bin/pgrep
./bin/pidof
./bin/ping
./bin/ping6
./bin/pipe_progress
./bin/pkill
./bin/printenv
./bin/printf
./bin/ps
./bin/pscan
./bin/pwd
./bin/readlink
./bin/realpath
./bin/reformime
./bin/renice
./bin/reset
./bin/resize
./bin/rm
./bin/rmdir
./bin/rpm
./bin/rpm2cpio
./bin/rtcwake
./bin/run-parts
./bin/runsv
./bin/runsvdir
./bin/rx
./bin/script
./bin/sed
./bin/seq
./bin/setarch
./bin/setkeycodes
./bin/setsid
./bin/setuidgid
./bin/sh
./bin/sha1sum
./bin/showkey
./bin/sleep
./bin/softlimit
./bin/sort
./bin/split
./bin/stat
./bin/strings
./bin/stty
./bin/su
./bin/sum
./bin/sv
./bin/sync
./bin/tac
./bin/tail
./bin/tar
./bin/tcpsvd
./bin/tee
./bin/telnet
./bin/test
./bin/tftp
./bin/tftpd
./bin/time
./bin/top
./bin/touch
./bin/tr
./bin/traceroute
./bin/true
./bin/tty
./bin/ttysize
./bin/udpsvd
./bin/umount
./bin/uname
./bin/uncompress
./bin/unexpand
./bin/uniq
./bin/unix2dos
./bin/unlzma
./bin/unzip
./bin/uptime
./bin/usleep
./bin/uudecode
./bin/uuencode
./bin/vi
./bin/vlock
./bin/watch
./bin/wc
./bin/wget
./bin/which
./bin/who
./bin/whoami
./bin/xargs
./bin/yes
./bin/zcat
./dev
./dev/ram
./dev/mem
./dev/null
./dev/zero
./dev/random
./dev/ptyp0
./dev/ptyp1
./dev/ptyp2
./dev/ttyp0
./dev/ttyp1
./dev/ttyp2
./dev/tty0
./dev/tty1
./dev/tty2
./dev/tty3
./dev/tty4
./dev/ttyS0
./dev/tty
./dev/console
./dev/ptmx
./dev/loop
./dev/ttyUL0
./dev/xsa1
./dev/i2c
./dev/i2c/0
./sbin
./sbin/adjtimex
./sbin/arp
./sbin/blkid
./sbin/brctl
./sbin/chpasswd
./sbin/chroot
./sbin/crond
./sbin/devfsd
./sbin/devmem
./sbin/dhcprelay
./sbin/dnsd
./sbin/fakeidentd
./sbin/fbset
./sbin/fbsplash
./sbin/findfs
./sbin/freeramdisk
./sbin/fsck
./sbin/fsck.minix
./sbin/getty
./sbin/halt
./sbin/hdparm
./sbin/httpd
./sbin/hwclock
./sbin/ifconfig
./sbin/ifdown
./sbin/ifenslave
./sbin/ifup
./sbin/inetd
./sbin/init
./sbin/klogd
./sbin/loadfont
./sbin/loadkmap
./sbin/logread
./sbin/losetup
./sbin/lpd
./sbin/makedevs
./sbin/man
./sbin/mdev
./sbin/mkfs.minix
./sbin/mkswap
./sbin/nameif
./sbin/pivot_root
./sbin/popmaildir
./sbin/poweroff
./sbin/raidautorun
./sbin/rdate
./sbin/rdev
./sbin/readprofile
./sbin/reboot
./sbin/route
./sbin/runlevel
./sbin/sendmail
./sbin/setconsole
./sbin/setfont
./sbin/setlogcons
./sbin/slattach
./sbin/start-stop-daemon
./sbin/sulogin
./sbin/svlogd
./sbin/swapoff
./sbin/swapon
./sbin/switch_root
./sbin/sysctl
./sbin/syslogd
./sbin/telnetd
./sbin/udhcpc
./sbin/udhcpd
./sbin/vconfig
./sbin/watchdog
./sbin/zcip
./etc
./etc/rpc
./etc/fstab
./etc/init.d
./etc/init.d/rcS
./etc/inittab
./init
./mnt
./proc
./sys
./tmp
./var
./var/log
3740 blocks
[root@vmwarecentos5 ramfs_0810_1]# cd ..
[root@vmwarecentos5 emb_linux]# gzip initramfs_minimal.cpio
[root@vmwarecentos5 emb_linux]# ls -l initramfs_minimal.cpio.gz
-rw------- 1 root root 820378 Aug 10 09:29 initramfs_minimal.cpio.gz

 

 

0 Kudos
Reply
Anonymous
Not applicable
7,737 Views

find the solution.

change:

find . | cpio -ov > xxx.cpio
to:
find . | cpio  -H newc -o > xxx.cpio

View solution in original post

0 Kudos
Reply