initramfs: fix init symlink creation
authorMike Frysinger <vapier@gentoo.org>
Wed, 17 Nov 2010 06:46:22 +0000 (01:46 -0500)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 17 Nov 2010 20:20:45 +0000 (21:20 +0100)
The -e test will dereference the symlink, so if there is no /bin/init,
we will constantly try to create the symlink.  So rather than error on
subsequent runs when the link exists, use the force flag to ln.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
fs/initramfs/initramfs.mk

index dd6aa94adffc71a8984069b188246981e0e92670..73122a841126f113e3ac27caf331c2c968323cdf 100644 (file)
@@ -8,7 +8,7 @@
 
 define ROOTFS_INITRAMFS_INIT_SYMLINK
        if [ ! -e $(TARGET_DIR)/init ]; then \
-               ln -s sbin/init $(TARGET_DIR)/init; \
+               ln -sf sbin/init $(TARGET_DIR)/init; \
        fi
 endef
 
@@ -20,4 +20,4 @@ endef
 
 ROOTFS_INITRAMFS_POST_TARGETS += linux26-rebuild-with-initramfs
 
-$(eval $(call ROOTFS_TARGET,initramfs))
\ No newline at end of file
+$(eval $(call ROOTFS_TARGET,initramfs))