[root@LS410D06E hackkit]# cp hackkit_wheezy_13{0825,1021}.sh [root@LS410D06E hackkit]# vi hackkit_wheezy_131021.sh : : [root@LS410D06E hackkit]# diff -u hackkit_wheezy_13{0825,1021}.sh --- hackkit_wheezy_130825.sh +++ hackkit_wheezy_131021.sh @@ -772,10 +772,15 @@ echo "---- in hackkit init ---" +mount -a + +mkdir /rootfs +mount /dev/sda2 /rootfs +exec /sbin/switch_root /rootfs /sbin/init exit 0 EOF chmod 755 /tmp/root/init - find . -depth -print | $MOUNTPOINT/bin/cpio -ov > /$MOUNTPOINT/boot/initrd + find . | $MOUNTPOINT/bin/cpio -o -H newc > /$MOUNTPOINT/boot/initrd echo gziping $MOUNTPOINT/boot/initrd ... wait 5 minutes gzip $MOUNTPOINT/boot/initrd || exit @@ -884,6 +889,7 @@ 0x0000001A) MACHINE=LS410D INITRD=cpio + ETH=eth1 ;; 0x00003002) [root@LS410D06E hackkit]#init の内容と、cpio アーカイブを作る所と、eth1
[root@LS410D06E ~]#
[root@LS410D06E ~]# date Mon Oct 21 23:19:41 JST 2013 [root@LS410D06E ~]#合ってる
[root@LS410D06E ~]# pushd /mnt/disk1/share/hackkit/ /mnt/disk1/share/hackkit ~ [root@LS410D06E hackkit]# ls -l total 100536 -rwxrw-rw- 1 nobody nogroup 81 Aug 17 11:51 hackkit_config* -rwxrw-rw- 1 nobody nogroup 18746 Oct 20 22:45 hackkit_wheezy_130628.sh* -rwxrw-rw- 1 nobody nogroup 102865354 Jun 28 15:02 hackkit_wheezy_130628.tar.gz* -rwxrw-rw- 1 nobody nogroup 19831 Aug 25 13:52 hackkit_wheezy_130825.sh* -rwxr--r-- 1 root root 19924 Oct 21 23:42 hackkit_wheezy_131021.sh* -rwxr-xr-x 1 root root 15920 Oct 26 2008 mkimage* [root@LS410D06E hackkit]#済
[root@LS410D06E hackkit]# df Filesystem Size Used Available Use% Mounted on udev 10.0M 0 10.0M 0% /dev /dev/sda2 4.7G 836.9M 3.6G 18% / tmpfs 249.0M 76.0K 248.9M 0% /tmp /dev/ram1 15.0M 104.0K 14.9M 1% /mnt/ram /dev/sda1 968.8M 238.2M 730.5M 25% /boot /dev/disk1_6 283.8G 131.5M 283.6G 0% /mnt/disk1 [root@LS410D06E hackkit]#マウントされていない
[root@LS410D06E hackkit]# parted -s /dev/sdb print Model: ViPowER VP-89118(SD1) (scsi) Disk /dev/sdb: 250GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 1024MB 1024MB ext3 primary 2 1024MB 6144MB 5119MB xfs primary 3 6144MB 7168MB 1024MB linux-swap(v1) primary 4 7168MB 250GB 243GB xfs primary [root@LS410D06E hackkit]#そのまま使う。
[root@LS410D06E hackkit]# cat hackkit_config ADDRESS=192.168.2.57 HOSTNAME=ls410d GATEWAY=192.168.2.96 NAMESERVER=192.168.1.5 [root@LS410D06E hackkit]#
[root@LS410D06E hackkit]# sh -x hackkit_wheezy_131021.sh + ADDRESS=192.168.2.47 + NETWORK=192.168.2.0 + NETMASK=255.255.255.0 + BROADCAST=192.168.2.255 + GATEWAY=192.168.2.1 + NAMESERVER=192.168.1.2 + HOSTNAME=hackkit + WORK=/mnt/disk1/share/hackkit + HACKKIT=/mnt/disk1/share/hackkit/hackkit_wheezy_130628.tar.gz + MOUNTPOINT=/mnt/disk1/debinst + cd /mnt/disk1/share/hackkit + '[' -f /mnt/disk1/share/hackkit/hackkit_config ']' + . /mnt/disk1/share/hackkit/hackkit_config ++ ADDRESS=192.168.2.57 ++ HOSTNAME=ls410d ++ GATEWAY=192.168.2.96 ++ NAMESERVER=192.168.1.5 + BOOTPARTITION=/dev/sdb1 + BOOTPARTITIONTYPE=ext3 + ROOTPARTITION=/dev/sdb2 + ROOTPARTITIONTYPE=xfs + SWAPPARTITION=/dev/sdb3 + DATAPARTITION=/dev/sdb4 + ETH=eth0 + RAID=no + LOCALDISK=no + INITRD=loop + '[' '!' -r /mnt/disk1/share/hackkit/hackkit_wheezy_130628.tar.gz ']' + '[' '!' -r /mnt/disk1/share/hackkit/mkimage ']' + '[' '!' -f /proc/buffalo/firmware ']' ++ sed -n -e 's/^PRODUCTID=\(.*\)$/\1/p' /proc/buffalo/firmware + PRODUCTID=0x0000001A + echo PRODUCTID = 0x0000001A PRODUCTID = 0x0000001A + case "$PRODUCTID" in + MACHINE=LS410D + INITRD=cpio + echo MACHINE LS410D MACHINE LS410D + format_disk + '[' no = yes ']' + '[' no = yes ']' + echo formating hard drive ... formating hard drive ... + '[' ext3 = ext3 ']' + mke2fs -j -I 128 /dev/sdb1 mke2fs 1.42.4 (12-June-2012) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 62720 inodes, 249995 blocks 12499 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=260046848 8 block groups 32768 blocks per group, 32768 fragments per group 7840 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Allocating group tables: done Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done + mkfs.xfs -f /dev/sdb2 meta-data=/dev/sdb2 isize=256 agcount=4, agsize=312448 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=1249792, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 + mkswap /dev/sdb3 Setting up swapspace version 1, size = 1000444 KiB no label, UUID=712ec979-bd27-42d4-bb7d-4b0283e6698b + '[' /dev/sdb4 '!=' '' ']' + mkfs.xfs -f /dev/sdb4 meta-data=/dev/sdb4 isize=256 agcount=4, agsize=14824896 blks = sectsz=512 attr=2, projid32bit=0 data = bsize=4096 blocks=59299584, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 log =internal log bsize=4096 blocks=28954, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 + mount_root + '[' no = yes ']' + '[' no = yes ']' + echo mounting root file system ... mounting root file system ... + '[' '!' -d /mnt/disk1/debinst ']' + mkdir /mnt/disk1/debinst + mount -t xfs /dev/sdb2 /mnt/disk1/debinst + '[' no = yes ']' + extract_hackkit + echo extracting hackkit archive ... extracting hackkit archive ... + cd /mnt/disk1/debinst + tar zxvf /mnt/disk1/share/hackkit/hackkit_wheezy_130628.tar.gz ./ ./srv/ ./media/ : : + rm -f /mnt/disk1/debinst/boot/initrd.gz + umount_boot + '[' no = yes ']' + echo unmount /boot ... unmount /boot ... + sync + umount /mnt/disk1/debinst/boot + umount_root + '[' no = yes ']' + cd / + umount /mnt/disk1/debinst [root@LS410D06E hackkit]#速いわ!
yasunari@qube:~$ telnet ls410d Trying 192.168.2.57... telnet: Unable to connect to remote host: No route to host yasunari@qube:~$ telnet ls410d Trying 192.168.2.57... Connected to ls410d.yamasita.jp. Escape character is '^]'. Linux 3.3.4 (qube.yamasita.jp) (pts/0) ls410d login: guest Password: Linux ls410d 3.3.4 #1 Thu Jul 4 22:16:52 JST 2013 armv7l 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@ls410d:~$
竍uest@ls410d:~$ su - root パスワード: root@ls410d:~#
root@ls410d:~# date 2013年 10月 22日 火曜日 08:53:29 JST root@ls410d:~#なんか、9時間狂ってる。怪しい
root@ls410d:~# date 102123552013 2013年 10月 21日 月曜日 23:55:00 JST root@ls410d:~#
root@ls410d:~# tail -f /var/log/messages : : Oct 21 23:55:39 ls410d kernel: usb 1-1: new full-speed USB device number 2 using ehci_marvell Oct 21 23:55:39 ls410d kernel: usb-storage 1-1:1.0: Quirks match for vid 0ea0 pid 6828: 20 Oct 21 23:55:39 ls410d kernel: scsi2 : usb-storage 1-1:1.0 Oct 21 23:55:40 ls410d kernel: scsi 2:0:0:0: Direct-Access BUFFALO ClipDrive 1.88 PQ: 0 ANSI: 2 Oct 21 23:55:40 ls410d kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0 Oct 21 23:55:40 ls410d kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0 Oct 21 23:55:41 ls410d kernel: ready Oct 21 23:55:41 ls410d kernel: sd 2:0:0:0: [sdb] 64000 512-byte logical blocks: (32.7 MB/31.2 MiB) Oct 21 23:55:41 ls410d kernel: sd 2:0:0:0: [sdb] Write Protect is off Oct 21 23:55:41 ls410d kernel: sdb: sdb1 Oct 21 23:55:41 ls410d kernel: sd 2:0:0:0: [sdb] Attached SCSI removable diskOK
Oct 21 23:57:38 ls410d kernel: usb 1-1: new high-speed USB device number 3 using ehci_marvell Oct 21 23:57:38 ls410d kernel: usblp0: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0007OK
root@ls410d:~# shutdown -r now Broadcast message from root@ls410d (pts/0) (Mon Oct 21 23:59:21 2013): The system is going down for reboot NOW! root@ls410d:~#無事、リブートした。
まぁ、OKかな。
|
← 永かった。。。 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ UTC ? |
Copyright (C) 2003-2013 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市