Bläddra i källkod

fix boot from disk for qemu targets

Waldemar Brodkorb 10 år sedan
förälder
incheckning
718043e164

+ 5 - 0
mk/rootfs.mk

@@ -10,8 +10,12 @@ endef
 
 ifeq ($(ADK_HARDWARE_QEMU),y)
 MTDDEV:=	root=/dev/mtdblock0
+ifeq ($(ADK_TARGET_ROOTFS_ARCHIVE),y)
 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
 ROOTFS:=	root=/dev/vda1
+else
+ROOTFS:=	root=/dev/sda1
+endif
 endif
 endif
 
@@ -43,6 +47,7 @@ $(eval $(call rootfs_template,cf,CF,$(ROOTFS)))
 $(eval $(call rootfs_template,mmc,MMC,$(ROOTFS)))
 $(eval $(call rootfs_template,usb,USB,$(USB)))
 $(eval $(call rootfs_template,archive,ARCHIVE,$(ROOTFS)))
+$(eval $(call rootfs_template,initramfsarchive,INITRAMFSARCHIVE))
 $(eval $(call rootfs_template,initramfs,INITRAMFS))
 $(eval $(call rootfs_template,initramfs-piggyback,INITRAMFS_PIGGYBACK))
 $(eval $(call rootfs_template,squashfs,SQUASHFS,$(ROOTFS)))

+ 6 - 0
target/arm/Makefile

@@ -70,6 +70,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM)$(ADK_TARGET_SYSTEM_QEMU_ARMHF),y)
 	@echo 'qemu-system-arm -M $(MACH) -nographic $(NET) -kernel $(FW_DIR)/$(TARGET_KERNEL) -hda qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 9 - 0
target/config/Config.in

@@ -258,6 +258,7 @@ endchoice
 choice
 prompt "Qemu Emulation with permanent storage device (disk/flash)"
 depends on ADK_HARDWARE_QEMU
+default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_ARCHIVE
 
 config ADK_TARGET_QEMU_WITHOUT_BLOCK
 	boolean "disabled"
@@ -759,6 +760,7 @@ config ADK_TARGET_SUFFIX
 choice
 prompt "Target firmware type"
 depends on !ADK_CHOOSE_TARGET_SYSTEM && !ADK_CHOOSE_TARGET_ARCH && !ADK_TOOLCHAIN
+default ADK_TARGET_ROOTFS_INITRAMFSARCHIVE if ADK_PKG_TEST
 default ADK_TARGET_ROOTFS_ARCHIVE
 
 config ADK_TARGET_ROOTFS_INITRAMFS
@@ -899,10 +901,17 @@ config ADK_TARGET_ROOTFS_ISO
 	help
 	  Use this option to create a bootable ISO image.
 
+config ADK_TARGET_ROOTFS_INITRAMFSARCHIVE
+	bool "Archive usable for initramfs creation"
+	help
+	  Use this option if your palnning to create a initramfs,
+	  useful for adk-test-framework.
+
 config ADK_TARGET_ROOTFS_ARCHIVE
 	bool "Archive usable for different filesystems"
 	select ADK_HOST_NEED_GENEXT2FS if ADK_HARDWARE_QEMU
 	select ADK_KERNEL_EXT2_FS if ADK_HARDWARE_QEMU
+	select ADK_TARGET_QEMU_WITH_BLOCK if ADK_HARDWARE_QEMU
 	help
 	  Use this option if your root filesystem is ext2/ext3/ext4/xfs.
 

+ 6 - 0
target/m68k/Makefile

@@ -15,6 +15,12 @@ imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
 	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
 	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 7 - 0
target/microblaze/Makefile

@@ -58,5 +58,12 @@ endif
 ifeq ($(ADK_TARGET_FS),archive)
 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
 	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
 endif

+ 6 - 0
target/mips/Makefile

@@ -112,6 +112,12 @@ ifeq ($(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),y)
 	@echo "The root parameter have to be changed."
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/ppc/Makefile

@@ -22,6 +22,12 @@ ifeq ($(ADK_HARDWARE_QEMU),y)
 	@echo 'qemu-system-ppc -M mac99 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/ppc64/Makefile

@@ -22,6 +22,12 @@ ifeq ($(ADK_HARDWARE_QEMU),y)
 	@echo 'qemu-system-ppc64 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/sh/Makefile

@@ -22,6 +22,12 @@ ifneq ($(ADK_HARDWARE_QEMU),)
 	@echo 'qemu-system-${CPU_ARCH} ${QEMU_ARGS} -M r2d -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/sparc/Makefile

@@ -21,6 +21,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_SPARC),y)
 	@echo 'qemu-system-sparc -M SS-5 -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img -append "root=/dev/sda1"'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/sparc64/Makefile

@@ -32,6 +32,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_SPARC64),y)
 	@echo 'qemu-system-sparc64 $(QEMU_ARGS) -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 imageinstall: $(FW_DIR)/$(INITRAMFS)
 	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)

+ 6 - 0
target/x86/Makefile

@@ -42,6 +42,12 @@ ifeq ($(ADK_HARDWARE_VBOX),y)
 	@echo "./scripts/create.sh -T vdi vbox-${CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),usb)
 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
 	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"

+ 6 - 0
target/x86_64/Makefile

@@ -20,6 +20,12 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_X86_64),y)
 	@echo 'qemu-system-x86_64 ${ADK_QEMU_ARGS} -net user -net nic,model=e1000 -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${CPU_ARCH}.img'
 endif
 endif
+ifeq ($(ADK_TARGET_FS),initramfsarchive)
+imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
+	@cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL)
+	@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+endif
 ifeq ($(ADK_TARGET_FS),usb)
 imageinstall: $(FW_DIR)/$(ROOTFSTARBALL)
 	@echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"