玄芝のカーネルを2.6.35にアップグレード(2)

この記事は2年以上前に書いたものです。
そのため情報が古い可能性があります。ご了承ください。m(_ _)m

玄芝のカーネルを2.6.35にアップグレードの続き。

2. ビルド

メインラインのカーネルが、に対応しているそうなので、www.kernel.orgからソース取得。

cross_compile_123 cross_compile_125 cross_compile_126 cross_compile_127

 

公開キー取得した後、署名チェック。 (一応)

$ gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E
$ gpg --verify linux-2.6.35.tar.bz2.sign

cross_compile_128 cross_compile_129

http://sheeva.with-linux.com/sheeva/からパッチ+configファイルを落としてくる。2.6.35用のは無いので、2.6.34.2用のを。

cross_compile_131 cross_compile_132 cross_compile_133 cross_compile_134 cross_compile_135

落としてきたパッチの内、

  • 0001-Kirkwood-Marvell-GuruPlug-support-2.6.34.patch
  • 0002-Driver-for-Marvell-Libertas-8688-SDIO-micro-AP-suppo.patch
  • 0003-Initial-defconfig.patch

は、GuruPlug用?っぽいので、ほっとく。

  • -2.6.29-usb-serial-evdo.patch

を当てると、2カ所NG。だったので、手パッチ。

$ patch -p0 < ../linux-2.6.29-usb-serial-evdo.patch
patching file ./drivers/usb/serial/usb-serial.c
Hunk #1 succeeded at 61 (offset 2 lines).
Hunk #2 FAILED at 844.
Hunk #3 FAILED at 868.
Hunk #4 succeeded at 994 (offset 100 lines).
Hunk #5 succeeded at 1027 (offset 100 lines).
Hunk #6 succeeded at 1389 (offset 113 lines).
2 out of 6 hunks FAILED -- saving rejects to file ./drivers/usb/serial/usb-serial.c.rej

手パッチしたのをdiff取ると↓。正しいかどうかは不明。。

$ diff -c usb-serial.c.orig usb-serial.c
*** usb-serial.c.orig   2010-08-02 07:11:14.000000000 +0900
--- usb-serial.c        2010-08-06 13:57:28.130235255 +0900
***************
*** 61,66 ****
--- 61,69 ----
     drivers depend on it.
  */

+ static ushort maxRSize __read_mostly = 0;
+ static ushort maxWSize __read_mostly = 0;
+ static ushort maxISize __read_mostly = 0;
  static int debug;
  /* initially all NULL */
  static struct usb_serial *serial_table[SERIAL_TTY_MINORS];
***************
*** 913,918 ****
--- 916,923 ----
                buffer_size = serial->type->bulk_in_size;
                if (!buffer_size)
                        buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+               if (buffer_size < maxRSize)
+                       buffer_size = maxRSize;
                port->bulk_in_size = buffer_size;
                port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
                port->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
***************
*** 943,948 ****
--- 948,955 ----
                buffer_size = serial->type->bulk_out_size;
                if (!buffer_size)
                        buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+               if (buffer_size < maxWSize)
+                       buffer_size = maxWSize;
                port->bulk_out_size = buffer_size;
                port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
                port->bulk_out_buffer = kmalloc(buffer_size, GFP_KERNEL);
***************
*** 991,996 ****
--- 998,1005 ----
                                goto probe_error;
                        }
                        buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                       if (buffer_size < maxISize)
+                               buffer_size = maxISize;
                        port->interrupt_in_endpointAddress =
                                                endpoint->bEndpointAddress;
                        port->interrupt_in_buffer = kmalloc(buffer_size,
***************
*** 1022,1027 ****
--- 1031,1038 ----
                                goto probe_error;
                        }
                        buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
+                       if (buffer_size < maxISize)
+                               buffer_size = maxISize;
                        port->interrupt_out_size = buffer_size;
                        port->interrupt_out_endpointAddress =
                                                endpoint->bEndpointAddress;
***************
*** 1382,1384 ****
--- 1393,1401 ----

  module_param(debug, bool, S_IRUGO | S_IWUSR);
  MODULE_PARM_DESC(debug, "Debug enabled or not");
+ module_param(maxRSize, ushort, 0);
+ MODULE_PARM_DESC(maxRSize, "User specified USB input buffer size");
+ module_param(maxWSize, ushort, 0);
+ MODULE_PARM_DESC(maxWSize, "User specified USB output buffer size");
+ module_param(maxISize, ushort, 0);
+ MODULE_PARM_DESC(maxISize, "User specified USB interrupt buffer size");
  • mvsdio-1-2.6.30.patch
  • mvsdio-2.patch

この2つのパッチ(udelay入れるパッチ)は普通に適用できた。

configファイルをリネーム。

$ cp sheeva-2.6.34.2.config linux-2.6.35/.config
$ cd linux-2.6.35
$ vi .config

CONFIG_SATA_MV=m
をm から yへ変更しておく。
あとで、libncurses-dev, uboot-mkimage, tftpdが必要になるので、インストールしておく。

$ LANG=C sudo aptitude install libncurses-dev uboot-mkimage tftpd-hpa
$ ln -s /var/lib/tftpboot ~/tftpboot
$ sudo chmod a+w ~/tftpboot

準備が整ったのでので、カーネルビルドを。順番は↓こんな感じで。

  1. make menuconfig
  2. make
  3. make uImage
  4. make modules
  5. make modules_install
user@kurosheeva-dev:~/src/linux-2.6.35$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

何もせず「Save an Alternate Configuration File」で保存。そのあと、

user@kurosheeva-dev:~/src/linux-2.6.35$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
user@kurosheeva-dev:~/src/linux-2.6.35$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage<br>user@kurosheeva-dev:~/src/linux-2.6.35$ cp cp arch/arm/boot/uImage ~/tftpboot/
user@kurosheeva-dev:~/src/linux-2.6.35$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules<br>user@kurosheeva-dev:~/src/linux-2.6.35$ make ARCH=arm INSTALL_MOD_PATH=~/tftpboot CROSS_COMPILE=arm-none-linux-gnueabi- modules_install
  INSTALL crypto/ansi_cprng.ko
  INSTALL crypto/anubis.ko
  INSTALL crypto/async_tx/async_memcpy.ko
・・・
  INSTALL /home/user/tftpboot/lib/firmware/edgeport/down2.fw
  INSTALL /home/user/tftpboot/lib/firmware/edgeport/down3.bin
  INSTALL /home/user/tftpboot/lib/firmware/whiteheat_loader.fw
  INSTALL /home/user/tftpboot/lib/firmware/whiteheat.fw
  MKDIR   /home/user/tftpboot/lib/firmware/keyspan_pda
  INSTALL /home/user/tftpboot/lib/firmware/keyspan_pda/keyspan_pda.fw
  INSTALL /home/user/tftpboot/lib/firmware/keyspan_pda/xircom_pgs.fw
  DEPMOD  2.6.35

エラーがなければ成功。
~/tftpboot 配下に、uImageとlibが出来ているはず。

user@kurosheeva-dev:~$ ls -alrt tftpboot/
 2792
drwxr-xr-x 35 root root       4096 2010-08-06 15:05 ..
drwxr-xr-x  4 user user       4096 2010-08-06 16:00 lib
drwxrwxrwx  3 root nogroup    4096 2010-08-06 16:02 .
-rw-r--r--  1 user user    2844560 2010-08-06 16:02 uImage

続く?

カテゴリー: KURO-SHEEVA タグ: , , パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です