rootfs_ipk: Add a remove_init_link function to the rootfs_ipk oeclass. This is needed...
authorRichard Purdie <rpurdie@rpsys.net>
Tue, 27 Sep 2005 21:35:38 +0000 (21:35 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Tue, 27 Sep 2005 21:35:38 +0000 (21:35 +0000)
classes/rootfs_ipk.bbclass
conf/machine/nokia770.conf

index 062c957..2880411 100644 (file)
@@ -130,7 +130,16 @@ create_etc_timestamp() {
        date +%2m%2d%2H%2M%Y >${IMAGE_ROOTFS}/etc/timestamp
 }
 
-# export the zap_root_password and create_etc_timestamp
-EXPORT_FUNCTIONS zap_root_password create_etc_timestamp
+# Turn any symbolic /sbin/init link into a file
+remove_init_link () {
+       if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
+               LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init`
+               rm ${IMAGE_ROOTFS}/sbin/init
+               cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init
+       fi
+}
+
+# export the zap_root_password, create_etc_timestamp and remote_init_link
+EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link
 
 addtask rootfs before do_build after do_install
index 8b65728..9f49f24 100644 (file)
@@ -54,5 +54,7 @@ pcmcia-cs apm  ppp wireless-tools console-tools"
 #BOOTSTRAP_EXTRA_RDEPENDS += "kernel-module-gadgetfs kernel-module-g-file-storage kernel-module-g-serial \
 #                                                       kernel-module-g-ether"
 
+ROOTFS_POSTPROCESS_COMMAND += " remove_init_link; "
+
 include conf/machine/handheld-common.conf