Re: [PATCH 1/1] applets: Add installation of individual binaries

2015-05-11 Thread Bernhard Reutner-Fischer
On May 9, 2015 2:12:27 AM GMT+02:00, Matt Weber 
matthew.we...@rockwellcollins.com wrote:
From: Clayton Shotwell clayton.shotw...@rockwellcollins.com

Adding support to install individual binaries if the option is
enabled. This also installs the shared libbusybox.so.* library.


cp -a is not portable, use cp -pPR like in the rest of the file.

Thanks,


Signed-off-by: Clayton Shotwell clayton.shotw...@rockwellcollins.com
Signed-off-by: Matt Weber matthew.we...@rockwellcollins.com
---
 Makefile.custom|4 
 applets/install.sh |   26 --
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Makefile.custom b/Makefile.custom
index 6da79e6..e4dc4dc 100644
--- a/Makefile.custom
+++ b/Makefile.custom
@@ -23,6 +23,10 @@ ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
 INSTALL_OPTS:= --scriptwrapper
 endif
 endif
+ifeq ($(CONFIG_FEATURE_INDIVIDUAL),y)
+INSTALL_OPTS:= --binaries
+LIBBUSYBOX_SONAME:= 0_lib/libbusybox.so.$(BB_VER)
+endif
 install: $(srctree)/applets/install.sh busybox busybox.links
   $(Q)DO_INSTALL_LIBS=$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))
\
   $(SHELL) $ $(CONFIG_PREFIX) $(INSTALL_OPTS)
diff --git a/applets/install.sh b/applets/install.sh
index 95b4719..d01c98d 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -5,19 +5,26 @@ export LC_CTYPE=POSIX
 
 prefix=$1
 if [ -z $prefix ]; then
-  echo usage: applets/install.sh DESTINATION
[--symlinks/--hardlinks/--scriptwrapper]
+  echo usage: applets/install.sh DESTINATION
[--symlinks/--hardlinks/--binaries/--scriptwrapper]
   exit 1
 fi
 
+# Source the configuration
+. ./.config
+
 h=`sort busybox.links | uniq`
 
+sharedlib_dir=0_lib
+
 linkopts=
 scriptwrapper=n
+binaries=n
 cleanup=0
 noclobber=0
 case $2 in
   --hardlinks) linkopts=-f;;
   --symlinks)  linkopts=-fs;;
+  --binaries)  binaries=y;;
   --scriptwrapper) scriptwrapper=y;swrapall=y;;
   --sw-sh-hard)scriptwrapper=y;linkopts=-f;;
   --sw-sh-sym) scriptwrapper=y;linkopts=-fs;;
@@ -40,8 +47,9 @@ if [ -n $DO_INSTALL_LIBS ]  [ $DO_INSTALL_LIBS
!= n ]; then
   for i in $DO_INSTALL_LIBS; do
   rm -f $prefix/$libdir/$i || exit 1
   if [ -f $i ]; then
+  echoInstalling $i to the target at 
$prefix/$libdir/
   cp -pPR $i $prefix/$libdir/ || exit 1
-  chmod 0644 $prefix/$libdir/$i || exit 1
+  chmod 0644 $prefix/$libdir/`basename $i` || exit 1
   fi
   done
 fi
@@ -68,6 +76,7 @@ install -m 755 busybox $prefix/bin/busybox || exit
1
 
 for i in $h; do
   appdir=`dirname $i`
+  app=`basename $i`
   mkdir -p $prefix/$appdir || exit 1
   if [ $scriptwrapper = y ]; then
   if [ $swrapall != y ]  [ $i = /bin/sh ]; then
@@ -78,6 +87,19 @@ for i in $h; do
   chmod +x $prefix/$i
   fi
   echo   $prefix/$i
+  elif [ $binaries = y ]; then
+  # Copy the binary over rather
+  if [ -e $sharedlib_dir/$app ]; then
+  if [ $noclobber = 0 ] || [ ! -e $prefix/$i ]; then
+  echoCopying $sharedlib_dir/$app to 
$prefix/$i
+  cp -a $sharedlib_dir/$app $prefix/$i || exit 1
+  else
+  echo   $prefix/$i already exists
+  fi
+  else
+  echo Error: Could not find $sharedlib_dir/$app
+  exit 1
+  fi
   else
   if [ $2 = --hardlinks ]; then
   bb_path=$prefix/bin/busybox


___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH 1/1] applets: Add installation of individual binaries

2015-05-11 Thread Clayton Shotwell
Bernhard,

On Mon, May 11, 2015 at 2:12 AM, Bernhard Reutner-Fischer
rep.dot@gmail.com wrote:
 On May 9, 2015 2:12:27 AM GMT+02:00, Matt Weber 
 matthew.we...@rockwellcollins.com wrote:
From: Clayton Shotwell clayton.shotw...@rockwellcollins.com

Adding support to install individual binaries if the option is
enabled. This also installs the shared libbusybox.so.* library.


 cp -a is not portable, use cp -pPR like in the rest of the file.


I can definitely make that change and send out a new version of the patch.


Thanks,
Clayton Shotwell
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH 1/1] applets: Add installation of individual binaries

2015-05-08 Thread Matt Weber
From: Clayton Shotwell clayton.shotw...@rockwellcollins.com

Adding support to install individual binaries if the option is
enabled. This also installs the shared libbusybox.so.* library.

Signed-off-by: Clayton Shotwell clayton.shotw...@rockwellcollins.com
Signed-off-by: Matt Weber matthew.we...@rockwellcollins.com
---
 Makefile.custom|4 
 applets/install.sh |   26 --
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Makefile.custom b/Makefile.custom
index 6da79e6..e4dc4dc 100644
--- a/Makefile.custom
+++ b/Makefile.custom
@@ -23,6 +23,10 @@ ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
 INSTALL_OPTS:= --scriptwrapper
 endif
 endif
+ifeq ($(CONFIG_FEATURE_INDIVIDUAL),y)
+INSTALL_OPTS:= --binaries
+LIBBUSYBOX_SONAME:= 0_lib/libbusybox.so.$(BB_VER)
+endif
 install: $(srctree)/applets/install.sh busybox busybox.links
$(Q)DO_INSTALL_LIBS=$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS)) \
$(SHELL) $ $(CONFIG_PREFIX) $(INSTALL_OPTS)
diff --git a/applets/install.sh b/applets/install.sh
index 95b4719..d01c98d 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -5,19 +5,26 @@ export LC_CTYPE=POSIX
 
 prefix=$1
 if [ -z $prefix ]; then
-   echo usage: applets/install.sh DESTINATION 
[--symlinks/--hardlinks/--scriptwrapper]
+   echo usage: applets/install.sh DESTINATION 
[--symlinks/--hardlinks/--binaries/--scriptwrapper]
exit 1
 fi
 
+# Source the configuration
+. ./.config
+
 h=`sort busybox.links | uniq`
 
+sharedlib_dir=0_lib
+
 linkopts=
 scriptwrapper=n
+binaries=n
 cleanup=0
 noclobber=0
 case $2 in
--hardlinks) linkopts=-f;;
--symlinks)  linkopts=-fs;;
+   --binaries)  binaries=y;;
--scriptwrapper) scriptwrapper=y;swrapall=y;;
--sw-sh-hard)scriptwrapper=y;linkopts=-f;;
--sw-sh-sym) scriptwrapper=y;linkopts=-fs;;
@@ -40,8 +47,9 @@ if [ -n $DO_INSTALL_LIBS ]  [ $DO_INSTALL_LIBS != n 
]; then
for i in $DO_INSTALL_LIBS; do
rm -f $prefix/$libdir/$i || exit 1
if [ -f $i ]; then
+   echoInstalling $i to the target at 
$prefix/$libdir/
cp -pPR $i $prefix/$libdir/ || exit 1
-   chmod 0644 $prefix/$libdir/$i || exit 1
+   chmod 0644 $prefix/$libdir/`basename $i` || exit 1
fi
done
 fi
@@ -68,6 +76,7 @@ install -m 755 busybox $prefix/bin/busybox || exit 1
 
 for i in $h; do
appdir=`dirname $i`
+   app=`basename $i`
mkdir -p $prefix/$appdir || exit 1
if [ $scriptwrapper = y ]; then
if [ $swrapall != y ]  [ $i = /bin/sh ]; then
@@ -78,6 +87,19 @@ for i in $h; do
chmod +x $prefix/$i
fi
echo   $prefix/$i
+   elif [ $binaries = y ]; then
+   # Copy the binary over rather
+   if [ -e $sharedlib_dir/$app ]; then
+   if [ $noclobber = 0 ] || [ ! -e $prefix/$i ]; then
+   echoCopying $sharedlib_dir/$app to 
$prefix/$i
+   cp -a $sharedlib_dir/$app $prefix/$i || exit 1
+   else
+   echo   $prefix/$i already exists
+   fi
+   else
+   echo Error: Could not find $sharedlib_dir/$app
+   exit 1
+   fi
else
if [ $2 = --hardlinks ]; then
bb_path=$prefix/bin/busybox
-- 
1.7.1

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox