From 1035fbcc10d4bd720b57f3b8d425681e6c6621d8 Mon Sep 17 00:00:00 2001 From: Kalle Jokiniemi Date: Mon, 13 Jul 2015 16:23:01 +0300 Subject: [PATCH] [moslo] Don't overwrite existing tools with busybox links. Fixes NEMO#840 If you need to replace any of standard busybox tools with stand-alone version, you can't do that currently as we overwrite everything by installing busybox links after user defined tools have been installed. Changed the busybox tool links installation to only add missing tools and to update only symbolic links. rsync had to be used as cp is too old and is missing option for skipping existing files. Signed-off-by: Kalle Jokiniemi --- initfs/scripts/moslo-build.sh | 11 +++++++++-- rpm/hw-ramdisk.spec | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/initfs/scripts/moslo-build.sh b/initfs/scripts/moslo-build.sh index 9dfc348..bcb186c 100755 --- a/initfs/scripts/moslo-build.sh +++ b/initfs/scripts/moslo-build.sh @@ -341,9 +341,16 @@ rm -f $TMPFILE # Create (and fix) busybox links BUSYBOX_BINARY=`find $ROOT_DIR -name "busybox*"` echo "$BUSYBOX_BINARY" -${BUSYBOX_BINARY} --install -s $ROOT_DIR/bin/ +BUSYBOX_TMP=$(mktemp -d -p $ROOT_DIR) +mkdir -p $BUSYBOX_TMP/bin + +${BUSYBOX_BINARY} --install -s $BUSYBOX_TMP/bin/ +rsync -l --ignore-existing $BUSYBOX_TMP/bin/* $ROOT_DIR/bin/ +rm -rf $BUSYBOX_TMP for l in $ROOT_DIR/bin/*; do - ln -sf /sbin/busybox-static $l + if test -h $l; then + ln -sf /sbin/busybox-static $l + fi done # diff --git a/rpm/hw-ramdisk.spec b/rpm/hw-ramdisk.spec index de6447b..e38cfb2 100644 --- a/rpm/hw-ramdisk.spec +++ b/rpm/hw-ramdisk.spec @@ -10,6 +10,7 @@ BuildRequires: findutils BuildRequires: gzip BuildRequires: cpio Requires: busybox-static +Requires: rsync %description