カーネルの再構築

Debian LS-QVL

ハックキットが動き始めたので、 次は、デスクトップとして使うためにカーネルの再構築。
何のために LS-QVL をデスクトップに??
デスクトップとして使う(22) まとめ(1)カーネルの再構築 の手順で。

ハックキットをインストールして最初の設定までを済ます

sudo を使えるようにする

カーネル 2.6.31.8 コンパイル環境の準備

コンパイルに必要なパッケージのインストール

一部インストールできていないので、インストール
yasunari@qvl:~$ sudo apt-get install bzip2 make libc6-dev libncurses5-dev uboot-mkimage patch
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version.
make is already the newest version.
Suggested packages:
  bzip2-doc ed diffutils-doc
The following NEW packages will be installed:
  bzip2 libncurses5-dev patch uboot-mkimage
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1796 kB of archives.
After this operation, 7213 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main patch armel 2.6-2 [128 kB]
Get:2 http://ftp.jp.debian.org/debian/ squeeze/main bzip2 armel 1.0.5-6+squeeze1 [50.0 kB]
Get:3 http://ftp.jp.debian.org/debian/ squeeze/main libncurses5-dev armel 5.7+20100313-5 [1607 kB]
Get:4 http://ftp.jp.debian.org/debian/ squeeze/main uboot-mkimage armel 0.4 [11.4 kB]
Fetched 1796 kB in 0s (2906 kB/s)
Selecting previously deselected package patch.
(Reading database ... 14416 files and directories currently installed.)
Unpacking patch (from .../archives/patch_2.6-2_armel.deb) ...
Selecting previously deselected package bzip2.
Unpacking bzip2 (from .../bzip2_1.0.5-6+squeeze1_armel.deb) ...
Selecting previously deselected package libncurses5-dev.
Unpacking libncurses5-dev (from .../libncurses5-dev_5.7+20100313-5_armel.deb) ...
Selecting previously deselected package uboot-mkimage.
Unpacking uboot-mkimage (from .../uboot-mkimage_0.4_armel.deb) ...
Processing triggers for man-db ...
Setting up patch (2.6-2) ...
Setting up bzip2 (1.0.5-6+squeeze1) ...
Setting up libncurses5-dev (5.7+20100313-5) ...
Setting up uboot-mkimage (0.4) ...
!yasunari@qvl:~$

カーネルソースの取得と展開

!yasunari@qvl:~$ sudo mkdir /mnt/src
yasunari@qvl:~$ ls /usr/src/
yasunari@qvl:~$ sudo rmdir /usr/src
yasunari@qvl:~$ sudo ln -s /mnt/src /usr
yasunari@qvl:~$ sudo chgrp yamasita /mnt/src
yasunari@qvl:~$ sudo chmod g+w /mnt/src
yasunari@qvl:~$ cd /usr/src
yasunari@qvl:/usr/src$ wget -O linux-2.6.31.8.tar.bz2 http://buffalo.jp/php/los.php?to=gpl/storage/ls-x/140/linux-2.6.31.8.tar.bz2
--2012-07-01 21:22:47--  http://buffalo.jp/php/los.php?to=gpl/storage/ls-x/140/linux-2.6.31.8.tar.bz2
Resolving buffalo.jp... 202.51.11.200
Connecting to buffalo.jp|202.51.11.200|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://driver.opensource.buffalo.jp/buf-odrv/gpl/storage/ls-x/140/linux-2.6.31.8.tar.bz2 [following]
--2012-07-01 21:22:48--  http://driver.opensource.buffalo.jp/buf-odrv/gpl/storage/ls-x/140/linux-2.6.31.8.tar.bz2
Resolving driver.opensource.buffalo.jp... 125.29.36.141
Connecting to driver.opensource.buffalo.jp|125.29.36.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 96212737 (92M) [application/octet-stream]
Saving to: `linux-2.6.31.8.tar.bz2'

100%[======================================>] 96,212,737  10.6M/s   in 8.7s

2012-07-01 21:22:56 (10.5 MB/s) - `linux-2.6.31.8.tar.bz2' saved [96212737/96212737]

yasunari@qvl:/usr/src$ tar jxvf linux-2.6.31.8.tar.bz2
	:
	:

Makefile の修正

yasunari@qvl:/usr/src$ cd linux-2.6.31.8
yasunari@qvl:/usr/src/linux-2.6.31.8$ mv Makefile{,.orig}
yasunari@qvl:/usr/src/linux-2.6.31.8$ cp Makefile.orig Makefile
yasunari@qvl:/usr/src/linux-2.6.31.8$ vi Makefile
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ diff -u Makefile.orig Makefile
--- Makefile.orig       2010-03-30 01:38:28.000000000 +0900
+++ Makefile    2012-07-01 21:27:29.000000000 +0900
@@ -181,7 +181,7 @@
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 export KBUILD_BUILDHOST := $(SUBARCH)
 ARCH           ?= arm
-CROSS_COMPILE  ?= arm-mv5sft-linux-gnueabi-
+CROSS_COMPILE  ?=

 # Architecture as present in compile.h
 UTS_MACHINE    := $(ARCH)
@@ -617,7 +617,7 @@
 # makefile but the argument can be passed to make if needed.
 #

-INSTALL_MOD_PATH=binaries
+INSTALL_MOD_PATH=
 MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
 export MODLIB

コンパイル

yasunari@qvl:/usr/src/linux-2.6.31.8$ make oldconfig
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ make -j2 uImage
	:
	:
Image Name:   Linux-2.6.31.8
Created:      Sun Jul  1 22:16:36 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2734512 Bytes = 2670.42 kB = 2.61 MB
Load Address: 0x00008000
Entry Point:  0x00008000
  Image arch/arm/boot/uImage is ready
yasunari@qvl:/usr/src/linux-2.6.31.8$
50分ほどで終了
続いてモジュールのコンパイル
yasunari@qvl:/usr/src/linux-2.6.31.8$ make -j2 modules
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ 

インストール

yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo rm -fr /lib/modules/2.6.31.8
[sudo] password for yasunari:
yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo make modules_install
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo mv /boot/uImage.buffalo{,.orig}
yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo cp arch/arm/boot/uImage /boot/uImage.buffalo
yasunari@qvl:/usr/src/linux-2.6.31.8$

リブート

yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo reboot

Broadcast message from root@qvl (pts/0) (Sun Jul  1 22:43:38 2012):

The system is going down for reboot NOW!
yasunari@qvl:/usr/src/linux-2.6.31.8$
こんなの、一発で動くの??

しばらくして、、、

POWER LED が点灯。

telnet してみる。


Linux 2.6.31.8 (x60l.yamasita.jp) (pts/0)

qvl login: yasunari
Password:
Last login: Sun Jul  1 21:19:25 JST 2012 from x60l.yamasita.jp on pts/0
Linux qvl 2.6.31.8 #1 Sun Jul 1 22:16:13 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@qvl:~$ uname -a
Linux qvl 2.6.31.8 #1 Sun Jul 1 22:16:13 JST 2012 armv5tel GNU/Linux
yasunari@qvl:~$
いけた!

カーネルのリコンフィグ

drivers/video/Kconfig の修正

yasunari@qvl:~$ cd /usr/src/linux-2.6.31.8
yasunari@qvl:/usr/src/linux-2.6.31.8$  cd drivers/video
yasunari@qvl:/usr/src/linux-2.6.31.8/drivers/video$ mv Kconfig{,.orig}
yasunari@qvl:/usr/src/linux-2.6.31.8/drivers/video$ cp Kconfig.orig Kconfig
yasunari@qvl:/usr/src/linux-2.6.31.8/drivers/video$ vi Kconfig
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8/drivers/video$ diff -u Kconfig.orig Kconfig
--- Kconfig.orig        2010-07-16 20:23:10.000000000 +0900
+++ Kconfig     2012-07-01 22:47:24.000000000 +0900
@@ -114,7 +114,7 @@
 config FB_CFB_IMAGEBLIT
        tristate
        depends on FB
-       default n
+       default m
        ---help---
          Include the cfb_imageblit function for generic software image
          blitting. This is used by drivers that don't provide their own
@@ -188,6 +188,7 @@
 config FB_DEFERRED_IO
        bool
        depends on FB
+       default y

 config FB_HECUBA
        tristate
yasunari@qvl:/usr/src/linux-2.6.31.8/drivers/video$ cd ../..
yasunari@qvl:/usr/src/linux-2.6.31.8$

make menuconfig

yasunari@qvl:/usr/src/linux-2.6.31.8$ make menuconfig
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ diff -u .config.old .config
--- .config.old 2012-07-01 21:29:02.000000000 +0900
+++ .config     2012-07-01 22:51:42.000000000 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.31.8
-# Sun Jul  1 21:29:02 2012
+# Sun Jul  1 22:51:42 2012
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -960,14 +960,34 @@
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
+CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set

 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
@@ -976,7 +996,11 @@
 #
 # Hardware I/O ports
 #
-# CONFIG_SERIO is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
 # CONFIG_GAMEPORT is not set

 #
@@ -1072,7 +1096,59 @@
 # CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
 # CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+CONFIG_FB_CFB_IMAGEBLIT=m
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_VIRTUAL=m
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_DOVE is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set

 #
@@ -1087,6 +1163,8 @@
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
 # CONFIG_SOUND is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
@@ -1298,7 +1376,31 @@
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_REGULATOR is not set
 # CONFIG_UIO is not set
-# CONFIG_STAGING is not set
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_ET131X is not set
+# CONFIG_ME4000 is not set
+# CONFIG_MEILHAUS is not set
+# CONFIG_USB_IP_COMMON is not set
+# CONFIG_ECHO is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_ALTERA_PCIE_CHDMA is not set
+# CONFIG_INPUT_MIMIO is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_DST is not set
+# CONFIG_POHMELFS is not set
+# CONFIG_B3DFG is not set
+# CONFIG_PLAN9AUTH is not set
+# CONFIG_HECI is not set
+# CONFIG_VT6655 is not set
+# CONFIG_USB_CPC is not set
+CONFIG_FB_UDL=m

 #
 # File systems
yasunari@qvl:/usr/src/linux-2.6.31.8$

コンパイル

yasunari@qvl:/usr/src/linux-2.6.31.8$ make -j2 uImage
	:
	:
Image Name:   Linux-2.6.31.8
Created:      Sun Jul  1 22:55:34 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2782396 Bytes = 2717.18 kB = 2.65 MB
Load Address: 0x00008000
Entry Point:  0x00008000
  Image arch/arm/boot/uImage is ready
yasunari@qvl:/usr/src/linux-2.6.31.8$ make -j2 modules
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$

インストール

yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo make modules_install
	:
	:
yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo cp arch/arm/boot/uImage /boot/uImage.buffalo
yasunari@qvl:/usr/src/linux-2.6.31.8$

リブート

yasunari@qvl:/usr/src/linux-2.6.31.8$ sudo reboot

Broadcast message from root@qvl (pts/0) (Sun Jul  1 23:00:21 2012):

The system is going down for reboot NOW!
yasunari@qvl:/usr/src/linux-2.6.31.8$
リブートを繰り返す物体が出来上がった(藁

LS-QVL
バッファローダイレクト
楽天市場
amazon
ドスパラ
livedoor デパート
Yahoo!ショッピング
バリューモア
ムラウチドットコム


sudo と開発環境のインストール
ハックの記録
LinkStation/玄箱 をハックしよう

LinkStationシリーズ ファームウェア アップデーター Ver.1.60

ツイート Tweet to @yasunari_y @yasunari_yをフォロー

Copyright (C) 2003-2012 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市