2021-02-10 13:52:34 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
#
|
armvirt: merge arm64 as subtarget 64
Original armvirt target is now subtarget 32. Other than that the built
result should remain the same as before
Besides old features already available with arm64, the new armvirt/64
subtarget will also have those features originally enabled for
armvirt/32 with commit 44ecfc2 ("armvirt: new target")
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2017-04-18 12:59:52 +00:00
|
|
|
# Copyright (C) 2016-2017 Yousong Zhou <yszhou4tech@gmail.com>
|
2021-02-10 13:52:34 +00:00
|
|
|
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2022-01-19 02:25:23 +00:00
|
|
|
GRUB2_VARIANT =
|
|
|
|
GRUB_TERMINALS =
|
|
|
|
GRUB_SERIAL_CONFIG =
|
|
|
|
GRUB_TERMINAL_CONFIG =
|
|
|
|
GRUB_CONSOLE_CMDLINE = earlycon
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_GRUB_CONSOLE),)
|
|
|
|
GRUB_TERMINALS += console
|
|
|
|
endif
|
|
|
|
|
2023-11-26 22:04:04 +00:00
|
|
|
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL))
|
2022-01-19 02:25:23 +00:00
|
|
|
|
2023-09-13 16:09:43 +00:00
|
|
|
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
|
|
|
GRUB_TERMINALS += serial
|
2022-01-19 02:25:23 +00:00
|
|
|
|
2023-09-13 16:09:43 +00:00
|
|
|
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
2022-01-19 02:25:23 +00:00
|
|
|
|
|
|
|
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
|
|
|
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
|
|
|
GPT_ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
|
|
|
GPT_ROOTPART:=$(if $(GPT_ROOTPART),$(GPT_ROOTPART),PARTUUID=$(shell echo $(IMG_PART_DISKGUID) | sed 's/00$$/02/'))
|
|
|
|
|
|
|
|
GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT))
|
|
|
|
GRUB_TITLE:=$(call qstrip,$(CONFIG_GRUB_TITLE))
|
|
|
|
|
|
|
|
BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS))
|
|
|
|
|
|
|
|
define Build/combined
|
|
|
|
$(INSTALL_DIR) $@.boot/
|
|
|
|
$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot/efi/openwrt/
|
|
|
|
-$(CP) $(STAGING_DIR_ROOT)/boot/. $@.boot/boot/
|
|
|
|
$(if $(filter $(1),efi),
|
|
|
|
$(INSTALL_DIR) $@.boot/efi/boot
|
|
|
|
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi $@.boot/efi/openwrt/
|
|
|
|
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_aarch64),aa64,arm).efi $@.boot/efi/boot/
|
armvirt: merge arm64 as subtarget 64
Original armvirt target is now subtarget 32. Other than that the built
result should remain the same as before
Besides old features already available with arm64, the new armvirt/64
subtarget will also have those features originally enabled for
armvirt/32 with commit 44ecfc2 ("armvirt: new target")
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2017-04-18 12:59:52 +00:00
|
|
|
)
|
2023-04-20 06:38:22 +00:00
|
|
|
KERNELPARTTYPE=ef FAT_TYPE="32" PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \
|
2022-01-19 02:25:23 +00:00
|
|
|
$(if $(filter $(1),efi),GUID="$(IMG_PART_DISKGUID)") $(SCRIPT_DIR)/gen_image_generic.sh \
|
|
|
|
$@ \
|
|
|
|
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
|
|
|
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
|
|
|
|
256
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
endef
|
|
|
|
|
2022-01-19 02:25:23 +00:00
|
|
|
define Build/grub-config
|
|
|
|
rm -fR $@.boot
|
|
|
|
$(INSTALL_DIR) $@.boot/efi/openwrt/
|
|
|
|
sed \
|
|
|
|
-e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
|
|
|
|
-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
|
|
|
|
-e 's#@ROOTPART@#root=$(ROOTPART) rootwait#g' \
|
|
|
|
-e 's#@GPT_ROOTPART@#root=$(GPT_ROOTPART) rootwait#g' \
|
|
|
|
-e 's#@CMDLINE@#$(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE)#g' \
|
|
|
|
-e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
|
|
|
|
-e 's#@TITLE@#$(GRUB_TITLE)#g' \
|
|
|
|
-e 's#@KERNEL_NAME@#$(KERNEL_NAME)#g' \
|
|
|
|
./grub-$(1).cfg > $@.boot/efi/openwrt/grub.cfg
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
endef
|
|
|
|
|
2022-01-19 02:25:23 +00:00
|
|
|
define Build/grub-install
|
|
|
|
rm -fR $@.grub2
|
|
|
|
$(INSTALL_DIR) $@.grub2
|
2019-03-28 14:34:26 +00:00
|
|
|
endef
|
|
|
|
|
2023-06-02 11:48:38 +00:00
|
|
|
DEVICE_VARS += GRUB2_VARIANT UBOOT
|
2022-01-19 02:25:23 +00:00
|
|
|
define Device/efi-default
|
|
|
|
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
|
|
|
|
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
|
|
|
|
IMAGE/combined.img := grub-config efi | combined efi | grub-install efi | append-metadata
|
|
|
|
IMAGE/combined.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
|
|
|
|
IMAGE/combined.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
|
|
|
|
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
|
|
|
|
IMAGES-y := rootfs.img.gz
|
|
|
|
IMAGES-y += combined.img.gz
|
|
|
|
else
|
|
|
|
IMAGES-y := rootfs.img
|
|
|
|
IMAGES-y += combined.img
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_VMDK_IMAGES),y)
|
|
|
|
IMAGES-y += combined.vmdk
|
|
|
|
endif
|
|
|
|
KERNEL := kernel-bin
|
|
|
|
KERNEL_INSTALL := 1
|
|
|
|
IMAGES := $$(IMAGES-y)
|
|
|
|
ARTIFACTS := $$(ARTIFACTS-y)
|
|
|
|
SUPPORTED_DEVICES :=
|
|
|
|
ifeq ($(CONFIG_arm),y)
|
|
|
|
KERNEL_NAME = zImage
|
|
|
|
endif
|
|
|
|
endef
|
2019-03-28 14:34:26 +00:00
|
|
|
|
2022-01-19 02:25:23 +00:00
|
|
|
define Device/generic
|
|
|
|
$(call Device/efi-default)
|
|
|
|
DEVICE_TITLE := Generic EFI Boot
|
|
|
|
GRUB2_VARIANT := generic
|
|
|
|
FILESYSTEMS := ext4 squashfs
|
2023-06-02 11:48:38 +00:00
|
|
|
UBOOT := $(if $(CONFIG_aarch64),qemu_armv8,qemu_armv7)
|
2022-01-19 02:25:23 +00:00
|
|
|
DEVICE_PACKAGES += kmod-amazon-ena kmod-e1000e kmod-vmxnet3 kmod-rtc-rx8025 \
|
2023-05-31 05:47:41 +00:00
|
|
|
kmod-i2c-mux-pca954x kmod-gpio-pca953x partx-utils kmod-wdt-sp805 \
|
2022-07-15 02:38:02 +00:00
|
|
|
kmod-mvneta kmod-mvpp2 kmod-fsl-dpaa1-net kmod-fsl-dpaa2-net \
|
2023-02-11 03:58:09 +00:00
|
|
|
kmod-fsl-enetc-net kmod-dwmac-imx kmod-fsl-fec kmod-thunderx-net \
|
2023-04-18 03:34:23 +00:00
|
|
|
kmod-dwmac-rockchip kmod-dwmac-sun8i kmod-phy-aquantia kmod-phy-broadcom \
|
2023-08-07 05:06:43 +00:00
|
|
|
kmod-phy-marvell kmod-phy-marvell-10g kmod-sfp kmod-atlantic \
|
2024-05-28 23:09:17 +00:00
|
|
|
kmod-bcmgenet kmod-octeontx2-net kmod-renesas-net-avb \
|
|
|
|
kmod-phy-realtek kmod-phy-smsc
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
endef
|
2022-01-19 02:25:23 +00:00
|
|
|
TARGET_DEVICES += generic
|
armvirt: new target
An ARM Cortex-A15 machine provided by QEMU.
Kernel drivers enabled:
- pl011, uart
- pl031, rtc
- pl061, gpio
- pci-host-generic
- virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
- smp with NR_CPUS=4
- cpu-hotplug
- ext4
- neon, vfp extensions support (otherwise userland will fail with
illegal instruction signal (code 0x00000004))
- DEBUG_BUGVERBOSE for debug purposes
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-12-08 15:21:30 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|