summaryrefslogtreecommitdiffstats
path: root/meta-netboot
diff options
context:
space:
mode:
Diffstat (limited to 'meta-netboot')
-rw-r--r--meta-netboot/README.renesas-gen390
-rw-r--r--meta-netboot/classes/netboot.bbclass5
-rw-r--r--meta-netboot/conf/include/agl-netboot.inc3
-rw-r--r--meta-netboot/conf/layer.conf4
-rw-r--r--meta-netboot/recipes-core/busybox/busybox_%.bbappend7
-rw-r--r--meta-netboot/recipes-core/busybox/busybox_netboot.inc6
-rw-r--r--meta-netboot/recipes-core/images/initramfs-netboot-image.bb23
-rw-r--r--meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc23
-rw-r--r--meta-netboot/recipes-support/nbd/nbd_%.bbappend7
-rw-r--r--meta-netboot/recipes-support/nbd/nbd_netboot.inc5
-rwxr-xr-xmeta-netboot/scripts/run-yocto-check-layer-flags-enabled.sh46
-rwxr-xr-xmeta-netboot/scripts/run-yocto-check-layer.sh44
12 files changed, 133 insertions, 130 deletions
diff --git a/meta-netboot/README.renesas-gen3 b/meta-netboot/README.renesas-gen3
deleted file mode 100644
index 496141eef..000000000
--- a/meta-netboot/README.renesas-gen3
+++ /dev/null
@@ -1,90 +0,0 @@
-Below are the environment variables that can be set in the u-boot console to boot the Renesas Gen3 ULCB boards.
-
-Adjust board type with the following identifiers:
-
-* 'm3ulcb' for Renesas Gen3 Starter Kit Pro
-* 'h3ulcb' for Renesas Gen3 Starter Kit Premium
-
-################## Common options #####################
-# these options are common to all configurations:
-
-##### board info
-
-# choose board
-setenv board m3ulcb
-setenv soc r8a7796
-# or
-setenv board h3ulcb
-setenv soc r8a7795
-
-##### boot mode
-# choose bootmode:
-# netboot
-setenv bootmode net
-# or sdcard
-setenv bootmode sd
-# or sdcard with initrd
-setenv bootmode sdi
-
-##### sdcard options
-# which sdcard slot to use
-setenv bootmmc '0:1'
-
-##### netboot options
-# replace <IP> and <NUM> by appropriate addresses
-setenv ipaddr '<board_IP>'
-setenv serverip '<server_IP>'
-setenv ethact ravb
-setenv ethaddr DE:AD:C0:FF:EE:<NUM>
-
-################## Internal variables #####################
-
-# kernel file
-setenv set_bootkfile 'setenv bootkfile Image'
-setenv bootkaddr 0x48080000
-
-# dtb file
-setenv set_bootdfile 'setenv bootdfile Image-${soc}-${board}.dtb'
-setenv bootdaddr 0x48000000
-
-# initrd
-setenv set_bootifile 'setenv bootifile initramfs-netboot-image-${board}.ext4.gz'
-setenv bootiaddr 0x5C3F9520
-setenv bootisize 3A6AB6
-
-# kernel args
-setenv bootargs_console 'console=ttySC0,115200 ignore_loglevel'
-setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60'
-setenv bootargs_extra 'rw rootfstype=ext4 rootwait rootdelay=2'
-
-# final boot command
-setenv bootcmd 'run bootcmd_${bootmode}'
-
-################ Boot on MMC (SDcard) #################
-
-setenv bootkload_sd 'ext4load mmc ${bootmmc} ${bootkaddr} boot/${bootkfile}'
-setenv bootiload_sd 'ext4load mmc ${bootmmc} ${bootiaddr} boot/${bootifile}'
-setenv bootdload_sd 'ext4load mmc ${bootmmc} ${bootdaddr} boot/${bootdfile}'
-
-# without initrd
-setenv bootargs_root_sd 'root=/dev/mmcblk1p1'
-setenv bootload_sd 'run set_bootkfile; run bootkload_sd; run set_bootdfile; run bootdload_sd'
-setenv bootcmd_sd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root_sd} ${bootargs_extra}; run bootload_sd; booti ${bootkaddr} - ${bootdaddr}'
-
-# with initrd
-setenv bootargs_root_sdi 'root=/dev/ram0 ramdisk_size=16384'
-setenv bootload_sdi 'run set_bootkfile; run bootkload_sd; run set_bootdfile; run bootdload_sd; run set_bootifile; run bootiload_sd'
-setenv bootcmd_sdi 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root_sdi} ${bootargs_extra}; run bootload_sdi; booti ${bootkaddr} ${bootiaddr}:${bootisize} ${bootdaddr}'
-
-################ Netboot through TFTP+NBD ##################
-
-setenv bootkload_net 'tftp ${bootkaddr} ${board}/${bootkfile}'
-setenv bootdload_net 'tftp ${bootdaddr} ${board}/${bootdfile}'
-setenv bootiload_net 'tftp ${bootiaddr} ${board}/${bootifile}'
-
-setenv bootargs_root_net 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
-setenv bootload_net 'run set_bootkfile; run bootkload_net; run set_bootdfile; run bootdload_net; run set_bootifile; run bootiload_net'
-
-setenv bootcmd_net 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root_net} ${bootargs_extra} nbd.server=${serverip}; run bootload_net; booti ${bootkaddr} ${bootiaddr}:${bootisize} ${bootdaddr}'
-
-
diff --git a/meta-netboot/classes/netboot.bbclass b/meta-netboot/classes/netboot.bbclass
index 63369285f..a18d64f5b 100644
--- a/meta-netboot/classes/netboot.bbclass
+++ b/meta-netboot/classes/netboot.bbclass
@@ -1,5 +1,10 @@
# Enable network bootable image and initrd/initramfs
+OVERRIDES .= ":netboot"
+# add 512MB of extra space in ext4 output image
+IMAGE_ROOTFS_EXTRA_SPACE = "524288"
+NETBOOT_ENABLED ??= "1"
+
python () {
if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)):
# typical case for Minnowboard Max
diff --git a/meta-netboot/conf/include/agl-netboot.inc b/meta-netboot/conf/include/agl-netboot.inc
index fcff8c318..ca6d9df12 100644
--- a/meta-netboot/conf/include/agl-netboot.inc
+++ b/meta-netboot/conf/include/agl-netboot.inc
@@ -1,5 +1,2 @@
INHERIT += "netboot"
-OVERRIDES .= ":netboot"
-# add 512MB of extra space in ext4 output image
-IMAGE_ROOTFS_EXTRA_SPACE = "524288"
diff --git a/meta-netboot/conf/layer.conf b/meta-netboot/conf/layer.conf
index 50def90fc..2af752805 100644
--- a/meta-netboot/conf/layer.conf
+++ b/meta-netboot/conf/layer.conf
@@ -1,6 +1,3 @@
-# Added for futur conditionnals tests
-DISTRO_FEATURES_append = " netboot"
-
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
@@ -13,3 +10,4 @@ BBFILE_PATTERN_meta-netboot = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-netboot = "60"
LAYERSERIES_COMPAT_meta-netboot = "dunfell"
+LAYERDEPENDS_meta-netboot = "core networking-layer"
diff --git a/meta-netboot/recipes-core/busybox/busybox_%.bbappend b/meta-netboot/recipes-core/busybox/busybox_%.bbappend
index 358913448..fcf6acfd1 100644
--- a/meta-netboot/recipes-core/busybox/busybox_%.bbappend
+++ b/meta-netboot/recipes-core/busybox/busybox_%.bbappend
@@ -1,6 +1 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
-SRC_URI += " \
- file://enable_nbd.cfg \
- "
-
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'busybox_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-core/busybox/busybox_netboot.inc b/meta-netboot/recipes-core/busybox/busybox_netboot.inc
new file mode 100644
index 000000000..0bcd5afa5
--- /dev/null
+++ b/meta-netboot/recipes-core/busybox/busybox_netboot.inc
@@ -0,0 +1,6 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI_append = " \
+ file://enable_nbd.cfg \
+ "
+
diff --git a/meta-netboot/recipes-core/images/initramfs-netboot-image.bb b/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
index 965a0bd37..b5610f30d 100644
--- a/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
+++ b/meta-netboot/recipes-core/images/initramfs-netboot-image.bb
@@ -1,23 +1,2 @@
-# Netboot initramfs image.
-DESCRIPTION = "Netboot initrd image"
-
-PACKAGE_INSTALL = "initramfs-netboot busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
-
-# Do not pollute the initrd image with rootfs features
-IMAGE_FEATURES = ""
-
-export IMAGE_BASENAME = "initramfs-netboot-image"
-IMAGE_LINGUAS = ""
-
LICENSE = "MIT"
-
-IMAGE_FSTYPES := "${NETBOOT_FSTYPES}"
-inherit core-image
-
-# hotfix for dragonboard (which uses _append in the bsp)
-IMAGE_FSTYPES_remove += "wic.gz"
-
-IMAGE_ROOTFS_SIZE = "8192"
-IMAGE_ROOTFS_EXTRA_SPACE = "256"
-
-BAD_RECOMMENDATIONS += "busybox-syslog"
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'initramfs-netboot-image_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc b/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc
new file mode 100644
index 000000000..0c97b0f93
--- /dev/null
+++ b/meta-netboot/recipes-core/images/initramfs-netboot-image_netboot.inc
@@ -0,0 +1,23 @@
+# Netboot initramfs image.
+DESCRIPTION = "Netboot initrd image"
+
+PACKAGE_INSTALL = "initramfs-netboot busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "initramfs-netboot-image"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES := "${NETBOOT_FSTYPES}"
+inherit core-image
+
+# hotfix for dragonboard (which uses _append in the bsp)
+IMAGE_FSTYPES_remove = "wic.gz"
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "256"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta-netboot/recipes-support/nbd/nbd_%.bbappend b/meta-netboot/recipes-support/nbd/nbd_%.bbappend
index fb11ef9c2..e67e591ff 100644
--- a/meta-netboot/recipes-support/nbd/nbd_%.bbappend
+++ b/meta-netboot/recipes-support/nbd/nbd_%.bbappend
@@ -1,6 +1 @@
-
-do_install_append() {
- mv ${D}/${sbindir}/${BPN}-client ${D}/${sbindir}/${BPN}3-client
-}
-
-FILES_${PN}-client = "${sbindir}/${BPN}3-client"
+require ${@bb.utils.contains('NETBOOT_ENABLED', '1', 'nbd_netboot.inc', '', d)}
diff --git a/meta-netboot/recipes-support/nbd/nbd_netboot.inc b/meta-netboot/recipes-support/nbd/nbd_netboot.inc
new file mode 100644
index 000000000..f2286616f
--- /dev/null
+++ b/meta-netboot/recipes-support/nbd/nbd_netboot.inc
@@ -0,0 +1,5 @@
+do_install_append() {
+ mv ${D}/${sbindir}/nbd-client ${D}/${sbindir}/nbd3-client
+}
+
+FILES_${PN}-client_append = " ${sbindir}/nbd3-client"
diff --git a/meta-netboot/scripts/run-yocto-check-layer-flags-enabled.sh b/meta-netboot/scripts/run-yocto-check-layer-flags-enabled.sh
new file mode 100755
index 000000000..c64afa714
--- /dev/null
+++ b/meta-netboot/scripts/run-yocto-check-layer-flags-enabled.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we do not import
+DISTRO_FEATURES_append = " systemd smack"
+DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+# workaround
+# ERROR: Nothing PROVIDES 'smack' (but meta-openembedded/meta-oe/recipes-extended/ostree/ostree_2020.3.bb DEPENDS on or otherwise requires it)
+BBMASK += "meta-oe/recipes-extended/ostree/ostree_2020.3.bb"
+
+NETBOOT_ENABLED = "1"
+NETBOOT_FSTYPES ??= "ext4.gz"
+
+EOF
+
+
+yocto-check-layer \
+ --dependency \
+ $AGLROOT/external/meta-openembedded/meta-oe \
+ $AGLROOT/external/meta-openembedded/meta-python \
+ $AGLROOT/external/meta-openembedded/meta-networking \
+ -- \
+ $AGLROOT/meta-agl/meta-netboot/
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl
diff --git a/meta-netboot/scripts/run-yocto-check-layer.sh b/meta-netboot/scripts/run-yocto-check-layer.sh
new file mode 100755
index 000000000..b3b8e08e1
--- /dev/null
+++ b/meta-netboot/scripts/run-yocto-check-layer.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#set -x
+
+SCRIPTPATH="$( cd $(dirname $0) >/dev/null 2>&1 ; pwd -P )"
+echo $SCRIPTPATH
+AGLROOT="$SCRIPTPATH/../../.."
+POKYDIR="$AGLROOT/external/poky"
+TMPROOT=`mktemp -d`
+
+rm -rf ${TMPROOT}/testbuild-ycl || true
+mkdir -p ${TMPROOT}/testbuild-ycl
+cd ${TMPROOT}/testbuild-ycl
+
+source $POKYDIR/oe-init-build-env .
+
+cat << EOF >> conf/local.conf
+# just define defaults
+AGL_FEATURES ?= ""
+AGL_EXTRA_IMAGE_FSTYPES ?= ""
+
+# important settings imported from poky-agl.conf
+# we do not import
+DISTRO_FEATURES_append = " systemd smack"
+DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " sysvinit"
+VIRTUAL-RUNTIME_init_manager = "systemd"
+
+# workaround
+# ERROR: Nothing PROVIDES 'smack' (but meta-openembedded/meta-oe/recipes-extended/ostree/ostree_2020.3.bb DEPENDS on or otherwise requires it)
+BBMASK += "meta-oe/recipes-extended/ostree/ostree_2020.3.bb"
+
+
+EOF
+
+
+yocto-check-layer \
+ --dependency \
+ $AGLROOT/external/meta-openembedded/meta-oe \
+ $AGLROOT/external/meta-openembedded/meta-python \
+ $AGLROOT/external/meta-openembedded/meta-networking \
+ -- \
+ $AGLROOT/meta-agl/meta-netboot/
+
+
+[ $? = 0 ] && rm -rf ${TMPROOT}/testbuild-ycl