nash vs. bash
fedora-list
fedora-list at thebc.ch
Tue Oct 19 18:51:56 UTC 2004
hello group
i am trying to encrypt my rootdisk with fc3 test3, device-mapper and dm-crypt. for this reason i have to build my own initrd which asks
me for the password/key to encrypt the rootdisk.
now i run in to the problem, that nash isn't capable to get userinput. even if i copy bash to the initrd and call it from nash it doesn't work.
"read: read error: 0: Bad file descriptor"
so i'd like to replace nash with bash at all. but nash is providing some command i don't really understand. does anybody knows the equivalent "bash"-commands of the following commands in nash?
- mkrootdev # ???
- switchroot # same as /sbin/pivot_root . loader && exec
/usr/sbin/chroot . /sbin/init?
- mount # is it really the same as /bin/mount?
i'd like to be as close as possible to the standard fedora initrd to avoid updating problems.
did i miss some documentation? does anybody have done this before?
any suggestions would be really appreciated.
thanx you very much
bernd
--- begin init -------------------------------------------------------
#!/bin/nash
mount -t proc /proc /proc
setquiet
echo Mounted /proc filesystem
echo Mounting sysfs
mount -t sysfs none /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs none /dev
mknod /dev/console c 5 1
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mkdir /dev/pts
mkdir /dev/shm
echo Starting udev
/sbin/udevstart
echo -n "/sbin/hotplug" > /proc/sys/kernel/hotplug
echo "Loading scsi_mod.ko module"
insmod /lib/scsi_mod.ko
echo "Loading sd_mod.ko module"
insmod /lib/sd_mod.ko
echo "Loading BusLogic.ko module"
insmod /lib/BusLogic.ko
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
echo "Loading aes-i586.ko module"
insmod /lib/aes-i586.ko
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-crypt.ko module"
insmod /lib/dm-crypt.ko
echo Creating root device
mkrootdev /dev/root
umount /sys
echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
mount -t tmpfs --bind /dev /sysroot/dev
echo Switching to new root
switchroot /sysroot
umount /initrd/dev
--- end init ---------------------------------------------------------
More information about the test
mailing list