Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
10
target/linux/x86/image/64.mk
Normal file
10
target/linux/x86/image/64.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
define Device/generic
|
||||
DEVICE_VENDOR := Generic
|
||||
DEVICE_MODEL := x86/64
|
||||
DEVICE_PACKAGES += \
|
||||
kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-dwmac-intel kmod-e1000e kmod-e1000 \
|
||||
kmod-forcedeth kmod-fs-vfat kmod-igb kmod-igc kmod-ixgbe kmod-r8169 \
|
||||
kmod-tg3
|
||||
GRUB2_VARIANT := generic
|
||||
endef
|
||||
TARGET_DEVICES += generic
|
||||
153
target/linux/x86/image/Makefile
Normal file
153
target/linux/x86/image/Makefile
Normal file
@@ -0,0 +1,153 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
GRUB2_VARIANT =
|
||||
GRUB_TERMINALS =
|
||||
GRUB_SERIAL_CONFIG =
|
||||
GRUB_TERMINAL_CONFIG =
|
||||
GRUB_CONSOLE_CMDLINE =
|
||||
|
||||
ifneq ($(CONFIG_GRUB_CONSOLE),)
|
||||
GRUB_CONSOLE_CMDLINE += console=tty0
|
||||
GRUB_TERMINALS += console
|
||||
endif
|
||||
|
||||
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL))
|
||||
|
||||
GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,)
|
||||
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
|
||||
|
||||
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
||||
|
||||
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
|
||||
$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot/boot/vmlinuz
|
||||
-$(CP) $(STAGING_DIR_ROOT)/boot/. $@.boot/boot/
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot.img $@.boot/boot/grub/
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/$(if $(filter $(1),efi),gpt,$(GRUB2_VARIANT))-core.img \
|
||||
$@.boot/boot/grub/core.img
|
||||
$(if $(filter $(1),efi),
|
||||
$(INSTALL_DIR) $@.boot/efi/boot
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi $@.boot/efi/boot/
|
||||
)
|
||||
PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \
|
||||
$(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
|
||||
endef
|
||||
|
||||
define Build/grub-config
|
||||
rm -fR $@.boot
|
||||
$(INSTALL_DIR) $@.boot/boot/grub
|
||||
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' \
|
||||
./grub-$(1).cfg > $@.boot/boot/grub/grub.cfg
|
||||
endef
|
||||
|
||||
define Build/grub-install
|
||||
rm -fR $@.grub2
|
||||
$(INSTALL_DIR) $@.grub2
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/boot.img $@.grub2/
|
||||
$(CP) $(STAGING_DIR_IMAGE)/grub2/$(if $(filter $(1),efi),gpt,$(GRUB2_VARIANT))-core.img $@.grub2/core.img
|
||||
echo '(hd0) $@' > $@.grub2/device.map
|
||||
$(STAGING_DIR_HOST)/bin/grub-bios-setup \
|
||||
-m "$@.grub2/device.map" \
|
||||
-d "$@.grub2" \
|
||||
-r "hd0,$(if $(filter $(1),efi),gpt1,msdos1)" \
|
||||
$@
|
||||
endef
|
||||
|
||||
define Build/iso
|
||||
$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot/boot/vmlinuz
|
||||
cat \
|
||||
$(STAGING_DIR_IMAGE)/grub2/cdboot.img \
|
||||
$(STAGING_DIR_IMAGE)/grub2/eltorito.img \
|
||||
> $@.boot/boot/grub/eltorito.img
|
||||
-$(CP) $(STAGING_DIR_ROOT)/boot/. $@.boot/boot/
|
||||
$(if $(filter $(1),efi),
|
||||
mkfs.fat -C $@.boot/boot/grub/isoboot.img -S 512 1440
|
||||
mmd -i $@.boot/boot/grub/isoboot.img ::/efi ::/efi/boot
|
||||
mcopy -i $@.boot/boot/grub/isoboot.img \
|
||||
$(STAGING_DIR_IMAGE)/grub2/iso-boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
||||
::/efi/boot/boot$(if $(CONFIG_x86_64),x64,ia32).efi
|
||||
)
|
||||
mkisofs -R -b boot/grub/eltorito.img -no-emul-boot -boot-info-table \
|
||||
$(if $(filter $(1),efi),-boot-load-size 4 -c boot.cat -eltorito-alt-boot -b boot/grub/isoboot.img -no-emul-boot) \
|
||||
-o $@ $@.boot $(TARGET_DIR)
|
||||
endef
|
||||
|
||||
DEVICE_VARS += GRUB2_VARIANT
|
||||
define Device/Default
|
||||
ARTIFACT/image.iso := grub-config iso | iso
|
||||
IMAGE/combined.img := grub-config pc | combined | grub-install | append-metadata
|
||||
IMAGE/combined.img.gz := grub-config pc | combined | grub-install | gzip | append-metadata
|
||||
IMAGE/combined.vdi := grub-config pc | combined | grub-install | qemu-image vdi
|
||||
IMAGE/combined.vmdk := grub-config pc | combined | grub-install | qemu-image vmdk
|
||||
IMAGE/combined.vhdx := grub-config pc | combined | grub-install | qemu-image vhdx -o subformat=dynamic
|
||||
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
|
||||
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
|
||||
ARTIFACT/image-efi.iso := grub-config iso | iso efi
|
||||
IMAGE/combined-efi.img := grub-config efi | combined efi | grub-install efi | append-metadata
|
||||
IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
|
||||
IMAGE/combined-efi.vdi := grub-config efi | combined efi | grub-install efi | qemu-image vdi
|
||||
IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
|
||||
IMAGE/combined-efi.vhdx := grub-config efi | combined efi | grub-install efi | qemu-image vhdx -o subformat=dynamic
|
||||
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
|
||||
IMAGES-y := rootfs.img.gz
|
||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img.gz
|
||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.img.gz
|
||||
else
|
||||
IMAGES-y := rootfs.img
|
||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img
|
||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.img
|
||||
endif
|
||||
KERNEL := kernel-bin
|
||||
KERNEL_INSTALL := 1
|
||||
KERNEL_NAME := bzImage
|
||||
ifeq ($(CONFIG_ISO_IMAGES),y)
|
||||
ARTIFACTS-$$(CONFIG_GRUB_IMAGES) += image.iso
|
||||
ARTIFACTS-$$(CONFIG_GRUB_EFI_IMAGES) += image-efi.iso
|
||||
endif
|
||||
ifeq ($(CONFIG_VDI_IMAGES),y)
|
||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vdi
|
||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vdi
|
||||
endif
|
||||
ifeq ($(CONFIG_VMDK_IMAGES),y)
|
||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk
|
||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk
|
||||
endif
|
||||
ifeq ($(CONFIG_VHDX_IMAGES),y)
|
||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vhdx
|
||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vhdx
|
||||
endif
|
||||
IMAGES := $$(IMAGES-y)
|
||||
ARTIFACTS := $$(ARTIFACTS-y)
|
||||
SUPPORTED_DEVICES :=
|
||||
endef
|
||||
|
||||
include $(SUBTARGET).mk
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
|
||||
9
target/linux/x86/image/generic.mk
Normal file
9
target/linux/x86/image/generic.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
define Device/generic
|
||||
DEVICE_VENDOR := Generic
|
||||
DEVICE_MODEL := x86
|
||||
DEVICE_PACKAGES += kmod-3c59x kmod-8139too kmod-e100 kmod-e1000 kmod-natsemi \
|
||||
kmod-ne2k-pci kmod-pcnet32 kmod-r8169 kmod-sis900 kmod-tg3 \
|
||||
kmod-via-rhine kmod-via-velocity kmod-forcedeth kmod-fs-vfat
|
||||
GRUB2_VARIANT := generic
|
||||
endef
|
||||
TARGET_DEVICES += generic
|
||||
17
target/linux/x86/image/geode.mk
Normal file
17
target/linux/x86/image/geode.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
define Device/generic
|
||||
DEVICE_VENDOR := Generic
|
||||
DEVICE_MODEL := x86/Geode
|
||||
DEVICE_PACKAGES += kmod-crypto-cbc kmod-crypto-ecb kmod-crypto-hw-geode \
|
||||
kmod-ledtrig-gpio
|
||||
GRUB2_VARIANT := legacy
|
||||
endef
|
||||
TARGET_DEVICES += generic
|
||||
|
||||
define Device/geos
|
||||
$(call Device/generic)
|
||||
DEVICE_VENDOR := Traverse Technologies
|
||||
DEVICE_MODEL := Geos
|
||||
DEVICE_PACKAGES += br2684ctl flashrom kmod-hwmon-lm90 kmod-mppe kmod-pppoa \
|
||||
kmod-usb-ohci-pci linux-atm ppp-mod-pppoa pppdump pppstats soloscli tc
|
||||
endef
|
||||
TARGET_DEVICES += geos
|
||||
13
target/linux/x86/image/grub-efi.cfg
Normal file
13
target/linux/x86/image/grub-efi.cfg
Normal file
@@ -0,0 +1,13 @@
|
||||
@SERIAL_CONFIG@
|
||||
@TERMINAL_CONFIG@
|
||||
|
||||
set default="0"
|
||||
set timeout="@TIMEOUT@"
|
||||
search -l kernel -s root
|
||||
|
||||
menuentry "@TITLE@" {
|
||||
linux /boot/vmlinuz @GPT_ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
menuentry "@TITLE@ (failsafe)" {
|
||||
linux /boot/vmlinuz failsafe=true @GPT_ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
15
target/linux/x86/image/grub-iso.cfg
Normal file
15
target/linux/x86/image/grub-iso.cfg
Normal file
@@ -0,0 +1,15 @@
|
||||
@SERIAL_CONFIG@
|
||||
@TERMINAL_CONFIG@
|
||||
|
||||
set default="0"
|
||||
set timeout="@TIMEOUT@"
|
||||
|
||||
if [ "${grub_platform}" = "efi" ]; then
|
||||
set root='(cd0)'
|
||||
else
|
||||
set root='(cd)'
|
||||
fi
|
||||
|
||||
menuentry "@TITLE@" {
|
||||
linux /boot/vmlinuz root=/dev/sr0 rootfstype=iso9660 rootwait @CMDLINE@ noinitrd
|
||||
}
|
||||
13
target/linux/x86/image/grub-pc.cfg
Normal file
13
target/linux/x86/image/grub-pc.cfg
Normal file
@@ -0,0 +1,13 @@
|
||||
@SERIAL_CONFIG@
|
||||
@TERMINAL_CONFIG@
|
||||
|
||||
set default="0"
|
||||
set timeout="@TIMEOUT@"
|
||||
set root='(hd0,msdos1)'
|
||||
|
||||
menuentry "@TITLE@" {
|
||||
linux /boot/vmlinuz @ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
menuentry "@TITLE@ (failsafe)" {
|
||||
linux /boot/vmlinuz failsafe=true @ROOTPART@ @CMDLINE@ noinitrd
|
||||
}
|
||||
9
target/linux/x86/image/legacy.mk
Normal file
9
target/linux/x86/image/legacy.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
define Device/generic
|
||||
DEVICE_VENDOR := Generic
|
||||
DEVICE_MODEL := x86/legacy
|
||||
DEVICE_PACKAGES += kmod-3c59x kmod-8139too kmod-e100 kmod-e1000 \
|
||||
kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-r8169 kmod-sis900 \
|
||||
kmod-tg3 kmod-via-rhine kmod-via-velocity kmod-forcedeth
|
||||
GRUB2_VARIANT := legacy
|
||||
endef
|
||||
TARGET_DEVICES += generic
|
||||
Reference in New Issue
Block a user