lenny + armel のハックキットの修正

Debian LS-CL

lenny + armel のハックキットを作ってインストールしてみたけれど 起動の途中で止まってしまった。

さて、、、

getty ?

そーいえば、シリアルコンソールで getty 動かしたかぁ???No!

シリアルコンソールに login が出ていないだけで、 実は動いていたりして。

telnet してみる

yasunari@sil:~$ telnet tate
Trying 192.168.2.47...
Connected to tate.
Escape character is '^]'.
Debian GNU/Linux lenny/sid
hackkit login: guest
Password:
Last login: Thu Jan  1 09:02:17 JST 1970 from uxl.yamasita.jp on pts/0
Linux hackkit 2.6.22.7 #334 Tue Sep 30 22:14:38 JST 2008 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
guest@hackkit:~$ uname -a
Linux hackkit 2.6.22.7 #334 Tue Sep 30 22:14:38 JST 2008 armv5tejl GNU/Linux
guest@hackkit:~$ cat /etc/debian_version
lenny/sid
guest@hackkit:~$
動いてるやん!

inittab の修正

getty は inittab で起動する。
まずは確認のために動いている HDD の中を書き換える。
guest@hackkit:~$ su - root
Password:
hackkit:~# cd /etc
hackkit:/etc# mv inittab inittab.orig
hackkit:/etc# cp inittab.orig inittab
hackkit:/etc# ls -l inittab
-rw-r--r-- 1 root root 2008 Jan  1 09:13 inittab
hackkit:/etc# ls -l inittab*
-rw-r--r-- 1 root root 2008 Jan  1 09:13 inittab
-rw-r--r-- 1 root root 2008 Aug 12  2008 inittab.orig
hackkit:/etc# vi inittab
	:
	:
hackkit:/etc# diff -c inittab.orig inittab
*** inittab.orig        Tue Aug 12 23:25:30 2008
--- inittab     Thu Jan  1 09:15:17 1970
***************
*** 51,67 ****
  # 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

  # Example how to put a getty on a serial line (for a terminal)
  #
  #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
  #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

  # Example how to put a getty on a modem line.
  #
--- 51,68 ----
  # 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

  # Example how to put a getty on a serial line (for a terminal)
  #
  #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
  #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
+ T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100

  # Example how to put a getty on a modem line.
  #
hackkit:/etc#

再起動

Starting internet superserver: inetd.
Starting periodic command scheduler: crond.

Debian GNU/Linux lenny/sid hackkit ttyS0

hackkit login: root
Password:
Linux hackkit 2.6.22.7 #334 Tue Sep 30 22:14:38 JST 2008 armv5tejl

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
hackkit:~#
今度は、login が出てきて、ログインもできた。

エラー潰し:モジュール

insmod: can't read '/lib/modules/*/kernel/drivers/usb/core/usbcore.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/drivers/usb/host/ehci-hcd.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/drivers/usb/host/ohci-hcd.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/drivers/usb/host/uhci-hcd.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/drivers/usb/storage/usb-storage.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/drivers/usb/class/usblp.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/fs/fat/fat.ko': No such file or directory
insmod: can't read '/lib/modules/*/kernel/fs/vfat/vfat.ko': No such file or directory
なんで No such file or directory なのかはさておき、、、、

そもそもジェイルって要るんだろうか?

OABI と EABI との非互換を回避するために、 EABI の標準ファームの一部をジェイルとして /usr/local/buffalo に置いていたけど、 EABI の debian が動くようになったのだからジェイルは要らないのでは?

試しにモジュールの操作をしてみる。

hackkit:~# lsmod
Module                  Size  Used by
hackkit:~# insmod /usr/local/buffalo/lib/modules/2.6.22.7/kernel/drivers/usb/core/usbcore.ko
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
hackkit:~# lsmod
Module                  Size  Used by
usbcore               129500  0
hackkit:~# rmmod usbcore
usbcore: deregistering device driver usb
usbcore: deregistering interface driver usbfs
usbcore: deregistering interface driver hub
hackkit:~#
ジェイルに chroot しなくても insmod/lsmod/rmmod できている。

カーネルモジュールを移動する。

hackkit:~# (cd /usr/local/buffalo/; tar cf - lib/modules )|(cd / ; tar xvf -)
lib/modules/
lib/modules/2.6.22.7/
lib/modules/2.6.22.7/modules.ieee1394map
	:
	:
hackkit:~#
/etc/init.d/usb を chroot しないように修正する。
hackkit:/etc/init.d# diff -c usb.orig usb
*** usb.orig    Fri Nov 21 21:35:56 2008
--- usb Thu Jan  1 09:19:59 1970
***************
*** 3,16 ****
  case "$1" in
    start)
        echo on > /proc/buffalo/gpio/power_control/usb0
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/core/usbcore.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/ehci-hcd.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/ohci-hcd.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/host/uhci-hcd.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/storage/usb-storage.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/drivers/usb/class/usblp.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/fs/fat/fat.ko
!       chroot /usr/local/buffalo insmod /lib/modules/*/kernel/fs/vfat/vfat.ko
        ;;
    stop)
        chroot /usr/local/buffalo rmmod vfat.ko
--- 3,16 ----
  case "$1" in
    start)
        echo on > /proc/buffalo/gpio/power_control/usb0
!       insmod /lib/modules/*/kernel/drivers/usb/core/usbcore.ko
!       insmod /lib/modules/*/kernel/drivers/usb/host/ehci-hcd.ko
!       insmod /lib/modules/*/kernel/drivers/usb/host/ohci-hcd.ko
!       insmod /lib/modules/*/kernel/drivers/usb/host/uhci-hcd.ko
!       insmod /lib/modules/*/kernel/drivers/usb/storage/usb-storage.ko
!       insmod /lib/modules/*/kernel/drivers/usb/class/usblp.ko
!       insmod /lib/modules/*/kernel/fs/fat/fat.ko
!       insmod /lib/modules/*/kernel/fs/vfat/vfat.ko
        ;;
    stop)
        chroot /usr/local/buffalo rmmod vfat.ko
hackkit:/etc/init.d#
これですんなり起動するのでは?

再起動

umount: cannot open /proc/mounts
XFS mounting filesystem sda2
VFS: Mounted root (xfs filesystem).
Trying to move old root to /initrd ... /initrd does not exist. Ignored.
Unmounting old root
Trying to free ramdisk memory ... okay
Freeing init memory: 120K
INIT: version 2.86 booting
Setting the system clock.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Unable to set System Clock to: Thu Jan 1 09:00:08 JST 1970 (warning).
Activating swap...Adding 257032k swap on /dev/sda3.  Priority:-1 extents:1 across:257032k
done.
Setting the system clock.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Unable to set System Clock to: Thu Jan 1 09:00:09 JST 1970 (warning).
Cleaning up ifupdown....
Loading kernel modules...done.
Checking file systems...fsck 1.41.3 (12-Oct-2008)
fsck: cannot check /dev/sda4: fsck.xfs not found
/dev/sda1: Superblock last write time is in the future.  FIXED.
/dev/sda1: clean, 13/50200 files, 20978/200780 blocks
done.
Setting kernel variables (/etc/sysctl.conf)...done.
Mounting local filesystems...kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
XFS mounting filesystem sda4
done.
Activating swapfile swap...done.
Setting up networking....
Configuring network interfaces...eth reg(9) val=0x0300
eth0: link down
done.
INIT: Entering runlevel: 2
Starting enhanced syslogd: rsyslogd.
eth0: link up, full duplex, speed 1 Gbps
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
ehci_marvell ehci_marvell.4523: Marvell Orion EHCI
ehci_marvell ehci_marvell.4523: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.4523: irq 17, io base 0xf1050100
ehci_marvell ehci_marvell.4523: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ehci_marvell ehci_marvell.167817: Marvell Orion EHCI
ehci_marvell ehci_marvell.167817: new USB bus registered, assigned bus number 2
ehci_marvell ehci_marvell.167817: irq 12, io base 0xf10a0100
ehci_marvell ehci_marvell.167817: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Starting internet superserver: inetd.
Starting periodic command scheduler: crond.

Debian GNU/Linux lenny/sid hackkit ttyS0

hackkit login:
モジュール関連のエラーが消えた。

あとは、、、、

umount: cannot open /proc/mounts
initrd の中で umount -a しているのを削れば良さそう。

Trying to move old root to /initrd ... /initrd does not exist. Ignored.
/initrd を作れば消えそう。
hackkit:~# mkdir /initrd
hackkit:~#
あとは、、、

電源 SW で電源が落ちない

電源 SW を OFF にしてみたが、落ちない。
/etc/init.d/kernelmon で /proc/buffalo/gpio/switch/sw_control に on を書くのを忘れている。
/etc/init.d/kernelmon で /proc/buffalo/gpio/switch/sw_control に on を書き、 電源 SW を OFF にすれば電源が落ちた。

USB デバイスの確認

USB メモリを刺してみた。
Jan  1 09:00:49 hackkit kernel: usb 1-1: new high speed USB device using ehci_marvell and address 2
Jan  1 09:00:49 hackkit kernel: usb 1-1: configuration #1 chosen from 1 choice
Jan  1 09:00:49 hackkit kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Jan  1 09:00:54 hackkit kernel: scsi 2:0:0:0: Direct-Access     BUFFALO  ClipDrive        2.00 PQ: 0 ANSI: 2
Jan  1 09:00:55 hackkit kernel: ready
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: [sdb] 256000 512-byte hardware sectors (131 MB)
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: [sdb] Write Protect is off
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: [sdb] 256000 512-byte hardware sectors (131 MB)
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: [sdb] Write Protect is off
Jan  1 09:00:55 hackkit kernel: sdb: sdb1
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: [sdb] Attached SCSI removable disk
Jan  1 09:00:55 hackkit kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
抜いてみた。
Jan  1 09:01:21 hackkit kernel: usb 1-1: USB disconnect, address 2
OK.

USB プリンタを刺してみた。

Jan  1 09:02:09 hackkit kernel: usb 1-1: new full speed USB device using ehci_marvell and address 3
Jan  1 09:02:09 hackkit kernel: usb 1-1: configuration #1 chosen from 1 choice
Jan  1 09:02:09 hackkit kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005
Jan  1 09:02:24 hackkit kernel: usb 1-1: USB disconnect, address 3
抜いてみた。
Jan  1 09:02:24 hackkit kernel: drivers/usb/class/usblp.c: usblp0: removed
USB デバイスは、いけてそう。

あとは、、、

あとはアーカイブとインストーラの修正か。。。。

LS-CL
バッファローダイレクト
楽天市場
amazon


lenny + armel のハックキットで起動
ハックの記録
LinkStation/玄箱 をハックしよう

玄箱x4

Copyright (C) 2003-2009 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市