netbase: fix non working wpa_supplicant detection in network restarts. Push PR.
[openembedded.git] / classes / wrt-image.bbclass
1 # we dont need the kernel in the image
2 ROOTFS_POSTPROCESS_COMMAND += "rm -f ${IMAGE_ROOTFS}/boot/zImage*"
3
4 def wrt_get_kernel_version(d):
5         import bb
6         if bb.data.inherits_class('image', d):
7                 skd = bb.data.getVar('STAGING_KERNEL_DIR', d, 1)
8                 return base_read_file(skd+'/kernel-abiversion')
9         return "-no kernel version for available-"
10         
11 wrt_create_images() {
12         I=${DEPLOY_DIR}/images
13         KERNEL_VERSION="${@wrt_get_kernel_version(d)}"
14
15         for type in ${IMAGE_FSTYPES}; do
16                 # generic
17                 trx -o ${I}/wrt-generic-${type}.trx ${I}/loader.gz \
18                 ${I}/wrt-kernel-${KERNEL_VERSION}.lzma -a 0x10000 ${I}/${IMAGE_NAME}.rootfs.${type}
19                 
20                 # WRT54GS
21                 addpattern -2 -i ${I}/wrt-generic-${type}.trx -o ${I}/wrt54gs-${type}.trx -g
22                 
23                 # WRT54G
24                 sed "1s,^W54S,W54G," ${I}/wrt54gs-${type}.trx > ${I}/wrt54g-${type}.trx
25                 
26                 # motorola
27                 motorola-bin ${I}/wrt-generic-${type}.trx ${I}/motorola-${type}.bin
28         done;
29 }
30
31 IMAGE_POSTPROCESS_COMMAND += "wrt_create_images;"
32
33 DEPENDS_prepend = "${@["wrt-imagetools-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}"