summaryrefslogtreecommitdiffstats
path: root/fs/initramfs
diff options
context:
space:
mode:
authorSimon Pasch <fpasch@googlemail.com>2010-08-29 23:32:33 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-08-29 23:34:03 +0200
commitc4cdcc3680c5dc551fa563b2133ca83c55967495 (patch)
treecde36a47b1b158bb06b1fdf233e77673ea4a946f /fs/initramfs
parentde846f6e043bf6fe13fb387cd92585a7a70913a7 (diff)
downloadbuildroot-novena-c4cdcc3680c5dc551fa563b2133ca83c55967495.tar.gz
buildroot-novena-c4cdcc3680c5dc551fa563b2133ca83c55967495.zip
initramfs: Don't overwrite $(TARGET_DIR)/init if it exists
Closes #2443 Allow use of custom init scripts. Signed-off-by: Simon Pasch <fpasch@googlemail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'fs/initramfs')
-rw-r--r--fs/initramfs/initramfs.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/initramfs/initramfs.mk b/fs/initramfs/initramfs.mk
index e6d004e9b..30969a4c9 100644
--- a/fs/initramfs/initramfs.mk
+++ b/fs/initramfs/initramfs.mk
@@ -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