c74c10510c1c49fec70aaff9e58734c96c0df25a
[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         if (bb.utils.contains("IMAGE_FSTYPES","live",True,False,d)):
8                 # typical case for Minnowboard Max
9                 d.setVar("INITRD_IMAGE","initramfs-netboot-image")
10                 d.setVar("INITRD_IMAGE_LIVE",d.getVar("INITRD_IMAGE",True))
11                 d.setVar("INITRD_LIVE","%s/%s-%s.ext4.gz" % (
12                         d.getVar("DEPLOY_DIR_IMAGE",True),
13                         d.getVar("INITRD_IMAGE_LIVE",True),
14                         d.getVar("MACHINE",True)
15                 ))
16         else:
17                 d.setVar("INITRAMFS_IMAGE","initramfs-netboot-image")
18                 if (d.getVar("KERNEL_IMAGETYPE",True) == "uImage"):
19                         # case for "old" u-boot images, like Porter board
20                         d.setVar("NETBOOT_FSTYPES", "ext4.gz.u-boot");
21                 else:
22                         # case for new u-boot images which don't require uImage format 
23                         d.setVar("NETBOOT_FSTYPES", "ext4.gz");
24 }
25