Bladeren bron

dubhe: Updated dubhe initramfs

Updated the dubhe-image-initramfs recipe and Dubhe machine config so that
runqemu can work properly.

Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
Jun Yuan Tan 2 jaren geleden
bovenliggende
commit
f82bb689ab
2 gewijzigde bestanden met toevoegingen van 32 en 46 verwijderingen
  1. 19 33
      conf/machine/starfive-dubhe.conf
  2. 13 13
      recipes-images/images/dubhe-image-initramfs.bb

+ 19 - 33
conf/machine/starfive-dubhe.conf

@@ -1,49 +1,38 @@
 #@TYPE: Machine
 #@NAME: starfive-dubhe
 #@SOC: Dubhe default
-#@DESCRIPTION: Machine configuration for the beta Dubhe default config
-
-#require conf/machine/include/riscv/qemuriscv.inc
-
-#XVISOR_PLAT = "riscv/virt64"
-
-#EXTRA_IMAGEDEPENDS += "u-boot"
-#UBOOT_MACHINE = "qemu-riscv64_smode_defconfig"
-#UBOOT_ELF = "u-boot"
-
+#@DESCRIPTION: Machine configuration for the Dubhe default config
 
 #require conf/machine/include/qemu.inc
 # qemuboot options
-#QB_MACHINE = "-machine virt"
-#QB_DEFAULT_KERNEL = "fw_jump.elf"
-#QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
-#QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
-#QB_SLIRP_OPT = "-netdev user,id=net0,hostfwd=tcp::22222-:22"
-QB_SYSTEM_NAME = "qemu-riscv64"
+EXTRA_IMAGEDEPENDS += " qemu-helper-native "
+IMAGE_CLASSES += " qemuboot "
+QB_MACHINE = "-machine virt"
+QB_DEFAULT_KERNEL = "Image-initramfs-starfive-dubhe.bin"
+QB_DEFAULT_BIOS = "fw_payload.bin"
+QB_CPU = "-cpu rv64,x-h=true"
+QB_DEFAULT_FSTYPE = "cpio.gz"
+SERIAL_CONSOLES = "115200;ttyS0"
+QB_SYSTEM_NAME = "qemu-system-riscv64"
+QB_MEM = "-m 2048"
+QB_OPT_APPEND = "-smp 8"
 
 
 require conf/machine/include/riscv/tune-riscv.inc
 
 MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
 
-#KERNEL_CLASSES = "kernel-fitimage"
-#KERNEL_IMAGETYPE = "fitImage"
-
+KERNEL_DEVICETREE ?= "starfive/dubhe_fpga.dtb"
 KERNEL_IMAGETYPE = "Image"
+
 KEEPUIMAGE = "no"
 INITRAMFS_FSTYPES ?= "cpio.gz cpio.lzma"
 INITRAMFS_MAXSIZE = "524288"
-###KERNEL_IMAGETYPE += "uImage"
 
-KERNEL_IMAGETYPE = "Image"
-#UBOOT_ENV ?= "boot"
-#UBOOT_ENV_SUFFIX = "scr.uimg"
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-starfive-dev"
-#PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-starfive"
-#EXTRA_IMAGEDEPENDS += "u-boot"
-###EXTRA_IMAGEDEPENDS += "opensbi"
-###RISCV_SBI_PLAT ?= "generic"
-###RISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin"
+RISCV_SBI_PLAT = "generic"
+RISCV_SBI_PAYLOAD = "Image-initramfs-starfive-dubhe.bin"
+
 #
 ###IMAGE_FSTYPES += "wic.gz wic.bmap ext4 cpio"
 
@@ -65,10 +54,7 @@ PREFERRED_PROVIDER_virtual/kernel ?= "linux-starfive-dev"
 ###    fw_payload.bin \
 ###    ${KERNEL_IMAGETYPE} \
 ###    ${RISCV_SBI_FDT}  \
-#    boot.scr.uimg \
+###    boot.scr.uimg \
 ###"
-###WKS_FILE ?= "beaglev.wks"
-
-
-#inherit core-image
 
+WKS_FILE ?= "starfive-dubhe-initramfs.wks"

+ 13 - 13
recipes-images/images/dubhe-image-initramfs.bb

@@ -1,15 +1,16 @@
-DESCRIPTION = "Small image capable of booting a device with no flash."
+# Simple initramfs image. Mostly used for live images.
+DESCRIPTION = "Small image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently."
 
-# use -testfs live-install scripts
-#PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
-#PACKAGE_INSTALL = "initramfs-debug busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
-#PACKAGE_INSTALL = "busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+INITRAMFS_SCRIPTS ?= "\
+                      initramfs-boot packagegroup-core-boot \
+                     "
+PACKAGE_INSTALL ?= "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
 
-# Do not pollute the initrd image with rootfs features
-IMAGE_FEATURES = "empty-root-password allow-empty-password"
-IMAGE_FEATURES += "tools-sdk dev-pkgs"
 
-#IMAGE_INSTALL = " packagegroup-core-boot packagegroup-core-full-cmdline"
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
 
 export IMAGE_BASENAME = "dubhe-image-initramfs"
 IMAGE_NAME_SUFFIX ?= ""
@@ -22,8 +23,7 @@ inherit core-image
 
 IMAGE_ROOTFS_SIZE = "8192"
 IMAGE_ROOTFS_EXTRA_SPACE = "0"
+EXTRA_IMAGEDEPENDS ?= ""
 
-BAD_RECOMMENDATIONS += "busybox-syslog"
-
-# Use the same restriction as initramfs-live-install-testfs
-#COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+# Use the same restriction as initramfs-module-install
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv64.*|rv64.*)-(linux.*|freebsd.*)'