Am Donnerstag, 22. Februar 2007 schrieb ext Boyd Stephen Smith Jr.: > For the life of me, I always found it easier to get an initrd working > rather > than an initramfs -- the whole chroot/exec vs. pivot_root vs. switch_root > step always failed for me when using an initramfs (and the very same > shell script worked as an initrd).
Here's what I use in my initramfs' linuxrc:
# change roots
echo "initramfs: Switching to real root volume" 2>&1
find -xdev / -exec rm '{}' ';'
cd /newroot
mount --move . /
echo "initramfs: Starting init with options ${INIT_OPTS} ..."
exec chroot . /bin/bash <<- EOF >/dev/console
exec /sbin/init ${INIT_OPTS}
EOF
The only thing I didn't get to work so far is freeing the used space (that
find command should do the job, but gives me som error msg).
> Also, a script-made initrd is still
> just a compressed filesystem, easy to deal with, but a script-made
> initramfs (particularly one made by genkernel) is not just a cpio
> archive, it's a series of them separated by some !!!!KERNEL_MAGIC!!!!
> strings in the middle of binary data -- nearly impossible to work with
> using standard tools.
>
> At least, that's been my experience, others may have found the process
> easier.
I just maintain /usr/src/initramfs which contains all the stuff that should
go in, put the name of this directory into the kernel config
(CONFIG_INITRAMFS_SOURCE="/usr/src/initramfs"), build the kernel. That's a
very simple thing to do if you don't need to load any modules from within
initramfs (I just do the evms_activate stuff) and will give you only one
file to deal with.
/usr/src/initramfs itself is filled by a self-constructed script prior to
building a new kernel.
Bye...
Dirk
--
Dirk Heinrichs | Tel: +49 (0)162 234 3408
Configuration Manager | Fax: +49 (0)211 47068 111
Capgemini Deutschland | Mail: [EMAIL PROTECTED]
Hambornerstraße 55 | Web: http://www.capgemini.com
D-40472 Düsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net
pgptrK1F1KQpk.pgp
Description: PGP signature

