aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/uml
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/uml')
-rw-r--r--target/linux/uml/Makefile36
-rw-r--r--target/linux/uml/README45
-rw-r--r--target/linux/uml/config/i386168
-rw-r--r--target/linux/uml/config/x86_64147
-rw-r--r--target/linux/uml/image/Makefile19
-rw-r--r--target/linux/uml/patches-3.2/901-lib_zlib_deflate_visible.patch14
-rw-r--r--target/linux/uml/patches-3.3/001-include_sys_resource_h.patch10
-rw-r--r--target/linux/uml/patches-3.3/901-lib_zlib_deflate_visible.patch14
8 files changed, 453 insertions, 0 deletions
diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile
new file mode 100644
index 000000000..d8bfcef3f
--- /dev/null
+++ b/target/linux/uml/Makefile
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2006-2011 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)/host.mk
+
+# UML only makes sense on linux
+ifeq ($(HOST_OS),Linux)
+
+ARCH:=$(shell uname -m | sed \
+ -e 's/i[3-9]86/i386/' \
+ -e 's/mipsel/mips/' \
+ -e 's/mipseb/mips/' \
+ -e 's/powerpc/ppc/' \
+ -e 's/sh[234]/sh/' \
+ -e 's/armeb/arm/' \
+)
+BOARD:=uml
+BOARDNAME:=User Mode Linux
+FEATURES:=ext4 audio
+MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+LINUX_VERSION:=3.3.8
+
+include $(INCLUDE_DIR)/target.mk
+
+LINUX_TARGET_CONFIG:=$(CURDIR)/config/$(ARCH)
+
+DEFAULT_PACKAGES += wpad-mini kmod-mac80211-hwsim
+
+endif
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/uml/README b/target/linux/uml/README
new file mode 100644
index 000000000..c71448555
--- /dev/null
+++ b/target/linux/uml/README
@@ -0,0 +1,45 @@
+Openwrt inside a user mode linux. Why would we even want this many ask?
+
+There are potentially a lot of reasons, one obvious one to me, it allows
+folks to 'kick the tires' without actually flashing up any hardware. It's
+also a great environment for porting over packages, you can get a package
+fully functional in the uclibc root environment inside a uml without actually
+disturbing your 'real router', and then rebuild for a specific target once
+it's fully tested.
+
+This is a first stab at a build that 'just works' and there will be more
+cleanup to come. The simple directions are:-
+
+Configure for uml target
+Configure with an ext4 root file system
+build it all
+
+In your bin directory you will find a kernel and an ext4 root file system
+when it's finished. Just run it like this:-
+
+bin/uml/openwrt-uml-vmlinux ubd0=bin/uml/openwrt-uml-ext4.img con=null ssl=null ssl0=fd:0,fd:1 con0=null,fd:2
+
+The uml will start, and eventually the serial console of the uml will be at your
+console prompt. If you would like it in xterms, substitute con=xterm and con0=xterm.
+No networking is configured, but, it's a starting point. The resulting file system
+has just enough free space to start kicking the tires and playing in the world of
+'embedded routers' along with all the resource restrictions that come with that
+world.
+
+To configure networking and more, refer to the user mode linux documentation online.
+A quick start goes along this line. install the uml-utilities packages so you have
+the uml switch in and running, then add a command param to your uml start like this
+
+eth0=daemon,00:01:01:01:01:01,unix,/<your uml switch control socket here>
+
+With that in, and uml networking actually functional (can be a challenge at times),
+you should be able to ifconfig the interface and talk to the host side, or, if you
+bridged the uml switch to your host network, you should be able to run udhcp and be
+away with networking off to the world. Again, if you are unfamiliar with uml and
+uml networking, please read the docs and how-to stuff available on the net. It does
+take some fiddling to get it started and working right the first time, but after that,
+it opens up a whole new world of virtual machines.
+
+
+
+http://user-mode-linux.sourceforge.net/
diff --git a/target/linux/uml/config/i386 b/target/linux/uml/config/i386
new file mode 100644
index 000000000..e5c1ce421
--- /dev/null
+++ b/target/linux/uml/config/i386
@@ -0,0 +1,168 @@
+# CONFIG_3_LEVEL_PGTABLES is not set
+# CONFIG_64BIT is not set
+CONFIG_ARCH_HAS_SC_SIGNALS=y
+CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
+CONFIG_BKL=y
+CONFIG_BLK_DEV_COW_COMMON=y
+CONFIG_BLK_DEV_UBD=y
+CONFIG_BLK_DEV_UBD_SYNC=y
+CONFIG_CON_CHAN="xterm"
+CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR=y
+CONFIG_CPU_SUP_CYRIX_32=y
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_TRANSMETA_32=y
+CONFIG_CPU_SUP_UMC_32=y
+CONFIG_CRAMFS=y
+# CONFIG_CRASHLOG is not set
+CONFIG_CRC16=y
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
+CONFIG_DNOTIFY=y
+CONFIG_ELF_CORE=y
+# CONFIG_EMBEDDED is not set
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+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_HAMRADIO is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+# CONFIG_HAVE_GENERIC_HARDIRQS is not set
+CONFIG_HOSTAUDIO=m
+CONFIG_HOSTFS=y
+# CONFIG_HPPFS is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INIT_ENV_ARG_LIMIT=128
+CONFIG_IOSCHED_CFQ=y
+CONFIG_IRQ_RELEASE_METHOD=y
+CONFIG_ISO9660_FS=y
+CONFIG_JBD=y
+CONFIG_JBD2=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_KERNEL_STACK_ORDER=2
+CONFIG_LD_SCRIPT_STATIC=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# 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_MAGIC_SYSRQ=y
+# CONFIG_MATOM is not set
+CONFIG_MCONSOLE=y
+# CONFIG_MCORE2 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MINI_FO is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MMAPPER is not set
+# CONFIG_MPENTIUM4 is not set
+CONFIG_MPENTIUMII=y
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM 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_NAMESPACES=y
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_NET_NS is not set
+CONFIG_NLS=y
+# CONFIG_NOCONFIG_CHAN is not set
+CONFIG_NO_DMA=y
+CONFIG_NO_IOMEM=y
+CONFIG_NULL_CHAN=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PORT_CHAN=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROCESSOR_SELECT is not set
+CONFIG_PTY_CHAN=y
+CONFIG_QFMT_V1=y
+CONFIG_QFMT_V2=y
+CONFIG_QUOTA=y
+CONFIG_QUOTACTL=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_QUOTA_TREE=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_GZIP=y
+CONFIG_RELAY=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SMP_BROKEN is not set
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SQUASHFS_EMBEDDED=y
+CONFIG_SSL=y
+CONFIG_SSL_CHAN="pty"
+# CONFIG_STACKTRACE_SUPPORT is not set
+CONFIG_STATIC_LINK=y
+CONFIG_STDERR_CONSOLE=y
+CONFIG_STDIO_CONSOLE=y
+# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
+CONFIG_TTY_CHAN=y
+CONFIG_UID16=y
+CONFIG_UML=y
+CONFIG_UML_NET=y
+CONFIG_UML_NET_DAEMON=y
+CONFIG_UML_NET_ETHERTAP=y
+CONFIG_UML_NET_MCAST=y
+# CONFIG_UML_NET_PCAP is not set
+CONFIG_UML_NET_SLIP=y
+CONFIG_UML_NET_SLIRP=y
+CONFIG_UML_NET_TUNTAP=y
+# CONFIG_UML_NET_VDE is not set
+CONFIG_UML_RANDOM=y
+CONFIG_UML_SOUND=m
+CONFIG_UML_WATCHDOG=m
+CONFIG_UML_X86=y
+# CONFIG_USER_NS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_X86_32=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CPU=y
+CONFIG_X86_GENERIC=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_INTERNODE_CACHE_SHIFT=6
+CONFIG_X86_INVLPG=y
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_MINIMUM_CPU_FAMILY=5
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_TSC=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_XADD=y
+CONFIG_XTERM_CHAN=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/uml/config/x86_64 b/target/linux/uml/config/x86_64
new file mode 100644
index 000000000..89d2e43d9
--- /dev/null
+++ b/target/linux/uml/config/x86_64
@@ -0,0 +1,147 @@
+CONFIG_3_LEVEL_PGTABLES=y
+CONFIG_64BIT=y
+# CONFIG_ARCH_HAS_SC_SIGNALS is not set
+# CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_BKL=y
+CONFIG_BLK_DEV_COW_COMMON=y
+CONFIG_BLK_DEV_UBD=y
+CONFIG_BLK_DEV_UBD_SYNC=y
+CONFIG_CON_CHAN="xterm"
+CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR=y
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CRAMFS=y
+# CONFIG_CRASHLOG is not set
+CONFIG_CRC16=y
+# CONFIG_CRYPTO_AES_NI_INTEL is not set
+# CONFIG_CRYPTO_AES_X86_64 is not set
+# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
+# CONFIG_CRYPTO_SALSA20_X86_64 is not set
+# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
+# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig"
+CONFIG_DNOTIFY=y
+CONFIG_ELF_CORE=y
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=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_HAMRADIO is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+# CONFIG_HAVE_GENERIC_HARDIRQS is not set
+CONFIG_HOSTAUDIO=m
+CONFIG_HOSTFS=y
+# CONFIG_HPPFS is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INIT_ENV_ARG_LIMIT=128
+CONFIG_IOSCHED_CFQ=y
+CONFIG_IRQ_RELEASE_METHOD=y
+CONFIG_ISO9660_FS=y
+CONFIG_JBD=y
+CONFIG_JBD2=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_KERNEL_STACK_ORDER=2
+CONFIG_LD_SCRIPT_STATIC=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_MATOM is not set
+CONFIG_MCONSOLE=y
+# CONFIG_MCORE2 is not set
+# CONFIG_MINI_FO is not set
+CONFIG_MK8=y
+# CONFIG_MMAPPER is not set
+# CONFIG_MPSC is not set
+CONFIG_NAMESPACES=y
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_NET_NS is not set
+CONFIG_NLS=y
+# CONFIG_NOCONFIG_CHAN is not set
+CONFIG_NO_DMA=y
+CONFIG_NO_IOMEM=y
+CONFIG_NULL_CHAN=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_PORT_CHAN=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_PRINT_QUOTA_WARNING is not set
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROCESSOR_SELECT is not set
+CONFIG_PTY_CHAN=y
+CONFIG_QFMT_V1=y
+CONFIG_QFMT_V2=y
+CONFIG_QUOTA=y
+CONFIG_QUOTACTL=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_QUOTA_TREE=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_GZIP=y
+CONFIG_RELAY=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SCSI_DMA is not set
+CONFIG_SMP_BROKEN=y
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SQUASHFS_EMBEDDED=y
+CONFIG_SSL=y
+CONFIG_SSL_CHAN="pty"
+# CONFIG_STACKTRACE_SUPPORT is not set
+CONFIG_STATIC_LINK=y
+CONFIG_STDERR_CONSOLE=y
+CONFIG_STDIO_CONSOLE=y
+# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set
+CONFIG_TTY_CHAN=y
+CONFIG_UID16=y
+CONFIG_UML=y
+CONFIG_UML_NET=y
+CONFIG_UML_NET_DAEMON=y
+CONFIG_UML_NET_ETHERTAP=y
+CONFIG_UML_NET_MCAST=y
+# CONFIG_UML_NET_PCAP is not set
+CONFIG_UML_NET_SLIP=y
+CONFIG_UML_NET_SLIRP=y
+CONFIG_UML_NET_TUNTAP=y
+# CONFIG_UML_NET_VDE is not set
+CONFIG_UML_RANDOM=y
+CONFIG_UML_SOUND=m
+CONFIG_UML_WATCHDOG=m
+CONFIG_UML_X86=y
+# CONFIG_USER_NS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_X86_32 is not set
+CONFIG_X86_CMOV=y
+# CONFIG_X86_CMPXCHG is not set
+CONFIG_X86_CPU=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_INTERNODE_CACHE_SHIFT=6
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_MINIMUM_CPU_FAMILY=3
+CONFIG_X86_TSC=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_XADD=y
+CONFIG_XTERM_CHAN=y
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/uml/image/Makefile b/target/linux/uml/image/Makefile
new file mode 100644
index 000000000..5e7247ecd
--- /dev/null
+++ b/target/linux/uml/image/Makefile
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2006-2010 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/Prepare
+ cp $(LINUX_DIR)/linux $(KDIR)/vmlinux.elf
+endef
+
+define Image/Build
+ cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
+ cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux
+endef
+
+$(eval $(call BuildImage))
diff --git a/target/linux/uml/patches-3.2/901-lib_zlib_deflate_visible.patch b/target/linux/uml/patches-3.2/901-lib_zlib_deflate_visible.patch
new file mode 100644
index 000000000..f4aba9bd7
--- /dev/null
+++ b/target/linux/uml/patches-3.2/901-lib_zlib_deflate_visible.patch
@@ -0,0 +1,14 @@
+make ZLIB_DEFLATE visible, so that we can choose whether we want it built-in
+or as a module
+
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -98,7 +98,7 @@ config ZLIB_INFLATE
+ tristate
+
+ config ZLIB_DEFLATE
+- tristate
++ tristate "Zlib compression"
+
+ config LZO_COMPRESS
+ tristate
diff --git a/target/linux/uml/patches-3.3/001-include_sys_resource_h.patch b/target/linux/uml/patches-3.3/001-include_sys_resource_h.patch
new file mode 100644
index 000000000..3804dee3f
--- /dev/null
+++ b/target/linux/uml/patches-3.3/001-include_sys_resource_h.patch
@@ -0,0 +1,10 @@
+--- a/arch/um/os-Linux/start_up.c
++++ b/arch/um/os-Linux/start_up.c
+@@ -15,6 +15,7 @@
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
++#include <sys/resource.h>
+ #include <asm/unistd.h>
+ #include "init.h"
+ #include "os.h"
diff --git a/target/linux/uml/patches-3.3/901-lib_zlib_deflate_visible.patch b/target/linux/uml/patches-3.3/901-lib_zlib_deflate_visible.patch
new file mode 100644
index 000000000..f2b6547d5
--- /dev/null
+++ b/target/linux/uml/patches-3.3/901-lib_zlib_deflate_visible.patch
@@ -0,0 +1,14 @@
+make ZLIB_DEFLATE visible, so that we can choose whether we want it built-in
+or as a module
+
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -108,7 +108,7 @@ config ZLIB_INFLATE
+ tristate
+
+ config ZLIB_DEFLATE
+- tristate
++ tristate "Zlib compression"
+
+ config LZO_COMPRESS
+ tristate