using genext2fs to make ramdisk.gz (2011-07-25 23:26)

来源:互联网 发布:23端口网址 编辑:程序博客网 时间:2024/05/16 05:05
 
 

Tools:http://genext2fs.sourceforge.net/

 

genext2fs  -d  root  -b  16384 -i  1024 -r  0 -D  device.txt  -q  ramdisk

gzip  -f  -9  ramdisk

内核参数:

RedBoot> fis load ramdisk.gz -b 0x800000

RedBoot> fis load zImage -b 0x80000

RedBoot> exec -r 0x800000 -s 0x300000 -c "root=/dev/ram console=ttyAM0,57600"

 

$ ./genext2fs -h

Usage: ./genext2fs [options] image

Create an ext2 filesystem image from directories/files

  -x, --starting-image <image>

  -d, --root <directory>

  -D, --devtable <file>

  -b, --size-in-blocks <blocks>

  -i, --bytes-per-inode <bytes per inode>

  -I, --number-of-inodes <number of inodes>

  -r, --reserved-blocks <number of reserved blocks>

  -g, --block-map <path>     Generate a block map file for this path.

  -e, --fill-value <value>   Fill unallocated blocks with value.

  -z, --allow-holes          Allow files with holes.

  -f, --faketime             Set filesystem timestamps to 0 (for testing).

  -q, --squash               Same as "-U -P".

  -U, --squash-uids          Squash owners making all files be owned by root.

  -P, --squash-perms         Squash permissions on all files.

  -h, --help

  -v, --verbose

 

 

#******************************************************************************
#
# device.txt - Configuration file for genext2fs.
#
# Copyright (c) 2004 Cirrus Logic, Inc.
#
#******************************************************************************

#
# <name>                               <t> <mode> <u> <g> <Mj> <mn> <s> <i> <c>
# where <name> is the file name,  <t> can be one of:
#       f       A regular file
#       d       Directory
#       c       Character special device file
#       b       Block special device file
#       p       Fifo (named pipe)
# <u> is the user id for the target file, <g> is the group id for the
# target file.  The rest of the entries (<Mj>, <mn>, <s>, <i>, and <c>) apply
# only  to device special files.
#

#
# Create some directories.
#
# <name>                               <t> <mode> <u> <g> <Mj> <mn> <s> <i> <c>
/mnt                                    d    755   0   0    -    -   -   -   -
/proc                                   d    555   0   0    -    -   -   -   -
/tmp                                    d   1777   0   0    -    -   -   -   -
/var                                    d    755   0   0    -    -   -   -   -
/var/log                                d    755   0   0    -    -   -   -   -
/var/run                                d    755   0   0    -    -   -   -   -
/var/run                                d    755   0   0    -    -   -   -   -
/var/run/wpa_supplicant                 d    755   0   0    -    -   -   -   -
/var/spool                              d    755   0   0    -    -   -   -   -
/var/spool/cron                         d    755   0   0    -    -   -   -   -
/var/spool/cron/crontabs                d    755   0   0    -    -   -   -   -
/dev                                    d    755   0   0    -    -   -   -   -
/dev/input                              d    755   0   0    -    -   -   -   -
/dev/misc                               d    755   0   0    -    -   -   -   -
/dev/pts                                d    755   0   0    -    -   -   -   -
/dev/snd    d    755   0   0    -    -   -   -   -

#
# Adjust the permissions on some normal files.
#
# <name>                               <t> <mode> <u> <g> <Mj> <mn> <s> <i> <c>
/etc/rc.sysinit                         f    755   0   0    -    -   -   -   -
/etc/shadow                             f    600   0   0    -    -   -   -   -
/sbin/hotplug                           f    755   0   0    -    -   -   -   -
/usr/share/udhcpc/default.script        f    755   0   0    -    -   -   -   -

#
# Create the necessary character device nodes.
#
# <name>                               <t> <mode> <u> <g> <Mj> <mn> <s> <i> <c>
/dev/mem                                c    640   0   0    1    1   0   0   -
/dev/kmem                               c    640   0   0    1    2   0   0   -
/dev/null                               c    640   0   0    1    3   0   0   -
/dev/zero                               c    640   0   0    1    5   0   0   -
/dev/random                             c    640   0   0    1    8   0   0   -
/dev/urandom                            c    640   0   0    1    9   0   0   -
/dev/ptyp                               c    666   0   0    2    0   0   1   8
/dev/ttyp                               c    666   0   0    3    0   0   1   8
/dev/tty                                c    666   0   0    4    0   0   1   8
/dev/tty                                c    666   0   0    5    0   0   0   -
/dev/console                            c    640   0   0    5    1   0   0   -
/dev/ptmx                               c    666   0   0    5    2   0   0   -
/dev/vcs                                c    666   0   0    7    0   0   0   -
/dev/vcs                                c    666   0   0    7    1   1   1   8
/dev/vcsa                               c    666   0   0    7  128   0   0   -
/dev/vcsa                               c    666   0   0    7  129   1   1   8
/dev/misc/ep93xx_ts                     c    666   0   0   10  240   0   0   -
/dev/input/mice                         c    600   0   0   13   63   0   0   -
/dev/input/mouse0                       c    600   0   0   13   32   0   0   -
/dev/mixer                              c    600   0   0   14    0   0   0   -
/dev/dsp                                c    600   0   0   14    3   0   0   -
/dev/audio                              c    600   0   0   14    4   0   0   -
/dev/dsp1                               c    600   0   0   14   19   0   0   -
/dev/audio1                             c    600   0   0   14   20   0   0   -
/dev/dsp2                               c    600   0   0   14   35   0   0   -
/dev/audio2                             c    600   0   0   14   36   0   0   -
/dev/fb                                 c    600   0   0   29    0   0   0   -
/dev/fb0                                c    600   0   0   29    0   0   0   -
/dev/lirc                               c    600   0   0   61    0   0   0   -
/dev/lircd                              p    600   0   0    -    -   -   -   -
/dev/lircm                              p    600   0   0    -    -   -   -   -
/dev/mtd                                c    644   0   0   90    0   0   2   8
/dev/rtc    c    644   0   0   10  135 0   2   - 
/dev/mtdr                               c    644   0   0   90    1   0   2   8
/dev/rawctl                             c    660   0   0  162    0   0   0   -
/dev/ttyAM                              c    640   0   0  204   16   0   1   2
/dev/cuam                               c    640   0   0  205   16   0   1   2
/dev/snd/controlC0                      c    640   0   0  116    0   0   0   -
/dev/snd/pcmC0D0c                       c    640   0   0  116   24   0   0   -
/dev/snd/pcmC0D0p                       c    640   0   0  116   16   0   0   -
/dev/snd/pcmC0D1c                       c    640   0   0  116   25   0   0   -
/dev/snd/pcmC0D2c                       c    640   0   0  116   26   0   0   -
/dev/snd/pcmC0D3c                       c    640   0   0  116   27   0   0   -
/dev/snd/pcmC0D4p                       c    640   0   0  116   20   0   0   -
/dev/snd/timer                          c    640   0   0  116   33   0   0   -
/dev/ttyUSB                             c    666   0   0  188    0   0   1   40
#
# Create the necessary block device nodes.
#
# <name>                               <t> <mode> <u> <g> <Mj> <mn> <s> <i> <c>
/dev/ram                                b    640   0   0    1    0   0   0   -
/dev/ram                                b    640   0   0    1    0   0   1   4
/dev/hda                                b    640   0   0    3    0   0   0   -
/dev/hda                                b    640   0   0    3    1   1   1   8
/dev/hdb                                b    640   0   0    3   64   0   0   -
/dev/hdb                                b    640   0   0    3   65   1   1   8
/dev/loop                               b    640   0   0    7    0   0   1   8
/dev/sda                                b    660   0   0    8    0   0   0   -
/dev/sda                                b    660   0   0    8    1   1   1   4
/dev/sdb                                b    660   0   0    8   16   0   0   -
/dev/sdb                                b    660   0   0    8   17   1   1   4
/dev/mtdblock                           b    640   0   0   31    0   0   1   8

原创粉丝点击