디스켓 한장으로 구현하는 리눅스
아래의 내용은 스크립트입니다.
**start
umount /mnt
dd if=/dev/zero of=/dev/loop bs=1k count=32768
mke2fs -m 0 -i 2000 -F /dev/loop
mount -o loop -t ext2 /dev/loop /mnt
cp -dpR ./bin /mnt
cp -dpR ./lib /mnt
cp -dpR ./etc /mnt
mkdir -p /root /mnt/proc /mnt/dev /mnt/mnt/cdrom /mnt/tmp
cd .. && cd mnt && ln -sf bin sbin && cd ..
cp -adpR /dev/tty[0-6] /mnt/dev
cp -adpR /dev/console /mnt/dev
cp -adpR /dev/fd[0-6] /mnt/dev
cp -adpR /dev/ram[0-3] /mnt/dev
cp -adpR /dev/hdc /mnt/dev
cp -adpR /dev/zero /mnt/dev
cp -adpR /dev/fb* /mnt/dev
cp -adpR /dev/cdrom /mnt/dev
cp -adpR /dev/zero /mnt/dev
cp -adpR /dev/null /mnt/dev
cp -adpR /dev/loop[0-3] /mnt/dev
cp -adpR /dev/mem /mnt/dev
cp -adpR /dev/input /mnt/dev
cp -adpR /dev/mouse /mnt/dev
cp -adpR /dev/psaux /mnt/dev
cp -adpR /dev/kmem /mnt/dev
**end
ldconfig -r /mnt
umount /mnt
dd if=/dev/loop bs=1k count=32768 | gzip -v9 > /routedisk/initrd.img
/bin
total 205
drwxr-xr-x 2 508 1001 408 Sep 16 03:15 .
drwxr-xr-x 8 508 1001 384 Sep 16 03:14 ..
-rwxr-xr-x 1 508 1001 94364 Jun 24 2001 ash
-rwxr-xr-x 1 508 1001 44060 Aug 11 16:37 busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 cat -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 cp -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 echo -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 ifconfig -> /bin/busybox
-rwxr-xr-x 1 508 1001 26920 Mar 14 2002 init
lrwxrwxrwx 1 root root 12 Aug 12 16:33 ls -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 mount -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 ping -> /bin/busybox
lrwxrwxrwx 1 root root 12 Aug 12 16:33 route -> /bin/busybox
lrwxrwxrwx 1 root root 8 Aug 12 16:33 sh -> /bin/ash
lrwxrwxrwx 1 root root 12 Aug 12 16:33 umount -> /bin/busybox
/lib
ld-2.1.2.so
libc-2.1.2.so
/etc
total 109
drwxr-xr-x 2 508 1001 232 Sep 16 03:17 .
drwxr-xr-x 8 508 1001 384 Sep 16 03:14 ..
-rw-r--r-- 1 508 1001 148 Aug 2 07:02 fstab
-rw-r--r-- 1 508 1001 201 Aug 11 06:47 inittab
-rw-r--r-- 1 508 1001 89989 May 31 18:14 ld.so.cache
-rw-r--r-- 1 508 1001 152 May 31 18:14 ld.so.conf
-rw-r--r-- 1 508 1001 37 Jul 10 17:04 mtab
-rwxr-xr-x 1 508 1001 478 Aug 14 04:10 rc
mtab #########
none /proc proc rw 0 0
fstab ########
/dev/ram / ext2 defaults 0 0
none /proc proc defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 ro 0 0
inittab ##########
id:3:initdefault:
si::sysinit:/etc/rc
sh:123:respawn:/bin/sh < /dev/console > /dev/console 2> /dev/console
l0:0:wait:/usr/bin/reboot -f
l6:6:wait:/usr/bin/reboot -f
ca::ctrlaltdel:/usr/bin/reboot -f
rc
#!/bin/sh
#echo Set the path
export PATH=/bin:/usr/bin:/usr/lib:/usr/etc:/usr/local
#echo proc
mount -t proc /proc /proc
# Remount the root filesystem read-write.
mount -n -o remount,rw / > /dev/null 2> /dev/null
# Clear mtab
>/etc/mtab
카페 게시글
[자유게시판]
Re:램디스크....
다음검색