From 2d5f80251c73e1e44c8fdd047ef49dbe051d65aa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 14 Jun 2009 20:42:33 +0000 Subject: add the 'goldfish' target, useful for experimenting with virtual phone hardware (includes the emulator) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16459 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/goldfish/image/Makefile | 43 +++++++++++++++++++++++++++++ target/linux/goldfish/image/run-emulator.sh | 3 ++ target/linux/goldfish/image/ubinize.cfg | 14 ++++++++++ 3 files changed, 60 insertions(+) create mode 100644 target/linux/goldfish/image/Makefile create mode 100644 target/linux/goldfish/image/run-emulator.sh create mode 100644 target/linux/goldfish/image/ubinize.cfg (limited to 'target/linux/goldfish/image') diff --git a/target/linux/goldfish/image/Makefile b/target/linux/goldfish/image/Makefile new file mode 100644 index 0000000000..bf871fb2ae --- /dev/null +++ b/target/linux/goldfish/image/Makefile @@ -0,0 +1,43 @@ +# +# 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 + +JFFS2_BLOCKSIZE=124k +JFFS2OPTS += -n -s 2048 + +_PREFIX=openwrt-goldfish- + +define Image/BuildKernel + $(TARGET_CROSS)objcopy -O binary -R .note -R .comment -S \ + $(LINUX_DIR)/arch/arm/boot/compressed/vmlinux $(BIN_DIR)/$(_PREFIX)kernel.bin + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS), \ + $(CP) $(LINUX_DIR)/usr/initramfs_data.cpio.gz, \ + gzip -c < $(LINUX_DIR)/usr/initramfs_data.cpio > \ + ) $(BIN_DIR)/$(_PREFIX)ramdisk.bin + $(CP) ./run-emulator.sh $(BIN_DIR)/ +endef + +define Image/Build/jffs2-124k + $(CP) ./ubinize.cfg $(KDIR)/ + (cd $(KDIR); \ + ubinize \ + -o $(BIN_DIR)/$(_PREFIX)$(1).img \ + -p 128KiB -m 2KiB -s 2KiB ubinize.cfg; \ + ) + nand_ecc \ + $(BIN_DIR)/$(_PREFIX)$(1).img \ + $(BIN_DIR)/$(_PREFIX)system.bin +endef + +define Image/Build + $(call Image/Build/$(1),$(1)) +endef + + +$(eval $(call BuildImage)) diff --git a/target/linux/goldfish/image/run-emulator.sh b/target/linux/goldfish/image/run-emulator.sh new file mode 100644 index 0000000000..652ec5ed78 --- /dev/null +++ b/target/linux/goldfish/image/run-emulator.sh @@ -0,0 +1,3 @@ +PREFIX=openwrt-goldfish- +touch ${PREFIX}data.bin +./goldfish-qemu/emulator -sysdir . -ramdisk ${PREFIX}ramdisk.bin -kernel ${PREFIX}kernel.bin -system ${PREFIX}system.bin -data ${PREFIX}data.bin -show-kernel -partition-size 100 -qemu -append "console=ttyS0 ubi.mtd=0 root=/dev/mtdblock3 rootfstype=jffs2 bootdelay=1 init=/etc/preinit" -net nic,vlan=0,model=smc91c111 -net user,vlan=0,hostname=OpenWrt diff --git a/target/linux/goldfish/image/ubinize.cfg b/target/linux/goldfish/image/ubinize.cfg new file mode 100644 index 0000000000..d8d1fde012 --- /dev/null +++ b/target/linux/goldfish/image/ubinize.cfg @@ -0,0 +1,14 @@ +[rootfs] +# Volume mode (other option is static) +mode=ubi +# Source image +image=root.jffs2-124k +# Volume ID in UBI image +vol_id=0 +# Allow for dynamic resize +vol_type=dynamic +# Volume name +vol_name=rootfs +# Autoresize volume at first mount +vol_flags=autoresize + -- cgit v1.2.3