initramfs: Don't overwrite $(TARGET_DIR)/init if it exists
authorSimon Pasch <fpasch@googlemail.com>
Sun, 29 Aug 2010 21:32:33 +0000 (23:32 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 29 Aug 2010 21:34:03 +0000 (23:34 +0200)
Closes #2443

Allow use of custom init scripts.

Signed-off-by: Simon Pasch <fpasch@googlemail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
CHANGES
fs/initramfs/initramfs.mk

diff --git a/CHANGES b/CHANGES
index 8550b6f712e329e3392e676994e6cc4897076dc5..7ab4aa4dcc4adf57e163f9ffdd8bd61841a92069 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -27,6 +27,7 @@
 
        #635:  util-linux fails to build in 2009.08
        #2239: netcat package installs its binary to target as avr32-linux...
+       #2443: Initramfs: Don't overwrite $(TARGET_DIR)/init if it exists
        #2449: Minor fixes for squashfs makefile and correct PowerPC e500 ...
 
 2010.08-rc1, Released July 30th, 2010:
index e6d004e9b27eaa35eb2f4b43806890f6e570a3db..30969a4c921afcccfeda22a5888394c15f880bb3 100644 (file)
@@ -13,8 +13,9 @@ INITRAMFS_TARGET:= #nothing
 endif
 
 define ROOTFS_INITRAMFS_INIT_SYMLINK
-       rm -f $(TARGET_DIR)/init
-       ln -s sbin/init $(TARGET_DIR)/init
+       if [ ! -e $(TARGET_DIR)/init ]; then \
+               ln -s sbin/init $(TARGET_DIR)/init; \
+       fi
 endef
 
 ROOTFS_INITRAMFS_PRE_GEN_HOOKS += ROOTFS_INITRAMFS_INIT_SYMLINK