aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClayton Shotwell <clshotwe@rockwellcollins.com>2015-05-21 14:48:35 -0500
committerDenys Vlasenko <vda.linux@googlemail.com>2015-07-01 19:10:03 +0200
commitb7ee7e1e13fa4a680e8b228bd158e7aa53fe342a (patch)
tree1c351c9e423a876a7caab32cfa83795f5807b64e
parentc9091d8947b6f0e28485eadab11d737e4c910430 (diff)
downloadbusybox-w32-b7ee7e1e13fa4a680e8b228bd158e7aa53fe342a.tar.gz
busybox-w32-b7ee7e1e13fa4a680e8b228bd158e7aa53fe342a.tar.bz2
busybox-w32-b7ee7e1e13fa4a680e8b228bd158e7aa53fe342a.zip
applets: Add installation of individual binaries
Adding support to install individual binaries if the option is enabled. This also installs the shared libbusybox.so.* library. Signed-off-by: Clayton Shotwell <clshotwe@rockwellcollins.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Makefile.custom4
-rwxr-xr-xapplets/install.sh26
2 files changed, 28 insertions, 2 deletions
diff --git a/Makefile.custom b/Makefile.custom
index f8a12831d..891c9ced7 100644
--- a/Makefile.custom
+++ b/Makefile.custom
@@ -28,6 +28,10 @@ ifeq ($(CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER),y)
28INSTALL_OPTS:= --scriptwrapper 28INSTALL_OPTS:= --scriptwrapper
29endif 29endif
30endif 30endif
31ifeq ($(CONFIG_FEATURE_INDIVIDUAL),y)
32INSTALL_OPTS:= --binaries
33LIBBUSYBOX_SONAME:= 0_lib/libbusybox.so.$(BB_VER)
34endif
31install: $(srctree)/applets/install.sh busybox busybox.links 35install: $(srctree)/applets/install.sh busybox busybox.links
32 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \ 36 $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
33 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS) 37 $(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
diff --git a/applets/install.sh b/applets/install.sh
index 95b4719d4..f6c097e57 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -5,19 +5,26 @@ export LC_CTYPE=POSIX
5 5
6prefix=$1 6prefix=$1
7if [ -z "$prefix" ]; then 7if [ -z "$prefix" ]; then
8 echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--scriptwrapper]" 8 echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--binaries/--scriptwrapper]"
9 exit 1 9 exit 1
10fi 10fi
11 11
12# Source the configuration
13. ./.config
14
12h=`sort busybox.links | uniq` 15h=`sort busybox.links | uniq`
13 16
17sharedlib_dir="0_lib"
18
14linkopts="" 19linkopts=""
15scriptwrapper="n" 20scriptwrapper="n"
21binaries="n"
16cleanup="0" 22cleanup="0"
17noclobber="0" 23noclobber="0"
18case "$2" in 24case "$2" in
19 --hardlinks) linkopts="-f";; 25 --hardlinks) linkopts="-f";;
20 --symlinks) linkopts="-fs";; 26 --symlinks) linkopts="-fs";;
27 --binaries) binaries="y";;
21 --scriptwrapper) scriptwrapper="y";swrapall="y";; 28 --scriptwrapper) scriptwrapper="y";swrapall="y";;
22 --sw-sh-hard) scriptwrapper="y";linkopts="-f";; 29 --sw-sh-hard) scriptwrapper="y";linkopts="-f";;
23 --sw-sh-sym) scriptwrapper="y";linkopts="-fs";; 30 --sw-sh-sym) scriptwrapper="y";linkopts="-fs";;
@@ -40,8 +47,9 @@ if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
40 for i in $DO_INSTALL_LIBS; do 47 for i in $DO_INSTALL_LIBS; do
41 rm -f "$prefix/$libdir/$i" || exit 1 48 rm -f "$prefix/$libdir/$i" || exit 1
42 if [ -f "$i" ]; then 49 if [ -f "$i" ]; then
50 echo " Installing $i to the target at $prefix/$libdir/"
43 cp -pPR "$i" "$prefix/$libdir/" || exit 1 51 cp -pPR "$i" "$prefix/$libdir/" || exit 1
44 chmod 0644 "$prefix/$libdir/$i" || exit 1 52 chmod 0644 "$prefix/$libdir/`basename $i`" || exit 1
45 fi 53 fi
46 done 54 done
47fi 55fi
@@ -68,6 +76,7 @@ install -m 755 busybox "$prefix/bin/busybox" || exit 1
68 76
69for i in $h; do 77for i in $h; do
70 appdir=`dirname "$i"` 78 appdir=`dirname "$i"`
79 app=`basename "$i"`
71 mkdir -p "$prefix/$appdir" || exit 1 80 mkdir -p "$prefix/$appdir" || exit 1
72 if [ "$scriptwrapper" = "y" ]; then 81 if [ "$scriptwrapper" = "y" ]; then
73 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then 82 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then
@@ -78,6 +87,19 @@ for i in $h; do
78 chmod +x "$prefix/$i" 87 chmod +x "$prefix/$i"
79 fi 88 fi
80 echo " $prefix/$i" 89 echo " $prefix/$i"
90 elif [ "$binaries" = "y" ]; then
91 # Copy the binary over rather
92 if [ -e $sharedlib_dir/$app ]; then
93 if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then
94 echo " Copying $sharedlib_dir/$app to $prefix/$i"
95 cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
96 else
97 echo " $prefix/$i already exists"
98 fi
99 else
100 echo "Error: Could not find $sharedlib_dir/$app"
101 exit 1
102 fi
81 else 103 else
82 if [ "$2" = "--hardlinks" ]; then 104 if [ "$2" = "--hardlinks" ]; then
83 bb_path="$prefix/bin/busybox" 105 bb_path="$prefix/bin/busybox"