华清远见(深圳) 1102期 pclli
交叉编译器 arm-linux-gcc 4.4.3
内核:linux 2.6.35
busybox 1.18.4
1、配置内核Makefile
make menuconfig
General setup ---->
Configure standard kernel features (for small systems) ---->
[*] load all symbols for debugging/ksymoops
[*] Include all symbols in kallsyms
[*] Support for hot-pluggable devices
[*] Enable support for printk
make uImage
cp arch/arm/boot/uImage /tftpboot/uIamge
2、配置busybox Makefile
make menuconfig
Linux System Utilities ---->
[*] mdev
[*] Support /etc/mdev.conf
[*] Support subdirs/symlinks
[*] Support regular expressions substitutions when renaming device
[*] Support command execution at device addition/removal
[*] Support loading of firmwares
make
make install
3、测试mmc和usb驱动
ls -l /dev/mmcblk0p1
ls -l /dev/sda1
4、修改rcS
vim etc/init.d/rcS
/bin/echo "my file system /etc/init.d/rcS"
mount -t tmpfs mdev /dev
mount -t proc proc /proc
mount -t sysfs sysfs /sys
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
5、创建mdev.conf,内容为
vim etc/mdev.conf
sd[a-z][0-9] 0:0 666 @(mount -t vfat /dev/$MDEV /media/usb/)
sd[a-z][0-9] 0:0 666 $(umount /media/usb/&&cd /&&cd $OLDPWD)
mmcblk[0-9]p[0-9] 0:0 666 @(mount -t vfat /dev/$MDEV /media/mmc/)
mmcblk[0-9]p[0-9] 0:0 666 $(umount /media/mmc/&&cd /&&cd $OLDPWD)
sd[a-z][a-z][0-9] 0:0 666 @(mount -t vfat /dev/$MDEV /media/usb/)
sd[a-z][a-z][0-9] 0:0 666 $(umount /media/usb/&&cd /&&cd $OLDPWD)
mmcblk[0-9][0-9]p[0-9] 0:0 666 @(mount -t vfat /dev/$MDEV /media/mmc/)
mmcblk[0-9][0-9]p[0-9] 0:0 666 $(umount /media/mmc/&&cd /&&cd $OLDPWD)
mmcblk[0-9][0-9][0-9]p[0-9] 0:0 666 @(mount -t vfat /dev/$MDEV /media/mmc/)
mmcblk[0-9][0-9][0-9]p[0-9] 0:0 666 $(umount /media/mmc/&&cd /&&cd $OLDPWD)
6、创建挂载点
mkdir -p media/mmc
mkdir -p media/usb
7、测试(linux 2.6.35通过)