summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-11-03 01:02:39 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-11-03 01:02:39 +0000
commite49c2d769162c261a035db1a979f639b20effd47 (patch)
tree4286407f29abcbd533e439ccccd20e8d4a184cb5 /target/linux
parenta4db9ed4529ba632d80f4d55eafc89c9c23851d2 (diff)
downloadmtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.zip
mtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.tar.gz
mtk-20170518-e49c2d769162c261a035db1a979f639b20effd47.tar.bz2
merge the olpc target with the x86 target, both tested and running
SVN-Revision: 18279
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/x86/Makefile4
-rw-r--r--target/linux/x86/image/Config.in30
-rw-r--r--target/linux/x86/image/Makefile46
-rwxr-xr-xtarget/linux/x86/image/gen_image_olpc.sh35
-rwxr-xr-xtarget/linux/x86/image/gen_image_x86.sh (renamed from target/linux/x86/image/gen_image.sh)0
-rw-r--r--target/linux/x86/image/olpc.fth5
-rw-r--r--target/linux/x86/olpc/base-files/etc/X11/xorg.conf71
-rw-r--r--target/linux/x86/olpc/base-files/etc/config/network11
-rw-r--r--target/linux/x86/olpc/base-files/etc/preinit.arch2
-rw-r--r--target/linux/x86/olpc/base-files/lib/upgrade/platform.sh27
-rw-r--r--target/linux/x86/olpc/config-default528
-rw-r--r--target/linux/x86/olpc/target.mk2
-rw-r--r--target/linux/x86/patches-2.6.30/300-block2mtd_init.patch210
13 files changed, 964 insertions, 7 deletions
diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile
index 8999395..d7c5625 100644
--- a/target/linux/x86/Makefile
+++ b/target/linux/x86/Makefile
@@ -10,9 +10,9 @@ ARCH=i386
BOARD:=x86
BOARDNAME:=x86
FEATURES:=squashfs jffs2 ext2 vdi vmdk pcmcia tgz
-SUBTARGETS=generic
+SUBTARGETS=generic olpc
-LINUX_VERSION:=2.6.31.5
+LINUX_VERSION:=2.6.30.9
include $(INCLUDE_DIR)/target.mk
diff --git a/target/linux/x86/image/Config.in b/target/linux/x86/image/Config.in
index bf14267..9dd7ae5 100644
--- a/target/linux/x86/image/Config.in
+++ b/target/linux/x86/image/Config.in
@@ -1,6 +1,6 @@
config X86_GRUB_IMAGES
bool "Build GRUB images (Linux x86 or x86_64 host only)"
- depends TARGET_x86
+ depends TARGET_x86_generic
depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS || TARGET_ROOTFS_ISO
select PACKAGE_grub
default y
@@ -38,14 +38,38 @@ config X86_GRUB_BOOTOPTS
config X86_VDI_IMAGES
bool "Build VirtualBox image files (VDI). Requires VBoxManage"
- depends TARGET_x86
+ depends TARGET_x86_generic
depends TARGET_ROOTFS_EXT2FS
depends X86_GRUB_IMAGES
select PACKAGE_kmod-pcnet32
config X86_VMDK_IMAGES
bool "Build VMware image files (VMDK). Requires qemu-img"
- depends TARGET_x86
+ depends TARGET_x86_generic
depends TARGET_ROOTFS_EXT2FS
depends X86_GRUB_IMAGES
select PACKAGE_kmod-e1000
+
+config OLPC_BOOTSCRIPT_IMAGES
+ bool "Build images with bootscript"
+ depends TARGET_x86_olpc
+ depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS || TARGET_ROOTFS_ISO
+ default y
+
+config OLPC_BOOTSCRIPT_IMAGES_PAD
+ bool "Pad bootscript images to filesystem size (for JFFS2)"
+ depends OLPC_BOOTSCRIPT_IMAGES
+
+config OLPC_BOOTSCRIPT_KERNELPART
+ int "Kernel partition size (in MB)"
+ depends OLPC_BOOTSCRIPT_IMAGES
+ default 4
+
+config OLPC_BOOTSCRIPT_ROOTPART
+ string
+ prompt "Root partition on target device" if OLPC_BOOTSCRIPT_IMAGES
+ default "/dev/sda2"
+ help
+ The root partition on the final device. If you don't know,
+ you probably want the default (/dev/sda2).
+
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 6d3c77b..699dcfe 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -8,10 +8,17 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
export PATH=$(TARGET_PATH):/sbin
+
+ifeq ($(CONFIG_TARGET_x86_generic),y)
BOOTOPTS=$(strip $(subst ",, $(CONFIG_X86_GRUB_BOOTOPTS)))
ROOTPART=$(strip $(subst ",, $(CONFIG_X86_GRUB_ROOTPART)))
#"))")) # fix vim's broken syntax highlighting
+endif
+ifeq ($(CONFIG_TARGET_x86_olpc),y)
+ROOTPART=$(strip $(subst ",, $(CONFIG_OLPC_BOOTSCRIPT_ROOTPART)))
+endif
+#"))")) # fix vim's broken syntax highlighting
ifeq ($(CONFIG_X86_GRUB_IMAGES),y)
ifneq ($(HOST_OS),Darwin)
@@ -42,7 +49,7 @@ ifneq ($(HOST_OS),Darwin)
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
-e 's#@BAUDRATE@#$(CONFIG_X86_GRUB_BAUDRATE)#g' \
./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
- PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
+ PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_x86.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
$(call Image/Build/grub/$(1))
endef
@@ -56,7 +63,7 @@ ifneq ($(HOST_OS),Darwin)
endef
else
define Image/Build/grub
- PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" NOGRUB=1 ./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) "" $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
+ PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" NOGRUB=1 ./gen_image_x86.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_X86_GRUB_KERNELPART) "" $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
endef
endif
endif
@@ -82,9 +89,43 @@ ifeq ($(CONFIG_X86_VMDK_IMAGES),y)
endef
endif
+ROOTDELAY=10
+
+ifeq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),y)
+ define Image/cmdline/squashfs
+ block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=squashfs rootdelay=$(ROOTDELAY)
+ endef
+
+ define Image/cmdline/jffs2-64k
+ block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 rootdelay=$(ROOTDELAY)
+ endef
+
+ define Image/cmdline/jffs2-128k
+ block2mtd.block2mtd=$(ROOTPART),131072,rootfs root=/dev/mtdblock0 rootfstype=jffs2 rootdelay=$(ROOTDELAY)
+ endef
+
+ define Image/cmdline/ext2
+ root=$(ROOTPART) rootfstype=ext2 rootwait
+ endef
+
+ define Image/Build/bootscript
+ # left here because the image builder doesnt need these
+ $(INSTALL_DIR) $(KDIR)/root.bootscript/boot
+ $(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
+ sed -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
+ ./olpc.fth > $(KDIR)/root.bootscript/boot/olpc.fth
+ PADDING="$(CONFIG_OLPC_BOOTSCRIPT_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_olpc.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_OLPC_BOOTSCRIPT_KERNELPART) $(KDIR)/root.bootscript $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
+ endef
+endif
+
define Image/Prepare
$(CP) $(LINUX_DIR)/arch/x86/boot/bzImage $(KDIR)/bzImage
+ifeq ($(CONFIG_TARGET_x86_generic),y)
$(call Image/Prepare/grub)
+endif
+ifeq ($(CONFIG_TARGET_x86_olpc),y)
+ $(call Image/Prepare/bootscript)
+endif
endef
define Image/Build/squashfs
@@ -112,6 +153,7 @@ endef
define Image/Build
$(call Image/Build/$(1))
+ $(call Image/Build/bootscript,$(1))
ifneq ($(1),iso)
$(call Image/Build/grub,$(1))
$(call Image/Build/vdi,$(1))
diff --git a/target/linux/x86/image/gen_image_olpc.sh b/target/linux/x86/image/gen_image_olpc.sh
new file mode 100755
index 0000000..4fd6e37
--- /dev/null
+++ b/target/linux/x86/image/gen_image_olpc.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Copyright (C) 2006 - 2007 OpenWrt.org
+set -x
+[ $# == 5 ] || {
+ echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image>"
+ exit 1
+}
+
+OUTPUT="$1"
+KERNELSIZE="$2"
+KERNELDIR="$3"
+ROOTFSSIZE="$4"
+ROOTFSIMAGE="$5"
+
+rm -f "$OUTPUT"
+
+head=16
+sect=63
+cyl=$(( ($KERNELSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512)))
+
+# create partition table
+set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m`
+
+KERNELOFFSET="$(($1 / 512))"
+KERNELSIZE="$(($2 / 512))"
+ROOTFSOFFSET="$(($3 / 512))"
+ROOTFSSIZE="$(($4 / 512))"
+
+BLOCKS="$((($KERNELSIZE / 2) - 1))"
+
+genext2fs -d "$KERNELDIR" -b "$BLOCKS" "$OUTPUT.kernel"
+dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc
+[ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE"
+dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
+#rm -f "$OUTPUT.kernel"
diff --git a/target/linux/x86/image/gen_image.sh b/target/linux/x86/image/gen_image_x86.sh
index 5d4c0dd..5d4c0dd 100755
--- a/target/linux/x86/image/gen_image.sh
+++ b/target/linux/x86/image/gen_image_x86.sh
diff --git a/target/linux/x86/image/olpc.fth b/target/linux/x86/image/olpc.fth
new file mode 100644
index 0000000..5914be6
--- /dev/null
+++ b/target/linux/x86/image/olpc.fth
@@ -0,0 +1,5 @@
+\ Boot script
+" u:\boot\vmlinuz" to boot-device
+" @CMDLINE@ noinitrd console=ttyS0,115200 console=tty0" to boot-file
+unfreeze
+boot
diff --git a/target/linux/x86/olpc/base-files/etc/X11/xorg.conf b/target/linux/x86/olpc/base-files/etc/X11/xorg.conf
new file mode 100644
index 0000000..d98a8f8
--- /dev/null
+++ b/target/linux/x86/olpc/base-files/etc/X11/xorg.conf
@@ -0,0 +1,71 @@
+# xorg configuration
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen 0 "Screen0" 0 0
+ InputDevice "Mouse0" "CorePointer"
+ InputDevice "Keyboard0" "CoreKeyboard"
+EndSection
+
+Section "Files"
+ FontPath "/usr/lib/X11/fonts/misc"
+EndSection
+
+Section "Module"
+ Load "dbe"
+ Load "extmod"
+ Load "fbdevhw"
+# Load "glx"
+ Load "record"
+ Load "freetype"
+ Load "type1"
+EndSection
+
+Section "InputDevice"
+ Identifier "Keyboard0"
+ Driver "keyboard"
+ Option "XkbModel" "pc105"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Mouse0"
+ Driver "mouse"
+ Option "Protocol" "PS/2"
+ Option "Device" "/dev/psaux"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "yes"
+EndSection
+
+Section "Monitor"
+ Identifier "Monitor0"
+ VendorName "Monitor Vendor"
+ ModelName "OWRT"
+ Option "dpms"
+EndSection
+
+Section "Device"
+ Identifier "FBDev"
+ Driver "fbdev"
+ #Option "shadowfb" "off"
+ VideoRam 4096
+EndSection
+
+Section "Screen"
+ Identifier "Screen0"
+ Device "FBDev"
+ Monitor "Monitor0"
+ DefaultDepth 16
+
+ SubSection "Display"
+ Depth 16
+ Modes "1200x900-75"
+ EndSubsection
+
+EndSection
+
+Section "DRI"
+ Group 0
+ Mode 0666
+EndSection
+
diff --git a/target/linux/x86/olpc/base-files/etc/config/network b/target/linux/x86/olpc/base-files/etc/config/network
new file mode 100644
index 0000000..faa8f0e
--- /dev/null
+++ b/target/linux/x86/olpc/base-files/etc/config/network
@@ -0,0 +1,11 @@
+# Copyright (C) 2006 OpenWrt.org
+
+config interface loopback
+ option ifname lo
+ option proto static
+ option ipaddr 127.0.0.1
+ option netmask 255.0.0.0
+
+config interface wlan
+ option ifname eth0
+ option proto dhcp
diff --git a/target/linux/x86/olpc/base-files/etc/preinit.arch b/target/linux/x86/olpc/base-files/etc/preinit.arch
new file mode 100644
index 0000000..f29f0d4
--- /dev/null
+++ b/target/linux/x86/olpc/base-files/etc/preinit.arch
@@ -0,0 +1,2 @@
+mount -t proc none /proc
+grep 'failsafe=' /proc/cmdline && export FAILSAFE=true
diff --git a/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh b/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000..ffd0b93
--- /dev/null
+++ b/target/linux/x86/olpc/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,27 @@
+platform_check_image() {
+ [ "$ARGC" -gt 1 ] && return 1
+
+ case "$(get_magic_word "$1")" in
+ 48eb) return 0;;
+ *)
+ echo "Invalid image type"
+ return 1
+ ;;
+ esac
+}
+
+platform_do_upgrade() {
+ get_image "$1" > /dev/hda
+ sync
+}
+
+x86_prepare_ext2() {
+ # if we're running from ext2, we need to make sure that we have a mtd
+ # partition that points to the active rootfs partition.
+ # however this only matters if we actually need to preserve the config files
+ [ "$SAVE_CONFIG" -eq 1 ] && return 0
+ grep rootfs /proc/mtd >/dev/null || {
+ echo /dev/hda2,65536,rootfs > /sys/module/block2mtd/parameters/block2mtd
+ }
+}
+append sysupgrade_pre_upgrade x86_prepare_ext2
diff --git a/target/linux/x86/olpc/config-default b/target/linux/x86/olpc/config-default
new file mode 100644
index 0000000..f4f32e0
--- /dev/null
+++ b/target/linux/x86/olpc/config-default
@@ -0,0 +1,528 @@
+CONFIG_4KSTACKS=y
+# CONFIG_64BIT is not set
+CONFIG_ACPI=y
+CONFIG_ACPI_AC=y
+# CONFIG_ACPI_ASUS is not set
+CONFIG_ACPI_BATTERY=y
+CONFIG_ACPI_BLACKLIST_YEAR=0
+CONFIG_ACPI_BUTTON=y
+# CONFIG_ACPI_CONTAINER is not set
+# CONFIG_ACPI_CUSTOM_DSDT is not set
+# CONFIG_ACPI_DEBUG is not set
+# CONFIG_ACPI_DOCK is not set
+CONFIG_ACPI_FAN=y
+# CONFIG_ACPI_PCI_SLOT is not set
+CONFIG_ACPI_PROCESSOR=y
+# CONFIG_ACPI_PROCFS is not set
+CONFIG_ACPI_PROCFS_POWER=y
+CONFIG_ACPI_PROC_EVENT=y
+# CONFIG_ACPI_SBS is not set
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SYSFS_POWER=y
+CONFIG_ACPI_THERMAL=y
+# CONFIG_ACPI_TOSHIBA is not set
+# CONFIG_ACPI_WMI is not set
+# CONFIG_AGP is not set
+# CONFIG_APM is not set
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_ASUS_LAPTOP is not set
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
+# CONFIG_BACKLIGHT_PROGEAR is not set
+# CONFIG_BACKLIGHT_SAHARA is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+CONFIG_BASE_SMALL=0
+CONFIG_BATTERY_OLPC=y
+CONFIG_BINARY_PRINTF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_BITREVERSE=y
+# CONFIG_BLK_DEV is not set
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOT_PRINTK_DELAY is not set
+CONFIG_BOUNCE=y
+CONFIG_CAN_PM_TRACE=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CHR_DEV_SG=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_COMPAL_LAPTOP is not set
+CONFIG_COMPAT_VDSO=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+# CONFIG_CPA_DEBUG is not set
+CONFIG_CPU_FREQ=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_CPU_SUP_AMD=y
+# CONFIG_CPU_SUP_CENTAUR is not set
+# CONFIG_CPU_SUP_CYRIX_32 is not set
+# CONFIG_CPU_SUP_INTEL is not set
+# CONFIG_CPU_SUP_TRANSMETA_32 is not set
+# CONFIG_CPU_SUP_UMC_32 is not set
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CS5535_GPIO is not set
+# CONFIG_DCDBAS is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_BOOT_PARAMS is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_INFO is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_NX_TEST is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_RODATA is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_DELL_RBU is not set
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_DEVPORT=y
+CONFIG_DISPLAY_SUPPORT=y
+# CONFIG_DMA_API_DEBUG is not set
+CONFIG_DMI=y
+CONFIG_DMIID=y
+CONFIG_DOUBLEFAULT=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_EARLY_PRINTK=y
+# CONFIG_EARLY_PRINTK_DBGP is not set
+# CONFIG_EDAC is not set
+# CONFIG_EDD is not set
+# CONFIG_EEEPC_LAPTOP is not set
+# CONFIG_EFI is not set
+CONFIG_ELF_CORE=y
+CONFIG_EXT2_FS=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_FB=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_GEODE=y
+# CONFIG_FB_GEODE_GX is not set
+# CONFIG_FB_GEODE_GX1 is not set
+CONFIG_FB_GEODE_LX=y
+# CONFIG_FCOE_FNIC is not set
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FIRMWARE_MEMMAP is not set
+CONFIG_FIX_EARLYCON_MEM=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x16=y
+CONFIG_FONT_8x8=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FRAME_POINTER is not set
+CONFIG_FREEZER=y
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_FTRACE_SYSCALLS is not set
+# CONFIG_FUJITSU_LAPTOP is not set
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+# CONFIG_GENERIC_CPU is not set
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_GEODE_MFGPT_TIMER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_HANGCHECK_TIMER is not set
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAVE_AOUT=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_ATOMIC_IOMAP=y
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_DYNAMIC_PER_CPU_AREA=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FTRACE_SYSCALLS=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_KVM_IRQCHIP=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_HAVE_MLOCK=y
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+CONFIG_HIBERNATION=y
+CONFIG_HID=y
+CONFIG_HID_SUPPORT=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+# CONFIG_HPET is not set
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_HPET_TIMER=y
+CONFIG_HT_IRQ=y
+# CONFIG_HUGETLBFS is not set
+CONFIG_HW_CONSOLE=y
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_AMD is not set
+CONFIG_HW_RANDOM_GEODE=y
+# CONFIG_HW_RANDOM_INTEL is not set
+CONFIG_HW_RANDOM_VIA=y
+# CONFIG_I2C is not set
+# CONFIG_I8K is not set
+# CONFIG_IMA is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INPUT=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_INPUT_MOUSE=y
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1200
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=900
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INTEL_MENLOW is not set
+# CONFIG_IOMMU_API is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_ISA is not set
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+# CONFIG_ISDN is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KERNEL_BZIP2 is not set
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_KEXEC=y
+# CONFIG_KEXEC_JUMP is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_LKKBD 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_KGDB is not set
+CONFIG_KTIME_SCALAR=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_ILI9320 is not set
+# CONFIG_LCD_PLATFORM is not set
+# CONFIG_LEDS_ALIX2 is not set
+# CONFIG_LEDS_CLEVO_MAIL is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_LOGO is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M686 is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_MARKERS=y
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_MCA is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_MGEODEGX1 is not set
+CONFIG_MGEODE_LX=y
+# CONFIG_MICROCODE is not set
+# CONFIG_MISC_DEVICES is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_SDHCI=y
+# CONFIG_MMIOTRACE is not set
+# CONFIG_MOUSE_BCM5974 is not set
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_OLPC=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPSC is not set
+# CONFIG_MSI_LAPTOP is not set
+CONFIG_MTD_BLOCK2MTD=y
+# CONFIG_MTD_CFI is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_PCI=y
+# CONFIG_MTD_TS5500 is not set
+# CONFIG_MTRR is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+# CONFIG_NET_DROP_MONITOR is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NOHIGHMEM=y
+CONFIG_NOP_TRACER=y
+CONFIG_NO_HZ=y
+CONFIG_NR_CPUS=1
+# CONFIG_NSC_GPIO is not set
+CONFIG_NVRAM=y
+CONFIG_OLPC=y
+CONFIG_OPROFILE=y
+# CONFIG_OPTIMIZE_INLINING is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PANASONIC_LAPTOP is not set
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_PARTITION_ADVANCED is not set
+# CONFIG_PC8736x_GPIO is not set
+CONFIG_PCI=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_PCI_DEBUG is not set
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_GOANY is not set
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GODIRECT is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+CONFIG_PCI_GOOLPC=y
+CONFIG_PCI_OLPC=y
+CONFIG_PCSPKR_PLATFORM=y
+# CONFIG_PDA_POWER is not set
+CONFIG_PHYSICAL_ALIGN=0x100000
+CONFIG_PHYSICAL_START=0x100000
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+CONFIG_PM_SLEEP=y
+CONFIG_PM_STD_PARTITION=""
+# CONFIG_PM_TRACE_RTC is not set
+# CONFIG_PM_VERBOSE is not set
+CONFIG_PNP=y
+CONFIG_PNPACPI=y
+CONFIG_PNP_DEBUG_MESSAGES=y
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_POWER_TRACER is not set
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_PROCESSOR_SELECT=y
+CONFIG_PROFILING=y
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_RELAY=y
+# CONFIG_RELOCATABLE is not set
+CONFIG_RING_BUFFER=y
+CONFIG_RTC=y
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_SCHEDSTATS=y
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHED_HRTICK=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_SCSI=y
+# CONFIG_SCx200 is not set
+# CONFIG_SDIO_UART is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIO=y
+# CONFIG_SERIO_CT82C710 is not set
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_PCIPS2 is not set
+# CONFIG_SERIO_RAW is not set
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SLOW_WORK is not set
+# CONFIG_SMP is not set
+# CONFIG_SONYPI is not set
+CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSE_IRQ is not set
+CONFIG_STACKTRACE=y
+CONFIG_STRICT_DEVMEM=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_TC1100_WMI is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_THERMAL=y
+# CONFIG_THINKPAD_ACPI is not set
+CONFIG_TICK_ONESHOT=y
+CONFIG_TIMER_STATS=y
+# CONFIG_TOSHIBA is not set
+CONFIG_TRACEPOINTS=y
+CONFIG_TRACING=y
+CONFIG_TRACING_SUPPORT=y
+CONFIG_UID16=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
+CONFIG_VGA_CONSOLE=y
+CONFIG_VM86=y
+# CONFIG_VMSPLIT_2G_OPT is not set
+# CONFIG_VMSPLIT_3G_OPT is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_X86=y
+CONFIG_X86_32=y
+CONFIG_X86_32_LAZY_GS=y
+# CONFIG_X86_64 is not set
+# CONFIG_X86_ACPI_CPUFREQ is not set
+CONFIG_X86_BSWAP=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_CPU=y
+# CONFIG_X86_CPUFREQ_NFORCE2 is not set
+# CONFIG_X86_CPUID is not set
+# CONFIG_X86_CPU_DEBUG is not set
+CONFIG_X86_DEBUGCTLMSR=y
+# CONFIG_X86_DS is not set
+# CONFIG_X86_ELAN is not set
+CONFIG_X86_EXTENDED_PLATFORM=y
+# CONFIG_X86_E_POWERSAVER is not set
+CONFIG_X86_GENERIC=y
+# CONFIG_X86_GX_SUSPMOD is not set
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_INTERNODE_CACHE_BYTES=64
+CONFIG_X86_INVLPG=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_L1_CACHE_BYTES=64
+CONFIG_X86_L1_CACHE_SHIFT=5
+CONFIG_X86_LOCAL_APIC=y
+# CONFIG_X86_LONGHAUL is not set
+# CONFIG_X86_LONGRUN is not set
+# CONFIG_X86_MCE is not set
+CONFIG_X86_MINIMUM_CPU_FAMILY=4
+CONFIG_X86_MPPARSE=y
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_P4_CLOCKMOD is not set
+# CONFIG_X86_PAE is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_X86_POPAD_OK=y
+# CONFIG_X86_POWERNOW_K6 is not set
+# CONFIG_X86_POWERNOW_K7 is not set
+# CONFIG_X86_POWERNOW_K8 is not set
+# CONFIG_X86_PTDUMP is not set
+# CONFIG_X86_RDC321X is not set
+# CONFIG_X86_REBOOTFIXUPS is not set
+# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
+# CONFIG_X86_RESERVE_LOW_64K is not set
+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
+# CONFIG_X86_SPEEDSTEP_ICH is not set
+# CONFIG_X86_SPEEDSTEP_LIB is not set
+# CONFIG_X86_SPEEDSTEP_SMI is not set
+CONFIG_X86_TSC=y
+CONFIG_X86_UP_APIC=y
+CONFIG_X86_UP_IOAPIC=y
+CONFIG_X86_USE_3DNOW=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_VERBOSE_BOOTUP=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_XADD=y
+# CONFIG_ZONE_DMA32 is not set
diff --git a/target/linux/x86/olpc/target.mk b/target/linux/x86/olpc/target.mk
new file mode 100644
index 0000000..9ed2edc
--- /dev/null
+++ b/target/linux/x86/olpc/target.mk
@@ -0,0 +1,2 @@
+BOARDNAME:=OLPC XO-1
+DEFAULT_PACKAGES += kmod-natsemi kmod-ne2k-pci kmod-libertas
diff --git a/target/linux/x86/patches-2.6.30/300-block2mtd_init.patch b/target/linux/x86/patches-2.6.30/300-block2mtd_init.patch
new file mode 100644
index 0000000..12165b5
--- /dev/null
+++ b/target/linux/x86/patches-2.6.30/300-block2mtd_init.patch
@@ -0,0 +1,210 @@
+--- a/arch/x86/kernel/vmlinux_32.lds.S
++++ b/arch/x86/kernel/vmlinux_32.lds.S
+@@ -136,6 +136,12 @@ SECTIONS
+ INITCALLS
+ __initcall_end = .;
+ }
++ .root_initcall.init : AT(ADDR(.root_initcall.init) - LOAD_OFFSET) {
++ __root_initcall_start = .;
++ INITCALLS_ROOT
++ __root_initcall_end = .;
++ }
++
+ .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
+ __con_initcall_start = .;
+ *(.con_initcall.init)
+--- a/drivers/mtd/devices/block2mtd.c
++++ b/drivers/mtd/devices/block2mtd.c
+@@ -18,10 +18,18 @@
+ #include <linux/buffer_head.h>
+ #include <linux/mutex.h>
+ #include <linux/mount.h>
++#include <linux/list.h>
++#include <linux/delay.h>
+
+ #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
+ #define INFO(fmt, args...) printk(KERN_INFO "block2mtd: " fmt "\n" , ## args)
+
++struct retry {
++ struct list_head list;
++ const char *val;
++};
++
++static LIST_HEAD(retry_list);
+
+ /* Info for the block device */
+ struct block2mtd_dev {
+@@ -33,10 +41,34 @@ struct block2mtd_dev {
+ char devname[0];
+ };
+
++static int block2mtd_setup2(const char *val);
+
+ /* Static info about the MTD, used in cleanup_module */
+ static LIST_HEAD(blkmtd_device_list);
+
++static int add_retry(const char *val) {
++ struct retry *r = kmalloc(sizeof(struct retry), GFP_KERNEL);
++
++ INIT_LIST_HEAD(&r->list);
++ r->val = val;
++ list_add(&r->list, &retry_list);
++
++ return 0;
++}
++
++static int __init process_retries(void) {
++ struct list_head *p, *tmp;
++
++ list_for_each_safe(p, tmp, &retry_list) {
++ struct retry *r = list_entry(p, struct retry, list);
++ block2mtd_setup2(r->val);
++ msleep(100);
++ list_del(p);
++ kfree(r);
++ }
++ return 0;
++}
++rootfs_initcall(process_retries);
+
+ static struct page *page_read(struct address_space *mapping, int index)
+ {
+@@ -510,7 +542,9 @@ static int block2mtd_setup2(const char *
+ if (token[2] && (strlen(token[2]) + 1 > 80))
+ parse_err("mtd device name too long");
+
+- add_device(name, erase_size, token[2]);
++ if (add_device(name, erase_size, token[2]) == NULL) {
++ add_retry(val);
++ }
+
+ return 0;
+ }
+--- a/include/asm-generic/vmlinux.lds.h
++++ b/include/asm-generic/vmlinux.lds.h
+@@ -447,12 +447,14 @@
+ *(.initcall4s.init) \
+ *(.initcall5.init) \
+ *(.initcall5s.init) \
+- *(.initcallrootfs.init) \
+ *(.initcall6.init) \
+ *(.initcall6s.init) \
+ *(.initcall7.init) \
+ *(.initcall7s.init)
+
++#define INITCALLS_ROOT \
++ *(.initcallrootfs.init)
++
+ /**
+ * PERCPU_VADDR - define output section for percpu area
+ * @vaddr: explicit base address (optional)
+--- a/init/do_mounts.c
++++ b/init/do_mounts.c
+@@ -176,16 +176,8 @@ static int __init fs_names_setup(char *s
+ return 1;
+ }
+
+-static unsigned int __initdata root_delay;
+-static int __init root_delay_setup(char *str)
+-{
+- root_delay = simple_strtoul(str, NULL, 0);
+- return 1;
+-}
+-
+ __setup("rootflags=", root_data_setup);
+ __setup("rootfstype=", fs_names_setup);
+-__setup("rootdelay=", root_delay_setup);
+
+ static void __init get_fs_names(char *page)
+ {
+@@ -365,23 +357,6 @@ void __init prepare_namespace(void)
+ {
+ int is_floppy;
+
+- if (root_delay) {
+- printk(KERN_INFO "Waiting %dsec before mounting root device...\n",
+- root_delay);
+- ssleep(root_delay);
+- }
+-
+- /*
+- * wait for the known devices to complete their probing
+- *
+- * Note: this is a potential source of long boot delays.
+- * For example, it is not atypical to wait 5 seconds here
+- * for the touchpad of a laptop to initialize.
+- */
+- wait_for_device_probe();
+-
+- md_run_setup();
+-
+ if (saved_root_name[0]) {
+ root_device_name = saved_root_name;
+ if (!strncmp(root_device_name, "mtd", 3) ||
+--- a/init/main.c
++++ b/init/main.c
+@@ -76,6 +76,7 @@
+ #ifdef CONFIG_X86_LOCAL_APIC
+ #include <asm/smp.h>
+ #endif
++#include "do_mounts.h"
+
+ static int kernel_init(void *);
+
+@@ -752,12 +753,13 @@ int do_one_initcall(initcall_t fn)
+
+
+ extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
++extern initcall_t __root_initcall_start[], __root_initcall_end[];
+
+-static void __init do_initcalls(void)
++static void __init do_initcalls(initcall_t *start, initcall_t *end)
+ {
+ initcall_t *call;
+
+- for (call = __early_initcall_end; call < __initcall_end; call++)
++ for (call = start; call < end; call++)
+ do_one_initcall(*call);
+
+ /* Make sure there is no pending stuff from the initcall sequence */
+@@ -779,7 +781,7 @@ static void __init do_basic_setup(void)
+ usermodehelper_init();
+ driver_init();
+ init_irq_proc();
+- do_initcalls();
++ do_initcalls(__early_initcall_end, __initcall_end);
+ }
+
+ static void __init do_pre_smp_initcalls(void)
+@@ -840,6 +842,13 @@ static noinline int init_post(void)
+ panic("No init found. Try passing init= option to kernel.");
+ }
+
++static unsigned int __initdata root_delay;
++static int __init root_delay_setup(char *str)
++{
++ root_delay = simple_strtoul(str, NULL, 0);
++ return 1;
++}
++__setup("rootdelay=", root_delay_setup);
+ static int __init kernel_init(void * unused)
+ {
+ lock_kernel();
+@@ -879,7 +888,16 @@ static int __init kernel_init(void * unu
+
+ if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
+ ramdisk_execute_command = NULL;
+- prepare_namespace();
++ if (root_delay) {
++ printk(KERN_INFO "Waiting %desc before mounting root device...\n",
++ root_delay);
++ ssleep(root_delay);
++ }
++ while (driver_probe_done() != 0)
++ msleep(100);
++ md_run_setup();
++ do_initcalls(__root_initcall_start, __root_initcall_end);
++ prepare_namespace();
+ }
+
+ /*