From 56b1139ef2660535b112d0be4ddb2806f75298a8 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Mon, 23 May 2016 17:53:36 +0200 Subject: add layer meta-netboot to enable network boot over NBD (Network Block Device) To enable the build of network bootable images, the following line must be added to conf/local.conf: INHERIT += "netboot" This layer contains recipes for the following components: * busybox: activate the built-in NBD client * initramfs-netboot: contains the init script started by the kernel, responsible for mounting the remote root filesystem then pivoting and exec'ing systemd * initramfs-netboot-image: image to specify for building the initrd More details are available in meta-netboot/README. Bug-AGL: SPEC-175 Change-Id: Id2328dd9233d238cde77311e64e58344be244988 Signed-off-by: Stephane Desneux --- meta-netboot/classes/netboot.bbclass | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 meta-netboot/classes/netboot.bbclass (limited to 'meta-netboot/classes') diff --git a/meta-netboot/classes/netboot.bbclass b/meta-netboot/classes/netboot.bbclass new file mode 100644 index 000000000..0bb2452ad --- /dev/null +++ b/meta-netboot/classes/netboot.bbclass @@ -0,0 +1,26 @@ +# Enable network bootable image and initrd/initramfs + +# add image classes for uboot +IMAGE_CLASSES += "${@'image_types_uboot' if (d.getVar("KERNEL_IMAGETYPE", True) == "uImage") else ''}" + +python () { + d.appendVar("IMAGE_FSTYPES"," ext4") + + if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)): + # typical case for Minnowboard Max + d.setVar("INITRD_IMAGE","initramfs-netboot-image") + d.setVar("INITRD","%s/%s-%s.ext4.gz" % ( + d.getVar("DEPLOY_DIR_IMAGE",True), + d.getVar("INITRD_IMAGE",True), + d.getVar("MACHINE",True) + )) + else: + d.appendVar("INITRAMFS_IMAGE"," initramfs-netboot-image") + if (d.getVar("KERNEL_IMAGETYPE",True) == "uImage"): + # case for "old" u-boot images, like Porter board + d.appendVar("INITRAMFS_FSTYPES"," ext4.gz.u-boot"); + else: + # case for new u-boot images which don't require uImage format + d.appendVar("INITRAMFS_FSTYPES"," ext4.gz"); +} + -- cgit 1.2.3-korg