(1) ソースとパッチの入手
ただし、obs600.dtb と ramdisk.image-cfboot.gz はssd-linuxのものを持ってきます。
なんとなく、Debian環境で2.6.36 をビルドして、2.6.36_obs600 が起動しました。http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.tar.bz2 http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.36.4.bz2 http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.8_for_2.6.36.4.diff.gz http://ftp.plathome.co.jp/pub/ssdlinux/0.5-LATEST/source/src.tgz -rw-rw-r-- 1 root wheel 8761531 Apr 15 01:24 src.tgz #src.tgzから /usr/src/mkdist/kernel/2.6.36/patches -rw-r--r-- 1 root root 0 Oct 28 2010 Makefile.patch -rw-r--r-- 1 root root 22277 Oct 28 2010 arch_powerpc.patch -rw-r--r-- 1 root root 6852 Oct 28 2010 drivers_char.patch -rw-r--r-- 1 root root 477 Oct 28 2010 drivers_net.patch -rw-r--r-- 1 root root 543 Oct 28 2010 drivers_serial.patch -rw-r--r-- 1 root root 494645 Oct 28 2010 drivers_usb.patch -rw-r--r-- 1 root root 678 Oct 28 2010 include_asm_generic.patch -rw-r--r-- 1 root root 3702 Oct 28 2010 include_linux.patch -rw-r--r-- 1 root root 6493 Oct 28 2010 init.patch -rw-r--r-- 1 root root 1390 Oct 28 2010 kernel.patch -rw-r--r-- 1 root root 563 Mar 31 16:32 scripts.patch(2) patchあて
#手でひとつずつpatchあては面倒なのでスクリプトを用意 root@squeeze:src# cat /usr/src/my_2636_patch.sh #! /bin/bash # cd /usr/src # tar jxf /usr/src/dist/distfiles/linux-2.6.36.tar.bz2 # cd linux-2.6.36 # ../my_2636_patch.sh 2>&1 | tee my_2636_patch.log MYCWD=`pwd` if [ "/usr/src/linux-2.6.36" != "${MYCWD}" ]; then echo "Must be /usr/src/linux-2.6.36 (Now=${MYCWD})" exit 0 fi date KPATCH=/usr/src/dist/distfiles/patch-2.6.36.4.bz2 if [ ! -f ${KPATCH} ]; then echo "Not Found ${KPATCH}" exit 0 fi echo "(0) bzip2 -dc ${KPATCH} | patch -p1" bzip2 -dc ${KPATCH} | patch -p1 SPDIR=/usr/src/mkdist/kernel/2.6.36/patches if [ ! -d ${SPDIR} ]; then echo "Not Found DIR ${SPDIR}" exit 0 fi echo "OBS600 Patch START." CUR=1 while read file do ppath="${SPDIR}/${file}" echo -n "($CUR) cat ${ppath} | patch -p1" cat ${ppath} | patch -p1 CUR=`expr $CUR + 1` echo "" done <<EOF arch_powerpc.patch drivers_char.patch drivers_net.patch drivers_serial.patch drivers_usb.patch include_asm_generic.patch include_linux.patch init.patch kernel.patch scripts.patch EOF echo "" date exit 0(3) make uImage
ssd-linux[10]# pwd /usr/src/linux-2.6.36 ssd-linux[11]# cp -p /usr/src/mkdist/kernel/2.6.36/dot.config.powerpc-obs600.ipv6 .config # diff Makefile.org Makefile 4c4 < EXTRAVERSION = .4 --- > EXTRAVERSION = _obs600 ssd-linux[12]# make oldconfig ssd-linux[13]# make uImage ssd-linux[14]# make modules ssd-linux[15]# make modules_install ssd-linux[16]#(4) Debianで mkimage して uImage.initrd を作る
ただし、obs600.dtb と ramdisk.image-cfboot.gz はssd-linuxのものを持ってきます。
cp -p /dsk/sdb1/usr/src/distrib/powerpc-obs600/dtb/obs600.dtb /usr/src/linux-2.6.36 cp -p /dsk/sdb1/usr/src/distrib/powerpc-obs600/cfboot/initrd/ramdisk.image-cfboot.gz /usr/src/linux-2.6.36 # dpkg -S /usr/bin/mkimage u-boot: /usr/bin/mkimage # cd /usr/src/linux-2.6.36 # mkimage -n 20110613_1047-sda1 -A ppc -O linux -T multi -C gzip -d vmlinux.bin.gz:ramdisk.image-cfboot.gz:obs600.dtb uImage.36_20110613 Image Name: 20110613_1047-sda1 Created: Mon Jun 13 10:47:09 2011 Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 2264402 Bytes = 2211.33 kB = 2.16 MB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 1839432 Bytes = 1796.32 kB = 1.75 MB Image 1: 417113 Bytes = 407.34 kB = 0.40 MB Image 2: 7838 Bytes = 7.65 kB = 0.01 MB 新しい uImage.initrd で起動してみる => tftpboot 0x400000 192.168.1.70:uImage.36_20110613 => bootm 0x400000 ## Booting kernel from Legacy Image at 00400000 ... Image Name: 20110613_1047-sda1 Created: 2011-06-13 1:47:09 UTC root@squeeze:〜# uname -a Linux squeeze 2.6.36_obs600 #3 Mon Jun 13 10:35:47 JST 2011 ppc GNU/Linux
細かい調整をしつつ、次回は、無線LANのAP化に挑戦したいです。
--
0 件のコメント:
コメントを投稿