root@LS-XHLA1F:~# ls -l /mnt/disk1/share/hackkit/ -rwxrw-rw- 1 nobody nogroup 66409295 Dec 9 23:28 hackkit_081209.tar.gz -rwxrw-rw- 1 nobody nogroup 18691 Dec 14 19:37 hackkit_081214.sh -rwxrw-rw- 1 nobody nogroup 15920 Oct 26 14:46 mkimage -rwxrw-rw- 1 nobody nogroup 1067 Dec 13 09:11 ramroot_081213.sh root@LS-XHLA1F:~#
手順書変えた方がいいな。
root@LS-XHLA1F:~# date Sun Feb 15 20:45:35 JST 2009 root@LS-XHLA1F:~#あっていた。
root@LS-XHLA1F:~# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda2 4989760 330556 4659204 7% / /dev/ram1 15360 140 15220 1% /mnt/ram /dev/sda1 992036 136000 856036 14% /boot /dev/disk1_6 149217988 65556 149152432 0% /mnt/disk1 /dev/usbdisk1_1 984228 17636 916596 2% /mnt/usbdisk1 root@LS-XHLA1F:~# umount /mnt/usbdisk1/ root@LS-XHLA1F:~# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/sda2 4989760 330536 4659224 7% / /dev/ram1 15360 140 15220 1% /mnt/ram /dev/sda1 992036 136000 856036 14% /boot /dev/disk1_6 149217988 65556 149152432 0% /mnt/disk1 root@LS-XHLA1F:~#
root@LS-XHLA1F:~# parted -s /dev/sdb print Model: Hitachi GEC534RF37924E (scsi) Disk /dev/sdb: 500GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 1024MB 1024MB ext3 primary 2 1024MB 6144MB 5120MB xfs primary 3 6144MB 6144MB 512B primary 4 6144MB 6144MB 512B primary 5 6144MB 7168MB 1024MB linux-swap primary 6 7168MB 500GB 493GB xfs primary root@LS-XHLA1F:~#標準ファームのパーティションがあるので、まずは消す。
root@LS-XHLA1F:~# parted -s /dev/sdb rm 6 root@LS-XHLA1F:~# ^6^5 parted -s /dev/sdb rm 5 root@LS-XHLA1F:~# ^5^4 parted -s /dev/sdb rm 4 root@LS-XHLA1F:~# ^4^3 parted -s /dev/sdb rm 3 root@LS-XHLA1F:~# ^3^2 parted -s /dev/sdb rm 2 root@LS-XHLA1F:~# ^2^1 parted -s /dev/sdb rm 1 root@LS-XHLA1F:~# !?print parted -s /dev/sdb print Model: Hitachi GEC534RF37924E (scsi) Disk /dev/sdb: 500GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags root@LS-XHLA1F:~#fdisk でも消す
root@LS-XHLA1F:~# fdisk -l /dev/sdb Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 60802 488386583+ ee EFI GPT root@LS-XHLA1F:~# fdisk /dev/sdb The number of cylinders for this disk is set to 60801. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): d Selected partition 1 Command (m for help): p Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table root@LS-XHLA1F:~# fdisk -l /dev/sdb Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System root@LS-XHLA1F:~#完全に消えたので、ここからは構築
ディスクラベルを書く
root@LS-XHLA1F:~# parted -s /dev/sdb mklabel gpt root@LS-XHLA1F:~#/boot を作る
root@LS-XHLA1F:~# parted -s /dev/sdb mkpart primary ext3 17.4kB 1024M root@LS-XHLA1F:~#続いて /。5GB
root@LS-XHLA1F:~# parted -s /dev/sdb mkpart primary xfs 1024MB 6144MB root@LS-XHLA1F:~#ダミーは作らず、続いて swap。1GB も要らないんだけど。。。
root@LS-XHLA1F:~# parted -s /dev/sdb mkpart primary linux-swap 6144MB 7168MB root@LS-XHLA1F:~#続いて /mnt。残り全部
root@LS-XHLA1F:~# parted -s /dev/sdb mkpart primary xfs 7168MB 500GB root@LS-XHLA1F:~#
まずはコピー
root@LS-XHLA1F:~# cd /mnt/disk1/share/hackkit/ root@LS-XHLA1F:/mnt/disk1/share/hackkit# cp hackkit_081214.sh hackkit_090215.sh root@LS-XHLA1F:/mnt/disk1/share/hackkit#カスタマイズ + LS-XHL 対応
root@LS-XHLA1F:/mnt/disk1/share/hackkit# vi hackkit_090215.sh : : root@LS-XHLA1F:/mnt/disk1/share/hackkit#diff をとろうとしたら、、、
root@LS-XHLA1F:/mnt/disk1/share/hackkit# diff -c hackkit_081214.sh hackkit_090215.sh diff: invalid option -- c BusyBox v1.7.0 (2007-10-15 19:49:46 IST) multi-call binary Usage: diff [-abdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2 Compare files line by line and output the differences between them. This diff implementation only supports unified diffs. Options: -a Treat all files as text -b Ignore changes in the amount of whitespace -d Try hard to find a smaller set of changes -i Ignore case differences -L Use LABEL instead of the filename in the unified header -N Treat absent files as empty -q Output only whether files differ -r Recursively compare subdirectories -S Start with FILE when comparing directories -T Make tabs line up by prefixing a tab when necessary -s Report when two files are the same -t Expand tabs to spaces in output -U Output LINES lines of context -w Ignore all whitespace root@LS-XHLA1F:/mnt/disk1/share/hackkit# diff hackkit_081214.sh hackkit_090215.sh Binary files hackkit_081214.sh and hackkit_090215.sh differ root@LS-XHLA1F:/mnt/disk1/share/hackkit# LANG=ja_JP.eucJP root@LS-XHLA1F:/mnt/disk1/share/hackkit# export LANG root@LS-XHLA1F:/mnt/disk1/share/hackkit# !diff diff hackkit_081214.sh hackkit_090215.sh Binary files hackkit_081214.sh and hackkit_090215.sh differ root@LS-XHLA1F:/mnt/disk1/share/hackkit#あかんか。
LS-GL に戻して diff
yasunari@ude:/home/linkstation/HackKit/unified$ diff -c hackkit_081214.sh hackkit_090215.sh *** hackkit_081214.sh Sun Dec 14 19:37:16 2008 --- hackkit_090215.sh Sun Feb 15 21:00:54 2009 *************** *** 4,16 **** # Copyright (C) Yasunari YAMASHITA. All Rights Reserved. # ! 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=$WORK/hackkit_081209.tar.gz --- 4,16 ---- # Copyright (C) Yasunari YAMASHITA. All Rights Reserved. # ! ADDRESS=192.168.2.49 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=brick WORK=/mnt/disk1/share/hackkit HACKKIT=$WORK/hackkit_081209.tar.gz *************** *** 30,38 **** # /boot if [ "$BOOTPARTITIONTYPE" = ext3 ] then ! mke2fs -j $BOOTPARTITION || exit else ! mke2fs $BOOTPARTITION || exit fi # / --- 30,38 ---- # /boot if [ "$BOOTPARTITIONTYPE" = ext3 ] then ! mke2fs -j -I 128 $BOOTPARTITION || exit else ! mke2fs -I 128 $BOOTPARTITION || exit fi # / *************** *** 831,836 **** --- 831,878 ---- # /boot のアンマウント umount_boot ;; + 0x00000011) + MACHINE=LSXHL + + # 各パーティションのフォーマット(LS-WSGL 以外) + format_disk + # / のマウント + mount_root + # アーカイブの展開 + extract_hackkit + # fstab の修正(LS-WSGL のみ) + #create_fstab + # miconapl のコピー(LS-GL/HS-DHGLのみ) + #copy_miconapl + # LED コントロールスクリプトの作成 + create_miconapl + # Fan コントロールスクリプトの作成(LS-GL/HS-DHGLのみ) + # create_fancontrol + # 電源 SW による電源 OFF 対応 + create_kernelmon + # カーネルモジュールのコピー(LS-WSGL 以外) + copy_modules + # カーネルモジュールのロードスクリプトの作成 + create_usb + + # ネットワークのセットアップ + network_interfaces + resolv_conf + hosts + hostname + + # / のアンマウント + umount_root + + # /boot のマウント + mount_boot + # /boot のコピー(LS-WSGL 以外) + copy_boot + # initrd の編集 + edit_initrd + # /boot のアンマウント + umount_boot + ;; 0x00003002) MACHINE=LSWSGL yasunari@ude:/home/linkstation/HackKit/unified$ホスト名は、当然 brick(レンガ)
root@LS-XHLA1F:/mnt/disk1/share/hackkit# sh hackkit_090215.sh PRODUCTID = 0x00000011 formating hard drive ... mke2fs 1.40.5 (27-Jan-2008) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 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 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. meta-data=/dev/sdb2 isize=256 agcount=8, agsize=156250 blks = sectsz=512 attr=0 data = bsize=4096 blocks=1250000, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=2560, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 Setting up swapspace version 1, size = 1023995904 bytes meta-data=/dev/sdb4 isize=256 agcount=16, agsize=7521665 blks = sectsz=512 attr=0 data = bsize=4096 blocks=120346640, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 mounting root file system ... extracting hackkit archive ... ./ ./var/ ./var/lib/ ./var/lib/apt/ ./var/lib/apt/lists/ ./var/lib/apt/lists/partial/ ./var/lib/apt/lists/ftp.jp.debian.org_debian_dists_lenny_Release ./var/lib/apt/lists/ftp.jp.debian.org_debian_dists_lenny_main_binary-armel_Packages : : ./sbin/ip ./sbin/fsck.xfs ./sbin/mkfs.xfs ./sbin/xfs_repair ./tmp/ ./sys/ ./selinux/ ./srv/ ./opt/ ./media/ ./initrd/ creating miconapl ... creating kernelmon ... copying /lib/modules ... lib/modules/ lib/modules/2.6.22.18/ lib/modules/2.6.22.18/modules.ieee1394map : : lib/modules/2.6.22.18/modules.symbols lib/modules/2.6.22.18/modules.seriomap creating usb ... checking /dev/sdb1 fsck 1.40.5 (27-Jan-2008) e2fsck 1.40.5 (27-Jan-2008) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 11/62720 files (9.1% non-contiguous), 6399/249995 blocks mounting /boot ... copying /boot ... initrd.buffalo uImage.buffalo editing initrd ... 133156+1 records in 133156+1 records out gunziping /mnt/debinst/boot/initrd.gz ... gziping /mnt/debinst/boot/initrd ... wait 5 minutes Image Name: initrd Created: Sun Feb 15 21:10:23 2009 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 8471945 Bytes = 8273.38 kB = 8.08 MB Load Address: 0x00000000 Entry Point: 0x00000000 unmount /boot ... root@LS-XHLA1F:/mnt/disk1/share/hackkit#とりあえず、インストールできることはできた
いけたか?
yasunari@ude:~$ telnet brick.yamasita.jp Trying 192.168.2.49... telnet: Unable to connect to remote host: No route to host yasunari@ude:~$やっぱり、そう簡単にはいかない。
シリアルコンソール、ああシリアルコンソール、コンソール。字余り
|
← まだまだ試行錯誤 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 動いているハックキット |