zaurus-2.6.inc: force creation of jffs2 images
[openembedded.git] / recipes / images / unslung-image.bb
1 COMPATIBLE_MACHINE = "nslu2"
2
3 IMAGE_BASENAME = "unslung"
4 IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DISTRO_VERSION}"
5
6 IMAGE_LINGUAS = ""
7 USE_DEVFS = "1"
8
9 DEPENDS  = "virtual/kernel \
10         ${UNSLUNG_EXTRA_DEPENDS}"
11
12 IMAGE_INSTALL = "kernel update-modules unslung-rootfs \
13         libc6-unslung slingbox ipkg libipkg libgcc \
14         kernel-module-netconsole \
15         ${UNSLUNG_EXTRA_INSTALL}"
16
17 IMAGE_PREPROCESS_COMMAND += "unslung_clean_image; "
18
19 inherit image
20
21 # Note that anything in this function must be repeatable without having to rebuild the rootfs
22 unslung_clean_image () {
23
24         # Remove the patches
25         rm -rf ${IMAGE_ROOTFS}/patches
26
27         # Remove the kernel image
28         rm -rf ${IMAGE_ROOTFS}/boot
29         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/alternatives/zImage
30         # And remove the post and pre scripts for the kernel; saves flash space
31         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/info/kernel.postinst
32         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/info/kernel.postrm
33
34         # Remove all the postinst scripts; don't need them.  But keep the
35         # postrm scripts just in case we need to remove something.
36         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/info/*.postinst
37
38         # Remove info from the local feed used to build the image
39         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/lists/*
40         rm -f ${IMAGE_ROOTFS}/${sysconfdir}/version
41
42         # Tidy up some thing which are in the wrong place
43         mv ${IMAGE_ROOTFS}${libdir}/libipkg* ${IMAGE_ROOTFS}/lib/
44
45         # Remove the ipkg symlink - unsling puts it back in
46         rm -f ${IMAGE_ROOTFS}${bindir}/ipkg
47         # and make the ipkg symlink point to the ipkg-fl utility instead.
48         ln -s ipkg-fl ${IMAGE_ROOTFS}${bindir}/ipkg
49
50         # Hack out the modutils stuff - it's too hard to make it work
51         rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/info/update-modules.postinst
52         rm -rf ${IMAGE_ROOTFS}/etc/rcS.d
53         echo "#!/bin/sh" > ${IMAGE_ROOTFS}/usr/sbin/update-modules
54         echo "exit 0" >> ${IMAGE_ROOTFS}/usr/sbin/update-modules
55         chmod ugo+x ${IMAGE_ROOTFS}/usr/sbin/update-modules
56         echo "#!/bin/sh" > ${IMAGE_ROOTFS}/sbin/depmod
57         echo "exit 0" >> ${IMAGE_ROOTFS}/sbin/depmod
58         chmod ugo+x ${IMAGE_ROOTFS}/sbin/depmod
59
60         # Don't need this empty directory hanging around
61         rm -rf ${IMAGE_ROOTFS}/lib/modules/2.4.22-xfs/pcmcia
62
63         # Strip symbols and fix permissions on the libgcc_s.so.1 library
64         ${STRIP} ${IMAGE_ROOTFS}/lib/libgcc_s.so.1
65         chmod ugo+x ${IMAGE_ROOTFS}/lib/libgcc_s.so.1
66
67         # FIXME: change made 24 Jul 2006 by the OE folks changes the "strip"
68         # behavior to create an extra file named .debug/<filename> containing
69         # the stripped symbols.  These files are supposed to be packaged
70         # separately by the standard bb routines, but for some reason this
71         # does not alway occur.  This extremely ugly step is to remove the
72         # debug cruft from the rootfs if any are left in the obvious locations.
73         # Once someone figures out why and what the right way is to fix this,
74         # this code should be removed.
75
76         rm -rf ${IMAGE_ROOTFS}/bin/.debug
77         rm -rf ${IMAGE_ROOTFS}/sbin/.debug
78         rm -rf ${IMAGE_ROOTFS}/lib/.debug
79         rm -rf ${IMAGE_ROOTFS}/usr/bin/.debug
80         rm -rf ${IMAGE_ROOTFS}/usr/sbin/.debug
81         rm -rf ${IMAGE_ROOTFS}/usr/lib/.debug
82
83 # MJW - Experimental - just to make space; remove before releasing!
84 #       #### Hack to make space for testing!  REMOVE THIS!
85 #       rm -rf ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.850
86 #       rm -rf ${IMAGE_ROOTFS}/bin/ftp
87 #       #### End of Hack!
88
89 }
90
91
92 # Override this function for unslung, since we don't need Apex.
93
94 nslu2_pack_image () {
95         slugimage -p \
96                 -b ${STAGING_LIBDIR}/nslu2-binaries/RedBoot \
97                 -s ${STAGING_LIBDIR}/nslu2-binaries/SysConf \
98                 -k ${DEPLOY_DIR_IMAGE}/zImage-${MACHINE}.bin \
99                 -r Ramdisk:1,Flashdisk:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
100                 -m ${STAGING_FIRMWARE_DIR}/NPE-B \
101                 -t ${STAGING_LIBDIR}/nslu2-binaries/Trailer \
102                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-nslu2.bin
103         slugimage -F -p \
104                 -b ${STAGING_LIBDIR}/nslu2-binaries/RedBoot \
105                 -s ${STAGING_LIBDIR}/nslu2-binaries/SysConf \
106                 -k ${DEPLOY_DIR_IMAGE}/zImage-${MACHINE}.bin \
107                 -r Ramdisk:1,Flashdisk:${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
108                 -m ${STAGING_FIRMWARE_DIR}/NPE-B \
109                 -t ${STAGING_LIBDIR}/nslu2-binaries/Trailer \
110                 -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-nslu2-16mb.bin
111 }