From: Gerry Rozema Date: Thu, 20 Jul 2006 21:06:47 +0000 (+0000) Subject: UML target completed. Added ext2 target fs for use with uml images X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=186787ea88ef042b344e1a451531fa32258c5025;p=openwrt%2Fstaging%2Fwigyori.git UML target completed. Added ext2 target fs for use with uml images SVN-Revision: 4178 --- diff --git a/openwrt/Config.in b/openwrt/Config.in index a2e6bddd26..e059f06ab5 100644 --- a/openwrt/Config.in +++ b/openwrt/Config.in @@ -74,6 +74,14 @@ menu "Target Images" depends !TARGET_ROOTFS_INITRAMFS help Build a compressed tar archive of the the root filesystem + + config TARGET_ROOTFS_EXT2FS + bool "ext2" + default n + depends !TARGET_ROOTFS_INITRAMFS + help + Ext2 file system with some free space for uml images + endmenu diff --git a/openwrt/include/image.mk b/openwrt/include/image.mk index 95accd6e1d..54f0e8b6bc 100644 --- a/openwrt/include/image.mk +++ b/openwrt/include/image.mk @@ -44,6 +44,14 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) tar -zcf $(BIN_DIR)/openwrt-rootfs.tgz --owner=root --group=root -C $(BUILD_DIR)/root/ . endef endif + + ifeq ($(CONFIG_TARGET_ROOTFS_EXT2FS),y) + define Image/mkfs/ext2 + genext2fs -q -b 4096 -I 1500 -d $(BUILD_DIR)/root/ $(KDIR)/root.ext2 + $(call Image/Build,ext2) + endef + endif + endif define Image/mkfs/prepare/default @@ -69,6 +77,7 @@ install: $(call Image/mkfs/jffs2) $(call Image/mkfs/squashfs) $(call Image/mkfs/tgz) + $(call Image/mkfs/ext2) clean: $(call Build/Clean) diff --git a/openwrt/include/kernel-build.mk b/openwrt/include/kernel-build.mk index 942a91516b..f46e7f0ff3 100644 --- a/openwrt/include/kernel-build.mk +++ b/openwrt/include/kernel-build.mk @@ -72,13 +72,13 @@ $(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile pkg-install ramdisk-config $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) $(LINUX_KERNEL): $(LINUX_DIR)/vmlinux - $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ + $(KERNEL_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@ touch -c $(LINUX_KERNEL) $(LINUX_DIR)/.modules_done: rm -rf $(KERNEL_BUILD_DIR)/modules $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH="$(TARGET_PATH)" modules - $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" DEPMOD=true INSTALL_MOD_PATH=$(KERNEL_BUILD_DIR)/modules modules_install + $(MAKE) -C "$(LINUX_DIR)" CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) DEPMOD=true INSTALL_MOD_PATH=$(KERNEL_BUILD_DIR)/modules modules_install touch $(LINUX_DIR)/.modules_done modules: $(LINUX_DIR)/.modules_done diff --git a/openwrt/include/kernel.mk b/openwrt/include/kernel.mk index 2c5d093778..318ca6869d 100644 --- a/openwrt/include/kernel.mk +++ b/openwrt/include/kernel.mk @@ -28,6 +28,11 @@ LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \ -e 's/armeb/arm/' \ ) +ifneq (,$(findstring uml,$(BOARD))) +LINUX_KARCH="um" +KERNEL_CROSS= +endif + KERNEL_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD) LINUX_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) diff --git a/openwrt/include/target.mk b/openwrt/include/target.mk index 44ff11128a..95bd1dbfb3 100644 --- a/openwrt/include/target.mk +++ b/openwrt/include/target.mk @@ -18,6 +18,7 @@ $(eval $(call kernel_template,2.6,brcm,2_6_BRCM)) $(eval $(call kernel_template,2.6,brcm63xx,2_6_BRCM63XX)) $(eval $(call kernel_template,2.6,rb532,2_6_RB532)) $(eval $(call kernel_template,2.6,x86,2_6_X86)) +$(eval $(call kernel_template,2.6,uml,2_6_UML)) $(eval $(call kernel_template,2.4,ar531x,2_4_AR531X)) $(eval $(call kernel_template,2.6,aruba,2_6_ARUBA)) $(eval $(call kernel_template,2.6,au1000,2_6_AU1000)) diff --git a/openwrt/target/Config.in b/openwrt/target/Config.in index 5dd905c75c..5b85eadb3f 100644 --- a/openwrt/target/Config.in +++ b/openwrt/target/Config.in @@ -83,6 +83,14 @@ config LINUX_2_6_X86 Build firmware images for x86 based boards (e.g. Soekris net4521 and net4801, PC Engines WRAP...) +config LINUX_2_6_UML + bool "x86 [uml]" + select i386 + select LINUX_2_6 + help + Build uml targetted images + + config LINUX_2_6_AU1000 bool "AMD Alchemy AUxx [2.6]" select mipsel diff --git a/openwrt/target/image/uml/Makefile b/openwrt/target/image/uml/Makefile new file mode 100755 index 0000000000..6af4b8b816 --- /dev/null +++ b/openwrt/target/image/uml/Makefile @@ -0,0 +1,15 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +define Image/Build + cp $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img + cp $(LINUX_DIR)/linux $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinux +endef + +$(eval $(call BuildImage)) diff --git a/openwrt/target/linux/uml-2.6/config b/openwrt/target/linux/uml-2.6/config index 82433d9b18..b44ca40dc0 100644 --- a/openwrt/target/linux/uml-2.6/config +++ b/openwrt/target/linux/uml-2.6/config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.17 -# Tue Jul 18 01:55:58 2006 +# Thu Jul 20 13:48:28 2006 # CONFIG_GENERIC_HARDIRQS=y CONFIG_UML=y @@ -77,8 +77,8 @@ CONFIG_LD_SCRIPT_DYN=y CONFIG_NET=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set -CONFIG_HOSTFS=y -CONFIG_HPPFS=y +# CONFIG_HOSTFS is not set +# CONFIG_HPPFS is not set CONFIG_MCONSOLE=y # CONFIG_MAGIC_SYSRQ is not set CONFIG_NEST_LEVEL=0 @@ -106,9 +106,7 @@ CONFIG_SYSCTL=y # CONFIG_AUDIT is not set # CONFIG_IKCONFIG is not set # CONFIG_RELAY is not set -CONFIG_INITRAMFS_SOURCE="../../root" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_INITRAMFS_SOURCE="" CONFIG_UID16=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y @@ -166,7 +164,9 @@ CONFIG_BLK_DEV_COW_COMMON=y CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m -# CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_ATA_OVER_ETH is not set @@ -184,13 +184,13 @@ CONFIG_XTERM_CHAN=y # CONFIG_NOCONFIG_CHAN is not set CONFIG_CON_ZERO_CHAN="fd:0,fd:1" CONFIG_CON_CHAN="xterm" -CONFIG_SSL_CHAN="pty" +CONFIG_SSL_CHAN="xterm" CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set CONFIG_WATCHDOG=y CONFIG_WATCHDOG_NOWAYOUT=y CONFIG_SOFT_WATCHDOG=m -CONFIG_UML_WATCHDOG=m +# CONFIG_UML_WATCHDOG is not set # CONFIG_UML_SOUND is not set # CONFIG_SOUND is not set # CONFIG_HOSTAUDIO is not set @@ -529,7 +529,7 @@ CONFIG_UML_NET_SLIP=y CONFIG_UML_NET_DAEMON=y CONFIG_UML_NET_MCAST=y # CONFIG_UML_NET_PCAP is not set -CONFIG_UML_NET_SLIRP=y +# CONFIG_UML_NET_SLIRP is not set # # Network device support @@ -589,12 +589,12 @@ CONFIG_CONNECTOR=m # # File systems # -CONFIG_EXT2_FS=m +CONFIG_EXT2_FS=y # CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=m +CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_XATTR is not set -CONFIG_JBD=m +CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set