Logo
General:

Files/patches:

Articles:

Security:


 

PXE boot - root file system.


How to make a rootfs image.

$ dd if=/dev/zero of=rootfs bs=1k count=8192
$ mke2fs -F rootfs
$ mkdir tmp-fs
$ mount -oloop rootfs tmp-fs
$ cp <needed files> tmp-fs
$ umount tmp-fs
$ rm -rf tmp-fs
$ gzip rootfs


Example rootfs:

$ tree -n
.
|-- bin
|   |-- basename -> busybox
|   |-- bash
|   |-- busybox
|   |-- cat -> busybox
|   |-- chgrp -> busybox
|   |-- chmod -> busybox
|   |-- chown -> busybox
|   |-- clear -> busybox
|   |-- compress -> gzip
|   |-- cp -> busybox
|   |-- cut -> busybox
|   |-- date -> busybox
|   |-- dd -> busybox
|   |-- df -> busybox
|   |-- dirname -> busybox
|   |-- dmesg -> busybox
|   |-- dos2unix -> busybox
|   |-- du -> busybox
|   |-- expr -> busybox
|   |-- false -> busybox
|   |-- find -> busybox
|   |-- free
|   |-- ftp
|   |-- grep -> busybox
|   |-- gunzip -> busybox
|   |-- gzip -> busybox
|   |-- head -> busybox
|   |-- hostname
|   |-- ln -> busybox
|   |-- ls -> busybox
|   |-- mkdir -> busybox
|   |-- mknod -> busybox
|   |-- more -> busybox
|   |-- mount
|   |-- mv -> busybox
|   |-- netstat
|   |-- pidof -> busybox
|   |-- ping
|   |-- ps -> busybox
|   |-- rm -> busybox
|   |-- rmdir -> busybox
|   |-- sed -> busybox
|   |-- sh -> bash
|   |-- sleep -> busybox
|   |-- sort -> busybox
|   |-- sync -> busybox
|   |-- syslogd -> busybox
|   |-- tail -> busybox
|   |-- tar -> busybox
|   |-- telnet
|   |-- touch -> busybox
|   |-- tr -> busybox
|   |-- true -> busybox
|   |-- umount
|   |-- uname -> busybox
|   |-- wc -> busybox
|   `-- zcat -> busybox
|-- dev
[a lot of devices here ...]
|-- etc
|   |-- DIR_COLORS
|   |-- HOSTNAME
|   |-- fdprm
|   |-- fstab
|   |-- group
|   |-- host.conf
|   |-- hosts
|   |-- inittab
|   |-- inputrc
|   |-- issue
|   |-- ld.so.conf
|   |-- login.defs
|   |-- mtab
|   |-- networks
|   |-- nsswitch.conf
|   |-- passwd
|   |-- profile
|   |-- protocols
|   |-- rc.d
|   |   `-- rc.S
|   |-- resolv.conf
|   |-- services
|   |-- shells
|   |-- termcap
|   `-- vga
|       `-- libvga.config
|-- hd
|-- lib
|   |-- ld-2.2.5.so
|   |-- ld-linux.so.2 -> ld-2.2.5.so
|   |-- libc-2.2.5.so
|   |-- libc.so.6 -> libc-2.2.5.so
|   |-- libcom_err.so.2 -> libcom_err.so.2.0
|   |-- libcom_err.so.2.0
|   |-- libcrypt-2.2.5.so
|   |-- libcrypt.so.1 -> libcrypt-2.2.5.so
|   |-- libdl-2.2.5.so
|   |-- libdl.so.2 -> libdl-2.2.5.so
|   |-- libe2p.so.2 -> libe2p.so.2.3
|   |-- libe2p.so.2.3
|   |-- libext2fs.so.2 -> libext2fs.so.2.4
|   |-- libext2fs.so.2.4
|   |-- libgpm.so.1 -> libgpm.so.1.18.0
|   |-- libgpm.so.1.18.0
|   |-- libncurses.so.5 -> libncurses.so.5.2
|   |-- libncurses.so.5.2
|   |-- libnss_db-2.2.so
|   |-- libnss_db.so.2 -> libnss_db-2.2.so
|   |-- libnss_dns-2.2.5.so
|   |-- libnss_dns.so.2 -> libnss_dns-2.2.5.so
|   |-- libnss_files-2.2.5.so
|   |-- libnss_files.so.2 -> libnss_files-2.2.5.so
|   |-- libproc.so.2.0.7
|   |-- libtermcap.so.2 -> libtermcap.so.2.0.8
|   |-- libtermcap.so.2.0.8
|   |-- libuuid.so.1 -> libuuid.so.1.2
|   |-- libuuid.so.1.2
|   |-- libz.so -> libz.so.1.1.4
|   |-- libz.so.1 -> libz.so.1.1.4
|   `-- libz.so.1.1.4
|-- lost+found
|-- mnt
|   `-- fd
|-- net
|-- nvnet.o
|-- proc
|-- root
|-- sbin -> usr/sbin/
|-- tmp
|-- usr
|   |-- bin
|   |   |-- md5sum
|   |   |-- nc
|   |   |-- pico
|   |   |-- ssh
|   |   |-- strings
|   |   |-- traceroute
|   |   |-- wget
|   |   `-- zip
|   |-- lib
|   |   |-- libcrypto.so -> libcrypto.so.0
|   |   |-- libcrypto.so.0 -> libcrypto.so.0.9.6
|   |   |-- libcrypto.so.0.9.6
|   |   |-- libdb-3.1.so
|   |   |-- libdb.so -> libdb-3.1.so
|   |   |-- libm-2.2.5.so
|   |   |-- libm.so.6 -> libm-2.2.5.so
|   |   |-- libresolv-2.2.5.so
|   |   |-- libresolv.so.2 -> libresolv-2.2.5.so
|   |   |-- libssl.so -> libssl.so.0
|   |   |-- libssl.so.0 -> libssl.so.0.9.6
|   |   |-- libssl.so.0.9.6
|   |   |-- libvga.so -> libvga.so.1.4.3
|   |   |-- libvga.so.1 -> libvga.so.1.4.3
|   |   |-- libvga.so.1.4.3
|   |   `-- terminfo -> ../share/terminfo
|   |-- sbin
|   |   |-- agetty
|   |   |-- badblocks
|   |   |-- chroot
|   |   |-- e2fsck
|   |   |-- fdisk
|   |   |-- halt
|   |   |-- id
|   |   |-- ifconfig
|   |   |-- insmod
|   |   |-- loadkmap -> /bin/busybox
|   |   |-- lsmod -> /bin/busybox
|   |   |-- mke2fs
|   |   |-- mkswap -> /bin/busybox
|   |   |-- mount -> /bin/mount
|   |   |-- ping -> /bin/busybox
|   |   |-- rdev
|   |   |-- reboot -> halt
|   |   |-- rmmod -> /bin/busybox
|   |   |-- route
|   |   |-- setkeycodes -> /bin/busybox
|   |   |-- setpci
|   |   |-- setserial
|   |   |-- shutdown
|   |   |-- swapoff -> /bin/busybox
|   |   |-- swapon -> /bin/busybox
|   |   |-- umount -> /bin/umount
|   |   `-- update -> /bin/busybox
|   `-- share
|       `-- terminfo
|           |-- c
|           |   `-- console -> ../l/linux
|           |-- l
|           |   `-- linux
|           `-- v
|               |-- vt100
|               |-- vt102
|               `-- vt220
`-- var
    `-- tmp -> ../tmp

Copyright © 2003-2009 by Ofi