2007年10月22日月曜日

using lguest - 1

とりあえずの起動までを、ちょっと jot。
/opt/lguest# dd if=/dev/zero of=FW1.img bs=1 count=1 seek=$((1024 * 1024 * 1024 * 2 - 1))
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.000126002 seconds, 7.9 kB/s
/opt/lguest# ls -l
total 16
-rw-r--r-- 1 root root 2147483648 2007-10-22 20:28 FW1.img
/opt/lguest# mkfs.ext3 FW1.img
mke2fs 1.40-WIP (14-Nov-2006)
FW1.img is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
....snip....
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
/opt/lguest# mkdir tmp
/opt/lguest# mount -t ext3 -o loop FW1.img tmp
/opt/lguest# debootstrap --arch i386 lenny tmp http://ring.asahi-net.or.jp/archives/linux/debian/debian
I: Retrieving Release
....snip....
I: Base system installed successfully.
/opt/lguest# chroot tmp
/# cp /etc/inittab oldtab
/# vi /etc/inittab
....
/# diff -ubB oldtab /etc/inittab
--- oldtab 2007-10-22 11:54:48.000000000 +0000
+++ /etc/inittab 2007-10-22 11:54:12.000000000 +0000
@@ -51,12 +51,12 @@
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
-1:2345:respawn:/sbin/getty 38400 tty1
-2:23:respawn:/sbin/getty 38400 tty2
-3:23:respawn:/sbin/getty 38400 tty3
-4:23:respawn:/sbin/getty 38400 tty4
-5:23:respawn:/sbin/getty 38400 tty5
-6:23:respawn:/sbin/getty 38400 tty6
+1:2345:respawn:/sbin/getty 38400 /dev/hvc0
+#2:23:respawn:/sbin/getty 38400 tty2
+#3:23:respawn:/sbin/getty 38400 tty3
+#4:23:respawn:/sbin/getty 38400 tty4
+#5:23:respawn:/sbin/getty 38400 tty5
+#6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
/# cat >> /etc/securetty

# lguest console
hvc0
/# mknod /dev/hvc0 c 229 0
/# exit
exit
/opt/lguest# umount tmp
/opt/lguest# cd /usr/src/stable/Documentation/lguest/
/usr/src/stable/Documentation/lguest# make
cc -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -Wl,-T,lguest.lds -static lguest.c -lz -o lguest
/usr/src/stable/Documentation/lguest# cp lguest /opt/lguest/
/usr/src/stable/Documentation/lguest# cd !$
cd /opt/lguest/
/opt/lguest# modprobe lg
/opt/lguest# ./lguest 64m /usr/src/stable/vmlinux --block=FW1.img root=/dev/lgba
いや、実のところ、途中途中しくじっているけどね。

0 件のコメント: