add layer meta-netboot to enable network boot over NBD (Network Block Device)
[AGL/meta-agl.git] / meta-netboot / classes / netboot.bbclass
1 # Enable network bootable image and initrd/initramfs
2
3 # add image classes for uboot
4 IMAGE_CLASSES += "${@'image_types_uboot' if (d.getVar("KERNEL_IMAGETYPE", True) == "uImage") else ''}"
5
6 python () {
7         d.appendVar("IMAGE_FSTYPES"," ext4")
8
9         if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)):
10                 # typical case for Minnowboard Max
11                 d.setVar("INITRD_IMAGE","initramfs-netboot-image")
12                 d.setVar("INITRD","%s/%s-%s.ext4.gz" % (
13                         d.getVar("DEPLOY_DIR_IMAGE",True),
14                         d.getVar("INITRD_IMAGE",True),
15                         d.getVar("MACHINE",True)
16                 ))
17         else:
18                 d.appendVar("INITRAMFS_IMAGE"," initramfs-netboot-image")
19                 if (d.getVar("KERNEL_IMAGETYPE",True) == "uImage"):
20                         # case for "old" u-boot images, like Porter board
21                         d.appendVar("INITRAMFS_FSTYPES"," ext4.gz.u-boot");
22                 else:
23                         # case for new u-boot images which don't require uImage format 
24                         d.appendVar("INITRAMFS_FSTYPES"," ext4.gz");
25 }
26