2009年8月28日 星期五

使用 debootstrap 安裝 Debian 於 USB 大拇哥

網路上相關文章很多,但是多半有"手工"打許多指令的步驟,不適合懶人使用。
[ Install Debian on USB ]這篇Wiki前半部直到 Configure Locales 的部份做完,寫得很簡明,接下來是該作者自己的 Casper package 安裝,就不用再繼續 follow up 了。

所以歸納一下步驟如下:
1.  準備好 partition 以安裝 debian。這視個人的大拇哥規劃而定,以下假設裝在 /dev/sdb2(sda 是本機上的硬碟)
以下用 /dev/sd{D}{N} 表示,請自行代換之。

2.  準備好檔案系統 ,並且 mount 到 /mnt
#> mkfs.ext3 /dev/sd{D}{N}
#> mount /dev/sd{D}{N} /mnt

3.   重頭戲來了,從 /etc/apt/sources.list 找一個 mirror site 這裡用 http://debian.nctu.edu.tw/debian/ (要含有斜線)
#> debootstrap lenny /mnt http://debian.nctu.edu.tw/debian/
     接下來會一直抓 package 來安裝,泡盃咖啡去...

4   準備兩個設定檔,一個在裝 kernel 時會用到,另一個是 sources.list,可以直接使用 host 的 /etc/apt/sources.list
#> mkdir -p /mnt/etc/apt
#> echo "do_initrd=yes" > /mnt/etc/kernel-img.conf
#> cp /etc/apt/sources.list  /mnt/etc/apt/

5   準備 fstab 給新系統 (/etc/inittab 則不需煩惱,debootstrap 會 setup inittab)
#> echo "/dev/sd{D}{N}  /  ext3  defaults,errors=remount-ro 0" > /mnt/etc/fstab
#> echo "proc /mnt/proc  proc  none 0 0" >> /mnt/etc/fstab
#> mount proc /mnt/proc  -t  proc

6   接下來用 chroot 切換到新的系統去,
#> chroot /mnt
請注意:經過這步驟,接下來,所有的指令都是下給新系統的了!

7   先設定好 locale 並且把從 host 繼承的 locale 先設空
#> apt-get update
#> apt-get install locales
#> dpkg-reconfigure locales
#> export LANG=
#> export LANGUAGE=
localepurge 是個可裝可不裝的套件,若要省空間,可以這時候裝起來
#> apt-get install localepurge
將來裝套件時 localepurge 可幫忙 free 一些不需要的 locales 資料

8   然後安裝 kernel image,遇到問題都選 y
#> apt-get install linux-image-2.6.26-2-686

9 裝 grub package
#> apt-get install grub

10 將 grub 裝到 MBR :
#> exit
請注意:接下來,我們又回到 host 了!
#> grub-install --root-directory=/mnt --no-floppy --recheck /dev/sd{D}
#> cat > /mnt/boot/grub/menu.lst << EOF
title        Debian GNU/Linux, kernel 2.6.26-2-686
root        (hd0,1)
kernel        /boot/vmlinuz-2.6.26-2-686 root=/dev/sd{D}{N} ro
initrd        /boot/initrd.img-2.6.26-2-686
EOF
這裡把 (hd1,1) 換成了 (hd0,1)  。因為若是用  usb 開機的話,grub 把大拇哥當第一顆硬碟 (hd0), 直到進了 kernel 才又跟 host 所認知的一樣---回到 sdb。


11 打完收工
#> umount /mnt/proc
#> umount /mnt

這樣就有一個可用的 Debian on USB 了!
後記:grub 安裝時,如果抱怨找不到 grub drive 或 stage1 的問題,[這裡]有解答
Technorati 標籤: , ,

2009年8月24日 星期一

serial port 測試 driver 讀不到 data!

這一段是在摩托的問題,後來自行解決了,貼過來

在 2.6.28 下,把 CONFIG_SERIAL_8250 = m (可以卸載) ,kernel 重編安裝後開機
開機後有看到 ttyS0 硬體存在:
00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
然後把 8250_pnp, 8250, serial_core 卸載,
看到卸載訊息:
serial 00:0c: disabled
現在載入自己的測試 driver ,起始部份長這樣:

static int __init modem_init(void)
{
int ret;

printk("modem_init()\n");
if (!request_region(MODEM_IO_BASE , 8, "serial"))
ret = -EBUSY;

printk("MSR = %x\n", inb(MSR));
printk("IER =0x%X \n", inb(IER));
...
}

載入後 request_region() 成功,但是之後讀到的 register 值都是 0xFF
找過 8250.c 很多地方,都沒頭緒,為何 kernel 的 8250 driver 可以動,自己的測試 driver 就讀不到 port data ?
================================================================
解決了,在此把原因整理一下,以後有人遇到這種問題不用卡在這裡~~ 以下是參考kernel version 2.6.28 所得的結果。
若只把 kernel 的 8250.ko 模組載入,該模組一樣無法讀到 serial port,
必須一起載入 8250_pnp.ko 才可以,所以關鍵就在 8250_pnp.c 裡面--->
從 serial8250_pnp_init() 開始追...有一天會呼叫到 pnp_start_dev(),這裡面呼叫了pnp_acpi_set_resources() 然後進入一大包的 ACPI 的動作(至此無力再繼續,希望後續動作有高手指點...),

Serial Pnp
View more documents from tomjpsun.


ok,拉回來 pnp_start_dev() 這邊,繼續會印出
"serial 00:06 activated" ,其中數字是 bus 編號,每台機器不盡相同。
經過了這步驟(pnp_acpi_set_resources()),ACPI 幫你打開 port 了,就可以用了(~~竟然跟 ACPI 有關耶,所以在 embedded 環境下,若是 ACPI 不管這裡的話,就不會有開版所提的問題產生了)

實驗:把之前的 test driver 模仿 8250_pnp.c 的作法,宣告一個 pnp_device_id table & pnp_driver :

static const struct pnp_device_id pnp_dev_table[] = {
{ "ANYDEVS", 0 },
{ "", 0 }
};


static struct pnp_driver test_pnp_driver = {
.name = "serial",
.probe = test_pnp_probe,
.remove = __devexit_p(test_pnp_remove),
.id_table = pnp_dev_table,
};

這裡用 "ANYDEVS" 是要讓 device probe 的過程中 match_device() 能夠成功,match 成功後,pnp 系統才會呼叫我們的 test_pnp_probe() ,此時的 serial port 已經被 ACPI enable 了。
所以在這裡面開始使用 serial port 就沒問題了。

到這裡可告一個段落,只是後續的疑問是:ACPI 到底用甚麼方式來 enable serial port 呢?有待各位大大的指點了...


2009年8月4日 星期二

buildroot-2009.05 config file

#
# Automatically generated make config: don't edit
# Tue Jun  9 19:35:42 2009
#
BR2_HAVE_DOT_CONFIG=y
BR2_VERSION="2009.05"
# BR2_alpha is not set
BR2_arm=y
# BR2_armeb is not set
# BR2_avr32 is not set
# BR2_cris is not set
# BR2_ia64 is not set
# BR2_i386 is not set
# BR2_m68k is not set
# BR2_mips is not set
# BR2_mipsel is not set
# BR2_nios2 is not set
# BR2_powerpc is not set
# BR2_sh is not set
# BR2_sh64 is not set
# BR2_sparc is not set
# BR2_sparc64 is not set
# BR2_x86_64 is not set
# BR2_generic_arm is not set
# BR2_arm7tdmi is not set
# BR2_arm610 is not set
# BR2_arm710 is not set
# BR2_arm720t is not set
# BR2_arm920t is not set
# BR2_arm922t is not set
# BR2_arm926t is not set
# BR2_arm10t is not set
# BR2_arm1136jf_s is not set
# BR2_arm1176jz_s is not set
BR2_arm1176jzf_s=y
# BR2_sa110 is not set
# BR2_sa1100 is not set
# BR2_xscale is not set
# BR2_iwmmxt is not set
BR2_ARM_TYPE="ARM1176JZF_S"
# BR2_ARM_OABI is not set
BR2_ARM_EABI=y
BR2_ARCH="arm"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_TUNE="arm1176jzf-s"
BR2_GCC_TARGET_ARCH="armv6zk"
BR2_GCC_TARGET_ABI="aapcs-linux"

#
# Target options
#

#
# Project Options
#
BR2_PROJECT="uclibc"
BR2_HOSTNAME="uclibc"
BR2_BANNER="Welcome to Buildroot"

#
# Preset Devices
#
# BR2_TARGET_AMD is not set
# BR2_TARGET_ARMLTD is not set
# BR2_TARGET_ATMEL is not set
# BR2_TARGET_KWIKBYTE is not set

#
# Generic System Support
#
# BR2_TARGET_GENERIC_ACCESS_POINT is not set
# BR2_TARGET_GENERIC_FIREWALL is not set

#
# Generic development system requires a toolchain with WCHAR and PROGRAM_INVOCATION support
#
# BR2_TARGET_GENERIC_GETTY is not set

#
# Build options
#
BR2_WGET="wget --passive-ftp -nd"
BR2_SVN_CO="svn co"
BR2_SVN_UP="svn up"
BR2_GIT="git clone"
BR2_ZCAT="gzip -d -c"
BR2_BZCAT="bzcat"
BR2_TAR_OPTIONS=""
BR2_DL_DIR="$(BASE_DIR)/dl"
BR2_COPYTO=""

#
# Mirrors and Download locations
#
BR2_PRIMARY_SITE=""
BR2_BACKUP_SITE="http://buildroot.net/downloads/sources/"
BR2_SOURCEFORGE_MIRROR="easynews"
BR2_KERNEL_MIRROR="http://www.kernel.org/pub/"
BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu"
BR2_DEBIAN_MIRROR="http://ftp.debian.org"

#
# Atmel Mirrors
#
BR2_ATMEL_MIRROR="ftp://www.at91.com/pub/buildroot/"
BR2_AT91_PATCH_MIRROR="http://maxim.org.za/AT91RM9200/2.6/"
BR2_STAGING_DIR="/usr/local/arm/buildroot-2009.05"
# BR2_FPU_SUFFIX is not set
BR2_TOPDIR_PREFIX=""
BR2_TOPDIR_SUFFIX=""
BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
BR2_GNU_TARGET_SUFFIX="linux-uclibcgnueabi"
BR2_JLEVEL=1
# BR2_PREFER_IMA is not set
# BR2_DEPRECATED is not set
BR2_RECENT=y
# BR2_CONFIG_CACHE is not set
# BR2_ENABLE_DEBUG is not set
BR2_STRIP_strip=y
# BR2_STRIP_sstrip is not set
# BR2_STRIP_none is not set
# BR2_OPTIMIZE_0 is not set
# BR2_OPTIMIZE_1 is not set
# BR2_OPTIMIZE_2 is not set
# BR2_OPTIMIZE_3 is not set
BR2_OPTIMIZE_S=y
# BR2_PREFER_STATIC_LIB is not set
# BR2_HAVE_MANPAGES is not set
# BR2_HAVE_INFOPAGES is not set
# BR2_HAVE_DOCUMENTATION is not set
# BR2_HAVE_DEVFILES is not set
BR2_UPDATE_CONFIG=y

#
# Toolchain
#
BR2_TOOLCHAIN_BUILDROOT=y
# BR2_TOOLCHAIN_EXTERNAL is not set
# BR2_TOOLCHAIN_EXTERNAL_SOURCE is not set
BR2_TOOLCHAIN_SOURCE=y
BR2_EXT_GCC_VERSION_4_1_2=y
BR2_EXT_GCC_VERSION_4_2_1=y
BR2_EXT_GCC_VERSION_4_2_2=y
BR2_EXT_GCC_VERSION_4_2_3=y
BR2_EXT_BINUTILS_VERSION_2_17=y
BR2_EXT_BINUTILS_VERSION_2_18=y
BR2_EXT_UCLIBC_VERSION_0_9_28_3=y
BR2_EXT_UCLIBC_VERSION_0_9_29=y
BR2_EXT_UCLIBC_VERSION_0_9_30=y
BR2_EXT_UCLIBC_VERSION_0_9_30_1=y

#
# Kernel Header Options
#
# BR2_KERNEL_HEADERS_2_6_23 is not set
# BR2_KERNEL_HEADERS_2_6_24 is not set
# BR2_KERNEL_HEADERS_2_6_25 is not set
# BR2_KERNEL_HEADERS_2_6_26 is not set
# BR2_KERNEL_HEADERS_2_6_27 is not set
# BR2_KERNEL_HEADERS_2_6_28 is not set
BR2_KERNEL_HEADERS_2_6_29=y
# BR2_KERNEL_HEADERS_SNAP is not set
BR2_DEFAULT_KERNEL_HEADERS="2.6.29.4"

#
# uClibc Options
#
# BR2_UCLIBC_VERSION_0_9_28_3 is not set
# BR2_UCLIBC_VERSION_0_9_29 is not set
# BR2_UCLIBC_VERSION_0_9_30 is not set
BR2_UCLIBC_VERSION_0_9_30_1=y
# BR2_UCLIBC_VERSION_SNAPSHOT is not set
BR2_UCLIBC_VERSION_STRING="0.9.30.1"
BR2_UCLIBC_CONFIG="toolchain/uClibc/uClibc-0.9.30.config"
# BR2_PTHREAD_DEBUG is not set
# BR2_UCLIBC_PROGRAM_INVOCATION is not set
# BR2_UCLIBC_INSTALL_TEST_SUITE is not set

#
# Binutils Options
#
# BR2_BINUTILS_VERSION_2_17 is not set
# BR2_BINUTILS_VERSION_2_17_50_0_17 is not set
# BR2_BINUTILS_VERSION_2_18 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_1 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_3 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_6 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_8 is not set
# BR2_BINUTILS_VERSION_2_18_50_0_9 is not set
# BR2_BINUTILS_VERSION_2_19 is not set
BR2_BINUTILS_VERSION_2_19_1=y
BR2_BINUTILS_VERSION="2.19.1"
BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""

#
# GCC Options
#
# BR2_GCC_VERSION_3_4_6 is not set
# BR2_GCC_VERSION_4_0_4 is not set
# BR2_GCC_VERSION_4_1_2 is not set
# BR2_GCC_VERSION_4_2_1 is not set
# BR2_GCC_VERSION_4_2_2 is not set
# BR2_GCC_VERSION_4_2_3 is not set
# BR2_GCC_VERSION_4_2_4 is not set
# BR2_GCC_VERSION_4_3_1 is not set
# BR2_GCC_VERSION_4_3_2 is not set
BR2_GCC_VERSION_4_3_3=y
# BR2_GCC_VERSION_4_4_X is not set
BR2_GCC_SUPPORTS_SYSROOT=y
BR2_GCC_SUPPORTS_FINEGRAINEDMTUNE=y
BR2_GCC_VERSION="4.3.3"
BR2_TOOLCHAIN_SYSROOT=y
# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
# BR2_GCC_CROSS_FORTRAN is not set
# BR2_INSTALL_LIBGCJ is not set
# BR2_INSTALL_OBJC is not set
# BR2_INSTALL_FORTRAN is not set
BR2_GCC_SHARED_LIBGCC=y

#
# Ccache Options
#
# BR2_CCACHE is not set

#
# Gdb Options
#
BR2_PACKAGE_GDB=y
BR2_PACKAGE_GDB_SERVER=y
BR2_PACKAGE_GDB_HOST=y
# BR2_GDB_VERSION_6_4 is not set
# BR2_GDB_VERSION_6_5 is not set
# BR2_GDB_VERSION_6_6 is not set
# BR2_GDB_VERSION_6_7_1 is not set
BR2_GDB_VERSION_6_8=y
BR2_GDB_VERSION="6.8"

#
# Common Toolchain Options
#
# BR2_LARGEFILE is not set
# BR2_INET_IPV6 is not set
# BR2_INET_RPC is not set
# BR2_ENABLE_LOCALE is not set
# BR2_USE_WCHAR is not set
# BR2_SOFT_FLOAT is not set
# BR2_USE_SSP is not set
# BR2_PTHREADS_NONE is not set
# BR2_PTHREADS is not set
BR2_PTHREADS_OLD=y
# BR2_PTHREADS_NATIVE is not set
BR2_GCC_CROSS_CXX=y
BR2_INSTALL_LIBSTDCPP=y
BR2_TARGET_OPTIMIZATION="-Os -pipe"
# BR2_ELF2FLT is not set
# BR2_MKLIBS is not set
# BR2_PACKAGE_SSTRIP_TARGET is not set
# BR2_PACKAGE_SSTRIP_HOST is not set
# BR2_ENABLE_MULTILIB is not set
# BR2_VFP_FLOAT is not set
BR2_CROSS_TOOLCHAIN_TARGET_UTILS=y

#
# Package Selection for the target
#
BR2_PACKAGE_BUSYBOX=y
# BR2_BUSYBOX_VERSION_1_12_X is not set
# BR2_BUSYBOX_VERSION_1_13_X is not set
BR2_BUSYBOX_VERSION_1_14_X=y
# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
BR2_BUSYBOX_VERSION="1.14.1"
BR2_PACKAGE_BUSYBOX_FULLINSTALL=y
BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.13.x.config"
BR2_PACKAGE_BUSYBOX_HIDE_OTHERS=y
# BR2_PACKAGE_BUSYBOX_SKELETON is not set

#
# The minimum needed to build a uClibc development system
#
# BR2_PACKAGE_FLEX is not set
# BR2_PACKAGE_GCC_TARGET is not set
# BR2_PACKAGE_MAKE is not set

#
# Other development stuff
#
# BR2_PACKAGE_AUTOCONF is not set
# BR2_PACKAGE_AUTOMAKE is not set
# BR2_PACKAGE_BISON is not set
# BR2_PACKAGE_CCACHE_TARGET is not set
# BR2_PACKAGE_DISTCC is not set
# BR2_PACKAGE_DMALLOC is not set
# BR2_PACKAGE_FAKEROOT is not set
BR2_HOST_FAKEROOT=y
# BR2_PACKAGE_GETTEXT is not set
# BR2_PACKAGE_LIBINTL is not set
# BR2_PACKAGE_LIBGMP is not set
# BR2_PACKAGE_GPERF is not set
# BR2_PACKAGE_LIBMPFR is not set
# BR2_PACKAGE_LIBTOOL is not set
# BR2_PACKAGE_M4 is not set
# BR2_PACKAGE_MPATROL is not set
# BR2_PACKAGE_OPROFILE is not set
# BR2_PACKAGE_PKG_CONFIG is not set
# BR2_PACKAGE_READLINE is not set
# BR2_PACKAGE_PCRE is not set

#
# Other stuff
#
# BR2_PACKAGE_AT is not set
# BR2_PACKAGE_BEECRYPT is not set
# BR2_PACKAGE_BERKELEYDB is not set
# BR2_PACKAGE_BSDIFF is not set
# BR2_PACKAGE_CUPS is not set
# BR2_PACKAGE_CUSTOMIZE is not set
# BR2_PACKAGE_FILE is not set
# BR2_PACKAGE_GAMIN is not set

#
# icu requires a toolchain with C++ support and WCHAR enabled
#
# BR2_PACKAGE_KEXEC is not set
# BR2_PACKAGE_LIBCONFIG is not set
# BR2_PACKAGE_LIBCONFUSE is not set
# BR2_PACKAGE_LIBDAEMON is not set
# BR2_PACKAGE_LIBELF is not set
# BR2_PACKAGE_LIBEVENT is not set
# BR2_PACKAGE_LIBGCRYPT is not set
# BR2_PACKAGE_LIBGPG_ERROR is not set
# BR2_PACKAGE_LIBICONV is not set
# BR2_PACKAGE_LIBIDN is not set
# BR2_PACKAGE_LIBLOCKFILE is not set
# BR2_PACKAGE_LIBOIL is not set
# BR2_PACKAGE_LIBSYSFS is not set
# BR2_PACKAGE_LOCKFILE_PROGS is not set

#
# logrotate     - disabled (requires wchar support)
#
# BR2_PACKAGE_LSOF is not set
# BR2_PACKAGE_LTP-TESTSUITE is not set
# BR2_PACKAGE_LTRACE is not set
# BR2_PACKAGE_MEMSTAT is not set
# BR2_PACKAGE_NG_SPICE_REWORK is not set
# BR2_PACKAGE_POPT is not set
# BR2_PACKAGE_SCREEN is not set
# BR2_PACKAGE_SHARED_MIME_INFO is not set
# BR2_PACKAGE_STARTUP_NOTIFICATION is not set
# BR2_PACKAGE_STRACE is not set
# BR2_PACKAGE_SUDO is not set

#
# Database
#
# BR2_PACKAGE_MYSQL_CLIENT is not set
# BR2_PACKAGE_SQLITE is not set

#
# Networking
#

#
# Networking applications
#
# BR2_PACKAGE_ARGUS is not set
# BR2_PACKAGE_AVAHI is not set
# BR2_PACKAGE_AXEL is not set

#
# bind requires a toolchain with LARGEFILE support
#
# BR2_PACKAGE_BRIDGE is not set
# BR2_PACKAGE_DNSMASQ is not set
# BR2_PACKAGE_DROPBEAR is not set
# BR2_PACKAGE_ETHTOOL is not set
# BR2_PACKAGE_HASERL is not set
# BR2_PACKAGE_IFPLUGD is not set
# BR2_PACKAGE_IPERF is not set

#
# iproute2 requires a toolchain with IPv6 support
#
# BR2_PACKAGE_IPSEC_TOOLS is not set

#
# iptables requires a toolchain with LARGEFILE support
#
# BR2_PACKAGE_KISMET is not set
# BR2_PACKAGE_L2TP is not set
# BR2_PACKAGE_LIBCGI is not set
# BR2_PACKAGE_LIBCGICC is not set
# BR2_PACKAGE_LIBCURL is not set
# BR2_PACKAGE_LIBDNET is not set
# BR2_PACKAGE_LIBEXOSIP2 is not set
# BR2_PACKAGE_LIBOSIP2 is not set
# BR2_PACKAGE_LIBPCAP is not set
# BR2_PACKAGE_LIBSOUP is not set
# BR2_PACKAGE_LIBUPNP is not set
# BR2_PACKAGE_LINKS is not set
# BR2_PACKAGE_LRZSZ is not set
# BR2_PACKAGE_MDNSRESPONDER is not set
# BR2_PACKAGE_MIIDIAG is not set
# BR2_PACKAGE_MROUTED is not set
# BR2_PACKAGE_MUTT is not set
# BR2_PACKAGE_NBD is not set
# BR2_PACKAGE_NCFTP is not set
# BR2_PACKAGE_NEON is not set

#
# netkitbase requires a toolchain with RPC support
#
# BR2_PACKAGE_NETKITTELNET is not set
# BR2_PACKAGE_NETPLUG is not set
# BR2_PACKAGE_NETSNMP is not set

#
# nfs-utils requires a toolchain with 'Enable RPC' selected
#
# BR2_PACKAGE_NTP is not set
# BR2_PACKAGE_OLSR is not set
# BR2_PACKAGE_OPENNTPD is not set
# BR2_PACKAGE_OPENSSH is not set
# BR2_PACKAGE_OPENSSL is not set
# BR2_PACKAGE_OPENVPN is not set

#
# portmap requires a toolchain with 'Enable RPC' selected
#
# BR2_PACKAGE_PPPD is not set
# BR2_PACKAGE_RP_PPPOE is not set
# BR2_PACKAGE_PPTP_LINUX is not set
# BR2_PACKAGE_PROFTPD is not set

#
# quagga suite
#
# BR2_PACKAGE_QUAGGA_ZEBRA is not set
# BR2_PACKAGE_QUAGGA_BGPD is not set
# BR2_PACKAGE_QUAGGA_RIPD is not set
# BR2_PACKAGE_QUAGGA_RIPNGD is not set
# BR2_PACKAGE_QUAGGA_OSPFD is not set
# BR2_PACKAGE_QUAGGA_WATCHQUAGGA is not set
# BR2_PACKAGE_QUAGGA_ISISD is not set
# BR2_PACKAGE_RSYNC is not set
# BR2_PACKAGE_SAMBA is not set
# BR2_PACKAGE_SOCAT is not set
# BR2_PACKAGE_STUNNEL is not set
# BR2_PACKAGE_TCPDUMP is not set
# BR2_PACKAGE_DHCPDUMP is not set
# BR2_PACKAGE_TFTPD is not set
# BR2_PACKAGE_TN5250 is not set
# BR2_PACKAGE_TTCP is not set
# BR2_PACKAGE_UDPCAST is not set
# BR2_PACKAGE_VPNC is not set
# BR2_PACKAGE_VSFTPD is not set
# BR2_PACKAGE_VTUN is not set
# BR2_PACKAGE_WEBIF is not set
# BR2_PACKAGE_WIRELESS_TOOLS is not set
# BR2_PACKAGE_WPA_SUPPLICANT is not set

#
# Hardware handling / blockdevices and filesystem maintenance
#

#
# dbus not available (need expat or libxml2)
#

#
# dbus-glib needs dbus to be compiled with expat support
#
# BR2_PACKAGE_DEVMEM2 is not set

#
# dm requires a toolchain with LARGEFILE support
#

#
# dmraid requires a toolchain with LARGEFILE support
#

#
# e2fsprogs requires a toolchain with LARGEFILE support
#
# BR2_PACKAGE_EEPROG is not set
# BR2_PACKAGE_FCONFIG is not set
# BR2_PACKAGE_FIS is not set

#
# libfuse requires a toolchain with LARGEFILE support
#
# BR2_PACKAGE_GADGETFS_TEST is not set
# BR2_PACKAGE_HAL is not set
# BR2_PACKAGE_HWDATA is not set
# BR2_PACKAGE_I2C_TOOLS is not set
# BR2_PACKAGE_INPUT_TOOLS is not set
# BR2_PACKAGE_IOSTAT is not set
# BR2_PACKAGE_LIBAIO is not set
# BR2_PACKAGE_LIBRAW1394 is not set
# BR2_PACKAGE_LIBUSB is not set
# BR2_PACKAGE_LM_SENSORS is not set
# BR2_PACKAGE_LVM2 is not set
# BR2_PACKAGE_MDADM is not set
# BR2_PACKAGE_MEMTESTER is not set
# BR2_PACKAGE_MKDOSFS is not set
BR2_PACKAGE_MTD=y
BR2_PACKAGE_MTD_UTILS=y
# BR2_PACKAGE_MTD_20061007 is not set
# BR2_PACKAGE_MTD_20050122 is not set
# BR2_PACKAGE_MTD_UTILS_GIT is not set

#
# MTD tools selection
#
# BR2_PACKAGE_MTD_DOCFDISK is not set
# BR2_PACKAGE_MTD_DOC_LOADBIOS is not set
BR2_PACKAGE_MTD_FLASHCP=y
BR2_PACKAGE_MTD_FLASH_ERASE=y
BR2_PACKAGE_MTD_FLASH_ERASEALL=y
BR2_PACKAGE_MTD_FLASH_INFO=y
BR2_PACKAGE_MTD_FLASH_LOCK=y
BR2_PACKAGE_MTD_FLASH_UNLOCK=y
BR2_PACKAGE_MTD_FTL_CHECK=y
BR2_PACKAGE_MTD_FTL_FORMAT=y
BR2_PACKAGE_MTD_JFFS2DUMP=y
BR2_PACKAGE_MTD_MKFSJFFS2=y
# BR2_PACKAGE_MTD_MKFSJFFS is not set
BR2_PACKAGE_MTD_MTD_DEBUG=y
BR2_PACKAGE_MTD_NANDDUMP=y
BR2_PACKAGE_MTD_NANDWRITE=y
# BR2_PACKAGE_MTD_NFTL_FORMAT is not set
# BR2_PACKAGE_MTD_NFTLDUMP is not set
BR2_PACKAGE_MTD_SUMTOOL=y

#
# ntfs-3g requires a toolchain with LARGEFILE and WCHAR support
#
# BR2_PACKAGE_PCIUTILS is not set
# BR2_PACKAGE_SETSERIAL is not set
# BR2_PACKAGE_SMARTMONTOOLS is not set
# BR2_PACKAGE_USBMOUNT is not set
# BR2_PACKAGE_USBUTILS is not set
# BR2_PACKAGE_WIPE is not set
# BR2_PACKAGE_XFSPROGS is not set

#
# Audio and video libraries and applications
#
# BR2_PACKAGE_ALSA_LIB is not set

#
# alsa-utils requires a toolchain with LARGEFILE support
#

#
# asterisk    - disabled (required openssl and mpg123)
#
# BR2_PACKAGE_AUMIX is not set
# BR2_PACKAGE_FLAC is not set
# BR2_PACKAGE_GSTREAMER is not set
# BR2_PACKAGE_LIBID3TAG is not set
# BR2_PACKAGE_LIBMAD is not set
# BR2_PACKAGE_LIBMPD is not set
# BR2_PACKAGE_LIBOGG is not set
# BR2_PACKAGE_LIBSNDFILE is not set
# BR2_PACKAGE_LIBTHEORA is not set
# BR2_PACKAGE_LIBVORBIS is not set
# BR2_PACKAGE_MADPLAY is not set
# BR2_PACKAGE_MPG123 is not set
# BR2_PACKAGE_MPLAYER is not set
# BR2_PACKAGE_SPEEX is not set
# BR2_PACKAGE_FESTIVAL is not set
# BR2_PACKAGE_TAGLIB is not set
# BR2_PACKAGE_VLC is not set

#
# Graphic libraries and applications (graphic/text)
#

#
# text rendering libraries
#
BR2_PACKAGE_NCURSES=y
# BR2_PACKAGE_NCURSES_TARGET_PANEL is not set
# BR2_PACKAGE_NCURSES_TARGET_FORM is not set
# BR2_PACKAGE_NCURSES_TARGET_MENU is not set
# BR2_PACKAGE_NCURSES_TARGET_HEADERS is not set
# BR2_PACKAGE_NEWT is not set
# BR2_PACKAGE_SLANG is not set

#
# text rendering applications
#
# BR2_PACKAGE_DIALOG is not set

#
# graphic libraries
#
# BR2_PACKAGE_DIRECTFB is not set
# BR2_PACKAGE_FBDUMP is not set
# BR2_PACKAGE_IMAGEMAGICK is not set
# BR2_PACKAGE_JPEG is not set
# BR2_PACKAGE_LIBART is not set
# BR2_PACKAGE_LIBPNG is not set
# BR2_PACKAGE_LIBUNGIF is not set
# BR2_PACKAGE_LINUX_FUSION is not set
# BR2_PACKAGE_PIXMAN is not set
# BR2_PACKAGE_SDL is not set
# BR2_PACKAGE_TIFF is not set

#
# busybox graphic applications
#

#
# --> May be broken in busybox
#
# BR2_PACKAGE_FBV is not set
# BR2_PACKAGE_FBSET is not set

#
# other GUIs
#
# BR2_PACKAGE_QTOPIA4 is not set
BR2_PACKAGE_XSERVER_none=y
# BR2_PACKAGE_XSERVER_xorg is not set
# BR2_PACKAGE_XSERVER_tinyx is not set

#
# xorg requires a toolchain with C++, LOCALE, LARGEFILE and WCHAR support
#

#
# tinyx requires a toolchain with WCHAR support
#

#
# X libraries and helper libraries
#
# BR2_PACKAGE_ATK is not set
# BR2_PACKAGE_CAIRO is not set
# BR2_PACKAGE_PANGO is not set
# BR2_PACKAGE_LIBDRM is not set
# BR2_PACKAGE_LIBERATION is not set
# BR2_PACKAGE_LIBGLIB12 is not set
# BR2_PACKAGE_LIBGLIB2 is not set
# BR2_PACKAGE_OPENMOTIF is not set
# BR2_PACKAGE_FONTCONFIG is not set
# BR2_PACKAGE_FREETYPE is not set
# BR2_PACKAGE_TSLIB is not set

#
# webkit requires a toolchain with C++ support and WCHAR enabled
#

#
# X Window managers
#
# BR2_PACKAGE_MATCHBOX is not set

#
# X applications
#
# BR2_PACKAGE_ALSAMIXERGUI is not set

#
# dillo        - disabled (requires jpeg,libglib12,libgtk12,zlib,libpng and Xorg(7))
#
# BR2_PACKAGE_GQVIEW is not set
# BR2_PACKAGE_GOB2 is not set
# BR2_PACKAGE_LEAFPAD is not set

#
# midori        - disabled (requires Xorg(7))
#
# BR2_PACKAGE_PCMANFM is not set
# BR2_PACKAGE_SYLPHEED is not set
# BR2_PACKAGE_TORSMO is not set
# BR2_PACKAGE_X11VNC is not set
# BR2_PACKAGE_XPDF is not set
# BR2_PACKAGE_XSTROKE is not set
# BR2_PACKAGE_XVKBD is not set

#
# Compressors / decompressors
#
BR2_PACKAGE_LZO=y
# BR2_PACKAGE_LZOP is not set
# BR2_PACKAGE_LZMA_TARGET is not set
# BR2_PACKAGE_LZMA_HOST is not set
BR2_PACKAGE_ZLIB=y
# BR2_PACKAGE_ZLIB_TARGET_HEADERS is not set

#
# Package managers
#
# BR2_PACKAGE_IPKG is not set
# BR2_PACKAGE_PORTAGE is not set

#
# Interpreter languages / Scripting
#
# BR2_PACKAGE_LUA is not set
# BR2_PACKAGE_MICROPERL is not set
# BR2_PACKAGE_PYTHON is not set
# BR2_PACKAGE_RUBY is not set
# BR2_PACKAGE_TCL is not set
# BR2_PACKAGE_PHP is not set

#
# XML handling
#
# BR2_PACKAGE_EXPAT is not set
# BR2_PACKAGE_EZXML is not set
# BR2_PACKAGE_LIBXML2 is not set
# BR2_PACKAGE_LIBXSLT is not set
# BR2_PACKAGE_XERCES is not set

#
# Java
#
# BR2_PACKAGE_CLASSPATH is not set

#
# Games
#
# BR2_PACKAGE_GNUCHESS is not set
# BR2_PACKAGE_MAGICCUBE4D is not set
# BR2_PACKAGE_PRBOOM is not set
# BR2_PACKAGE_RUBIX is not set
# BR2_PACKAGE_VICE is not set
# BR2_PACKAGE_XBOARD is not set

#
# Target filesystem options
#
BR2_ROOTFS_PREFIX="rootfs"
BR2_ROOTFS_SUFFIX=""

#
# filesystem for target device
#
BR2_TARGET_ROOTFS_CRAMFS=y
# BR2_TARGET_ROOTFS_CLOOP is not set
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_BLOCKS=0
BR2_TARGET_ROOTFS_EXT2_INODES=0
BR2_TARGET_ROOTFS_EXT2_RESBLKS=0
BR2_TARGET_ROOTFS_EXT2_SQUASH=y
BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2"
BR2_TARGET_ROOTFS_EXT2_NONE=y
# BR2_TARGET_ROOTFS_EXT2_GZIP is not set
# BR2_TARGET_ROOTFS_EXT2_BZIP2 is not set
# BR2_TARGET_ROOTFS_EXT2_LZMA is not set
BR2_TARGET_ROOTFS_EXT2_COPYTO=""
BR2_TARGET_ROOTFS_JFFS2=y
# BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_1056 is not set
BR2_TARGET_ROOTFS_JFFS2_DATAFLASH_528=y
# BR2_TARGET_ROOTFS_JFFS2_NANDFLASH_2K_128K is not set
# BR2_TARGET_ROOTFS_JFFS2_FLASH_128 is not set
# BR2_TARGET_ROOTFS_JFFS2_FLASH_64 is not set
# BR2_TARGET_ROOTFS_JFFS2_CUSTOM is not set
BR2_TARGET_ROOTFS_JFFS2_PAGESIZE=0x210
BR2_TARGET_ROOTFS_JFFS2_EBSIZE=0x1080
BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER=y
# BR2_JFFS2_TARGET_SREC is not set
# BR2_TARGET_ROOTFS_JFFS2_PAD is not set
BR2_TARGET_ROOTFS_JFFS2_LE=y
# BR2_TARGET_ROOTFS_JFFS2_BE is not set
# BR2_TARGET_ROOTFS_JFFS2_SUMMARY is not set
BR2_TARGET_ROOTFS_JFFS2_OUTPUT="$(IMAGE).jffs2"
BR2_TARGET_ROOTFS_JFFS2_COPYTO=""
# BR2_TARGET_ROOTFS_SQUASHFS is not set
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_NONE=y
# BR2_TARGET_ROOTFS_CPIO_GZIP is not set
# BR2_TARGET_ROOTFS_CPIO_BZIP2 is not set
# BR2_TARGET_ROOTFS_CPIO_LZMA is not set
BR2_TARGET_ROOTFS_CPIO_COPYTO=""
BR2_TARGET_ROOTFS_INITRAMFS=y
# BR2_TARGET_ROOTFS_ROMFS is not set

#
# bootloader for target device
#
# BR2_TARGET_UBOOT is not set

#
# Kernel
#
BR2_KERNEL_none=y
# BR2_KERNEL_LINUX_ADVANCED is not set
# BR2_KERNEL_LINUX is not set
# BR2_KERNEL_HURD is not set

More on QEMU

兩年前在 [QEMU 安裝與試跑] 探討了模擬 ARM Versatile 系統。 原以為這樣就會使用 QEMU 了,最近兩天為了模擬 x86 不成功,只好重新拾起 [QEMU Documentation] 仔細再 K 一下,補足原本欠缺的觀念,以下紀錄的是該準備的 sources & images :

linux-2.6.28 由 [kernel archive] 下載解壓的,
linux-0.2.img.bz2 由 QEMU Documentation | [download] | 下載得到,
bzImage-2.6.28-test 由 linux-2.6.28 編好之後所得,
initrd.img-2.6.28-test.bz2 由 linux-2.6.28 編好安裝模組 (make modules_install) 後,利用 update-initramfs -c -k 2.6.28-test 所得到的
檔案系統 (bunzip2 -c initrd.img-2.6.28-test.bz2 | cpio -idm)

以下紀錄了幾次錯誤的啟動方式:
#> qemu -kernel bzImage-2.6.28-test
==>A disk image must be given for 'hda' when booting a Linux kernel
(if you really don't want it, use /dev/zero)
#> qemu -kernel bzImage-2.6.28-test -hda /dev/zero
==> booting from Hard Disk
==>failed : not a bootable disk
==> no bootable device
沒頭緒,翻翻線上手冊好了---
在 [QEMU Documentation] 3.8 節 Direct Linux Boot 提到:
`...It is very useful for fast Linux kernel testing.
The syntax is :
qemu -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" `

"...Use ‘-kernel’ to provide the Linux kernel image and ‘-append’ to give the kernel command line arguments. The ‘-initrd’ option can be used to provide an INITRD image.
When using the direct Linux boot, a disk image for the first hard disk ‘hda’ is required because its boot sector is used to launch the Linux kernel..."

所以我們得準備一個 disk image,也就是剛才下載的 linux-0.2.img,讓 QEMU 透過 disk image 的 boot sector 載入 kernel image,並且傳 kernel parameter "root=/dev/hda" ,告訴 kernel 說 root filesystem 在 disk image 上!

#>qemu -kernel bzImage-2.6.28-test  -hda linux-0.2.img -append "root=/dev/hda"

終於成功 ,顯示出的 kernel 為餵進去的 2.6.28-test.,注意 disk image 不能用壓縮的 bz2 or gz ,否則會發生 waiting for root filesystem...的現象...殘念!

結論:在模擬 x86 上,需要有 disk image (即使不使用 disk image 上的 kernel image 也一樣),跟模擬 ARM 有所不同。