yasunari@vl:/mnt/share/src$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.bz2 --2012-03-03 22:40:43-- http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.bz2 Resolving www.kernel.org... 149.20.4.69 Connecting to www.kernel.org|149.20.4.69|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 74739098 (71M) [application/x-bzip2] Saving to: `linux-2.6.38.tar.bz2' 100%[======================================>] 74,739,098 1.51M/s in 42s 2012-03-03 22:41:26 (1.70 MB/s) - `linux-2.6.38.tar.bz2' saved [74739098/74739098] yasunari@vl:/mnt/share/src$ tar jxvf linux-2.6.38.tar.bz2 linux-2.6.38/ linux-2.6.38/.gitignore linux-2.6.38/.mailmap linux-2.6.38/COPYING linux-2.6.38/CREDITS : : linux-2.6.38/virt/kvm/irq_comm.c linux-2.6.38/virt/kvm/kvm_main.c yasunari@vl:/mnt/share/src$
yasunari@vl:/mnt/share/src$ wget http://tyche.pu-toyama.ac.jp/~a-urasim/lsvl/data/kernel-2.6.38-lsvl.patch --2012-03-03 22:48:37-- http://tyche.pu-toyama.ac.jp/~a-urasim/lsvl/data/kernel-2.6.38-lsvl.patch Resolving tyche.pu-toyama.ac.jp... 133.55.114.186 Connecting to tyche.pu-toyama.ac.jp|133.55.114.186|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 5957 (5.8K) [text/plain] Saving to: `kernel-2.6.38-lsvl.patch' 100%[======================================>] 5,957 --.-K/s in 0.04s 2012-03-03 22:48:37 (154 KB/s) - `kernel-2.6.38-lsvl.patch' saved [5957/5957] yasunari@vl:/mnt/share/src$ patch -p0 < kernel-2.6.38-lsvl.patch -bash: patch: command not found yasunari@vl:/mnt/share/src$ su - root Password: root@vl:~# apt-get install patch Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: ed diffutils-doc The following NEW packages will be installed: patch 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 128 kB of archives. After this operation, 258 kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org/debian/ squeeze/main patch armel 2.6-2 [128 kB] Fetched 128 kB in 0s (294 kB/s) Selecting previously deselected package patch. (Reading database ... 15499 files and directories currently installed.) Unpacking patch (from .../archives/patch_2.6-2_armel.deb) ... Processing triggers for man-db ... Setting up patch (2.6-2) ... !root@vl:~# exit logout yasunari@vl:/mnt/share/src$ patch -p0 < kernel-2.6.38-lsvl.patch patching file linux-2.6.38/arch/arm/mach-kirkwood/Kconfig patching file linux-2.6.38/arch/arm/mach-kirkwood/Makefile patching file linux-2.6.38/arch/arm/mach-kirkwood/lsvl-setup.c patching file linux-2.6.38/arch/arm/tools/mach-types yasunari@vl:/mnt/share/src$
yasunari@vl:/mnt/share/src$ cd linux-2.6.38 yasunari@vl:/mnt/share/src/linux-2.6.38$ make kirkwood_defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/kxgettext.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/lex.zconf.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf # # configuration written to .config # yasunari@vl:/mnt/share/src/linux-2.6.38$ cp .config .config.save yasunari@vl:/mnt/share/src/linux-2.6.38$ make menuconfig HOSTCC scripts/kconfig/lxdialog/checklist.o HOSTCC scripts/kconfig/lxdialog/inputbox.o : :上記ページに従って、
yasunari@vl:/mnt/share/src/linux-2.6.38$ make dep scripts/kconfig/conf --silentoldconfig Kconfig *** Warning: make dep is unnecessary now. yasunari@vl:/mnt/share/src/linux-2.6.38$ make uImage CHK include/linux/version.h UPD include/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h Generating include/generated/mach-types.h : :約一時間待ち
Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImage Image Name: Linux-2.6.38-20120304 Created: Sun Mar 4 19:48:12 2012 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2580328 Bytes = 2519.85 kB = 2.46 MB Load Address: 0x00008000 Entry Point: 0x00008000 Image arch/arm/boot/uImage is ready yasunari@vl:/mnt/share/src/linux-2.6.38$ make modules CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CC [M] fs/isofs/namei.o : : CC lib/crc-itu-t.mod.o LD [M] lib/crc-itu-t.ko CC net/core/pktgen.mod.o LD [M] net/core/pktgen.ko yasunari@vl:/mnt/share/src/linux-2.6.38$ここからは、完全独自。
まずは、uImage
root@vl:/mnt/share/src/linux-2.6.38# rm /boot/uImage.buffalo root@vl:/mnt/share/src/linux-2.6.38# cp arch/arm/boot/uImage /boot/uImage.buffalo root@vl:/mnt/share/src/linux-2.6.38#続いてカーネルモジュール。
root@vl:/mnt/share/src/linux-2.6.38# make modules_install INSTALL crypto/pcbc.ko INSTALL drivers/cdrom/cdrom.ko INSTALL drivers/scsi/scsi_wait_scan.ko INSTALL drivers/scsi/sg.ko INSTALL drivers/scsi/sr_mod.ko INSTALL drivers/usb/class/usblp.ko INSTALL fs/isofs/isofs.ko INSTALL fs/udf/udf.ko INSTALL lib/crc-itu-t.ko INSTALL net/core/pktgen.ko DEPMOD 2.6.38-20120304 root@vl:/mnt/share/src/linux-2.6.38# ls -l /lib/modules total 12 drwxr-xr-x 3 root root 4096 Nov 23 19:07 2.6.31.8 drwxr-xr-x 3 yasunari yamasita 4096 Mar 3 10:30 2.6.31.8-20120303-01 drwxr-xr-x 3 root root 4096 Mar 4 20:11 2.6.38-20120304 root@vl:/mnt/share/src/linux-2.6.38#initrd 内のモジュールは、更新いらないだろうという考えでここまで。
Linux 2.6.38-20120304 (x60w.yamasita.jp) (pts/0) vl login: yasunari Password: Last login: Sun Mar 4 18:47:34 JST 2012 from x60w.yamasita.jp on pts/2 Linux vl 2.6.38-20120304 #1 PREEMPT Sun Mar 4 19:46:48 JST 2012 armv5tel 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. yasunari@vl:~$ uname -a Linux vl 2.6.38-20120304 #1 PREEMPT Sun Mar 4 19:46:48 JST 2012 armv5tel GNU/Linux yasunari@vl:~$そういう予防線を張ると、ちゃんと動くの法則
|
← カーネルのコンパイル |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ カーネルのコンパイル(3)3.2.9 |