【KURO-SHEEVA】eSATA HDD に debootstrap debian(lenny)を導入

ubuntu は なんとなくしっくりしないので、KURO-SHEEVAのeSATAにHDDを接続して、Debianをインストールすることにしました。まずは、fdisk します。

root@debian:~# fdisk /dev/sda

The number of cylinders for this disk is set to 121601.
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): n
Command action e extended p primary partition (1-4)p
Partition number (1-4): 1
First cylinder (1-121601, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-121537, default 121537): 10
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 1 10 80293+ 83 Linux
Command (m for help): n
Command action e extended p primary partition (1-4)p
Partition number (1-4): 2
First cylinder (11-121601, default 11): 880
Last cylinder, +cylinders or +size{K,M,G} (880-121601, default 121601):
Using default value 121601
Command (m for help): n
Command action e extended p primary partition (1-4)p
Partition number (1-4): 2
First cylinder (11-121601, default 11): 11
Last cylinder, +cylinders or +size{K,M,G} (11-121601, default 121601): 880
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 1 10 80293+ 83 Linux/dev/sda2 11 880 6988275 83 Linux
Command (m for help): n
Command action e extended p primary partition (1-4)p
Partition number (1-4): 3
First cylinder (881-121601, default 881):
Using default value 881
Last cylinder, +cylinders or +size{K,M,G} (881-121601, default 121601): +512M
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 1 10 80293+ 83 Linux/dev/sda2 11 880 6988275 83 Linux/dev/sda3 881 946 530145 83 Linux
Command (m for help): n
Command action e extended p primary partition (1-4)p
Selected partition 4
First cylinder (947-121601, default 947):
Using default value 947Last cylinder, +cylinders or +size{K,M,G} (947-121601, default 121601):Using default value 121601
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 1 10 80293+ 83 Linux/dev/sda2 11 880 6988275 83 Linux/dev/sda3 881 946 530145 83 Linux/dev/sda4 947 121601 969161287+ 83 Linux
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 1 10 80293+ 83 Linux/dev/sda2 11 880 6988275 83 Linux/dev/sda3 881 946 530145 82 Linux swap / Solaris/dev/sda4 947 121601 969161287+ 83 Linux
Command (m for help): aPartition number (1-4): 1
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk identifier: 0x00000000
Device Boot Start End Blocks Id System/dev/sda1 * 1 10 80293+ 83 Linux/dev/sda2 11 880 6988275 83 Linux/dev/sda3 881 946 530145 82 Linux swap / Solaris/dev/sda4 947 121601 969161287+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.Syncing disks.


root@debian:~# mkfs.ext3 /dev/sda1
mke2fs 1.41.4 (27-Jan-2009)Filesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)20080 inodes, 80292 blocks4014 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6737100810 block groups8192 blocks per group, 8192 fragments per group2008 inodes per groupSuperblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729
Writing inode tables: doneCreating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
 
root@debian:~# mkfs.ext3 /dev/sda2
mke2fs 1.41.4 (27-Jan-2009)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)437184 inodes, 1747068 blocks87353 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=179096780854 block groups32768 blocks per group, 32768 fragments per group8096 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.


root@debian:~# mkswap /dev/sda3
Setting up swapspace version 1, size = 530140 KiBno label, UUID=5869f042-4bee-42a9-a457-cb9f91379382


root@debian:~# mkfs.ext3 /dev/sda4
mke2fs 1.41.4 (27-Jan-2009)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)60579840 inodes, 242290321 blocks12114516 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=07395 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848
Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.


root@debian:~# tune2fs -r 200000 /dev/sda2
tune2fs 1.41.4 (27-Jan-2009)Setting reserved blocks count to 200000


root@debian:~# tune2fs -r 2000000 /dev/sda4
tune2fs 1.41.4 (27-Jan-2009)Setting reserved blocks count to 2000000



apt-get install binutils
apt-get update

cd /mnt
sudo mkdir work
cd work
sudo wget http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap-udeb_1.0.10lenny1_all.udeb
sudo ar -x debootstrap-udeb_1.0.10lenny1_all.udeb
cd /
sudo tar xzf /mnt/work/data.tar.gz
sudo /usr/sbin/debootstrap --arch armel lenny /mnt/sda2 http://ftp.jp.debian.org/debian
sudo LANG=C chroot /mnt/sda2 /bin/bash
mount /proc
cd /dev
MAKEDEV generic

/etc/fstab を 編集
/dev/sda2     /               ext3    defaults                 0    1
/dev/sda1     /boot           ext3    ro,nosuid,nodev          0    2
proc /proc proc defaults 0 0

dkpg-reconfigure tzdata
Asia -> Tokyo

/etc/network/interfaces

/etc/resolv.conf の確認

/etc/hostname の確認

/etc/hosts

/etc/apt/sources.list の変更
deb http://ftp.jp.debian.org/debian lenny main
deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

aptitude update
aptitude install locales

dpkg-reconfigure locales

ja_JP.EUC-JP, ja_JP.UTF-8 を追加し、デフォルトは NONE

dpkg-reconfigure tzdata

tasksel install standard

tasksel: aptitude failed (255) <- ??

aptitude clean

/etc/inittab を編集
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

u-boot の設定ですが、まずは、NANDフラッシュからuImageを、sSATAのHDDからrootをロードしています。
setenv mainlineLinux no
setenv bootargs console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/sda2 rw rootdelay=10 ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none
setenv bootcmd 'nand read.e 0x800000 0x100000 0x400000; bootm 0x800000'
 
 

0 件のコメント:

コメントを投稿