2009年6月12日金曜日

Gentoo freeze unloading alsa module

gentoo-sources-2.6.29-r5
alsa-utils-1.0.17
の組み合わせで、shutdown すると
unloading alsa module
以降進まなくなる。

http://bugs.gentoo.org/232875
System hangs at shutdown after message "Killing processes using ALSA"

らしい、とりあえず
emerge --unmerge alsa-utils
でもいいけど、音 出なくなるのもアレなので、

/etc/init.d/alsasound に UNLOAD_ON_STOP="no" を書いて回避

2009年6月7日日曜日

initrd.gz をマウントするには ...

kernelが cramfs に対応してる必要がある
- File systems --->
- Miscellaneous filesystems --->
- Compressed ROM file system support (cramfs)
- ROM file system support

その上で、gunzip initrd.gz
mount -o loop initrd /mnt

2009年6月4日木曜日

Debian GNU/Linuxでクロスコンパイル環境を作る(mipsel)

1. aptitude install apt-cross
クロスコンパイル用ライブラリを簡単に作ってくれる

2. サポートしてるアーキテクチャは
dpkg-architecture -L
で確認できる。今回は mipsel

3. アップデート
apt-cross -a mipsel --update

4. gccに必要なライブラリをインストール
apt-cross -a mipsel --install gcc

5. クロスコンパイラの作成に必要なパッケージをインストール
apt-get build-dep binutils
apt-get build-dep gcc-4.3

6. apt-get source binutils
cd binutils-2.18.1
./configure --target=mipsel-linux-gnu --prefix=/usr/mipsel-linux-gnu
make
make install

export PATH=/usr/mipsel-linux-gnu/bin:$PATH

7. gcc
http://ftp.gnu.org/gnu/gcc/gcc-4.3.3/

cd gcc-4.3.3/
./configure --target=mipsel-linux-gnu --prefix=/usr/mipsel-linux-gnu \
--disable-nls --disable-shared --without-headers \
--with-newlib --enable-languages=c
make all-gcc install-gcc


X.
http://www.kernel.org/pub/linux/kernel/v2.6/
tar jxvf linux-2.6.27.24.tar.bz2
make ARCH=mips menuconfig
make ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- vmlinux

qemu-system-mips で動かすなら Machine selection は Malta board を選択する
debian kernelなら Machine selection に qemu が選択できる(2.6.18)

Y. build result
linux-2.6.27 + gcc-4.3.3 + binutils-2.18.1 : ok
linux-2.6.18 + gcc-4.3.3 + binutils-2.18.1 : failed
linux-2.6.18 + gcc-4.3.1 + binutils-2.17.50 : failed

mips in qemu

qemu-system-mips を使ってみる。
を使ってみる。

と言っても、クロスコンパイラ用意できてないし、
とりあえず、test imageで...
http://www.nongnu.org/qemu/download.html
mips-test-0.2.tar.gz の run-qemu にある通り

qemu-system-mips -kernel vmlinux-2.6.18-3-qemu -initrd initrd.gz -append "console=ttyS0 init=/bin/sh" -nographic -m 128 -hda ../hda.img

で、あっさり起動。

qemu: Warning, could not load MIPS bios '/usr/share/qemu/mips_bios.bin'
Linux version 2.6.18-3-qemu (Debian 2.6.18-8) (waldi@debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)) #1 Mon Dec 11 02:18:57 UTC 2006
CPU revision is: 00019300
FPU revision is: 00739300
Determined physical RAM map:
memory: 08000000 @ 00000000 (usable)
Initial ramdisk at: 0x802d7000 (2663940 bytes)
Built 1 zonelists. Total pages: 32768
Kernel command line: rd_start=0x802d7000 rd_size=2663940 console=ttyS0 init=/bin/sh
...

やっぱり、mips_bios.bin が無いって言われてるなぁ。
u-boot をコンパイルすればいいのかな...