70 |
# mount essential filesystems |
# mount essential filesystems |
71 |
mount -t proc proc /proc |
mount -t proc proc /proc |
72 |
mount -t sysfs sysfs /sys |
mount -t sysfs sysfs /sys |
73 |
mount -t tmpfs tmpfs /dev -o rw,mode=0644,size=1024 |
if [[ -z $(grep '[[:space:]]/dev[[:space:]]' /proc/mounts | cut -d ' ' -f2) ]] |
74 |
|
then |
75 |
|
# many video drivers needed exec access |
76 |
|
fstype=ramfs |
77 |
|
# tmpfs was suggested by Greg Kroah-Hartman |
78 |
|
[[ $(grep '[[:space:]]tmpfs' /proc/filesystems | cut -d $'\t' -f2) = tmpfs ]] && fstype=tmpfs |
79 |
|
# mount devtmpfs if supported |
80 |
|
[[ $(grep '[[:space:]]devtmpfs' /proc/filesystems | cut -d $'\t' -f2) = devtmpfs ]] && fstype=devtmpfs |
81 |
|
mount -t ${fstype} dev /dev -o exec,nosuid,mode=0755,size=10M |
82 |
|
fi |
83 |
|
|
84 |
# install all busybox applets |
# install all busybox applets |
85 |
busybox --install -s |
busybox --install -s |
216 |
done |
done |
217 |
mkdir -p initrd proc tmp sys var/tmp dev media |
mkdir -p initrd proc tmp sys var/tmp dev media |
218 |
|
|
219 |
# make /sysroot/dev/console & /mnt/dev/null |
# use devtmpfs if supported |
220 |
[ ! -e /sysroot/dev/console ] && mknod -m 600 /sysroot/dev/console c 5 1 |
if [ "$(grep devtmpfs /proc/filesystems | cut -d$'\t' -f2)" = "devtmpfs" ] |
221 |
[ ! -e /sysroot/dev/null ] && mknod -m 666 /sysroot/dev/null c 1 3 |
then |
222 |
# only to be safe and to have a log channel |
mount -t devtmpfs dev /sysroot/dev |
223 |
[ ! -e /sysroot/dev/tty ] && mknod /sysroot/dev/tty c 5 0 |
else |
224 |
# busybox needs this one |
# make /sysroot/dev/console & /mnt/dev/null |
225 |
[ ! -e /sysroot/dev/tty5 ] && mknod /sysroot/dev/tty5 c 4 5 |
[ ! -e /sysroot/dev/console ] && mknod -m 600 /sysroot/dev/console c 5 1 |
226 |
|
[ ! -e /sysroot/dev/null ] && mknod -m 666 /sysroot/dev/null c 1 3 |
227 |
|
# only to be safe and to have a log channel |
228 |
|
[ ! -e /sysroot/dev/tty ] && mknod /sysroot/dev/tty c 5 0 |
229 |
|
# busybox needs this one |
230 |
|
[ ! -e /sysroot/dev/tty5 ] && mknod /sysroot/dev/tty5 c 4 5 |
231 |
|
fi |
232 |
|
|
233 |
(cd ${CLOOPMOUNTDIR}; cp -a etc root home var /sysroot) |
(cd ${CLOOPMOUNTDIR}; cp -a etc root home var /sysroot) |
234 |
|
|