diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-20 21:57:11 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-20 21:57:11 +0000 |
commit | 51154bacbe34d160f089c4ab4bbb51766030233d (patch) | |
tree | d4cc96083ccdfb95c031f92aacfb1b3f8c08dc97 | |
parent | 3950596e1e13d3593d06ab3cf1e48a07d5bd80c9 (diff) | |
download | busybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.tar.gz busybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.tar.bz2 busybox-w32-51154bacbe34d160f089c4ab4bbb51766030233d.zip |
Adjusted install.sh to use relative symlinks, and to optionally
create hardlinks. Added a makefile target to create hardlinks.
-Erik
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | applets/install.sh | 44 | ||||
-rwxr-xr-x | install.sh | 44 |
3 files changed, 80 insertions, 17 deletions
@@ -23,6 +23,9 @@ VERSION := 0.46 | |||
23 | BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z") | 23 | BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z") |
24 | export VERSION | 24 | export VERSION |
25 | 25 | ||
26 | # If you want a static binary, turn this on. | ||
27 | DOSTATIC = false | ||
28 | |||
26 | # Set the following to `true' to make a debuggable build. | 29 | # Set the following to `true' to make a debuggable build. |
27 | # Leave this set to `false' for production use. | 30 | # Leave this set to `false' for production use. |
28 | # eg: `make DODEBUG=true tests' | 31 | # eg: `make DODEBUG=true tests' |
@@ -37,9 +40,6 @@ DODEBUG = false | |||
37 | # Do not enable this for production builds... | 40 | # Do not enable this for production builds... |
38 | DODMALLOC = false | 41 | DODMALLOC = false |
39 | 42 | ||
40 | # If you want a static binary, turn this on. | ||
41 | DOSTATIC = false | ||
42 | |||
43 | # If you are running a cross compiler, you may want to set this | 43 | # If you are running a cross compiler, you may want to set this |
44 | # to something more interesting... | 44 | # to something more interesting... |
45 | CROSS = | 45 | CROSS = |
@@ -182,6 +182,9 @@ distclean: clean | |||
182 | install: busybox busybox.links | 182 | install: busybox busybox.links |
183 | ./install.sh $(PREFIX) | 183 | ./install.sh $(PREFIX) |
184 | 184 | ||
185 | install-hardlinks: busybox busybox.links | ||
186 | ./install.sh $(PREFIX) --hardlinks | ||
187 | |||
185 | dist release: distclean doc | 188 | dist release: distclean doc |
186 | cd ..; \ | 189 | cd ..; \ |
187 | rm -rf busybox-$(VERSION); \ | 190 | rm -rf busybox-$(VERSION); \ |
diff --git a/applets/install.sh b/applets/install.sh index 65190f59d..236f62a56 100755 --- a/applets/install.sh +++ b/applets/install.sh | |||
@@ -1,21 +1,51 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -e | 3 | set -e |
4 | 4 | set -x | |
5 | if [ "$1" = "" ]; then | 5 | if [ "$1" = "" ]; then |
6 | echo "No installation directory, aborting." | 6 | echo "No installation directory, aborting." |
7 | exit 1; | 7 | exit 1; |
8 | fi | 8 | fi |
9 | 9 | if [ "$2" = "--hardlinks" ]; then | |
10 | linkopts="-f" | ||
11 | else | ||
12 | linkopts="-fs" | ||
13 | fi | ||
14 | prefix=$1 | ||
10 | h=`sort busybox.links | uniq` | 15 | h=`sort busybox.links | uniq` |
11 | 16 | ||
12 | for i in $h ; do | 17 | |
13 | echo " $1$i -> /bin/busybox" | ||
14 | mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' ` | ||
15 | ln -fs /bin/busybox $1$i | ||
16 | done | ||
17 | rm -f $1/bin/busybox | 18 | rm -f $1/bin/busybox |
18 | mkdir -p $1/bin | 19 | mkdir -p $1/bin |
19 | install -m 755 busybox $1/bin/busybox | 20 | install -m 755 busybox $1/bin/busybox |
20 | 21 | ||
22 | for i in $h ; do | ||
23 | appdir=`dirname $i` | ||
24 | mkdir -p $prefix/$appdir | ||
25 | if [ "$2" = "--hardlinks" ]; then | ||
26 | bb_path="$prefix/bin/busybox" | ||
27 | else | ||
28 | case "$appdir" in | ||
29 | /) | ||
30 | bb_path="bin/busybox" | ||
31 | ;; | ||
32 | /bin) | ||
33 | bb_path="busybox" | ||
34 | ;; | ||
35 | /sbin) | ||
36 | bb_path="../bin/busybox" | ||
37 | ;; | ||
38 | /usr/bin|/usr/sbin) | ||
39 | bb_path="../../bin/busybox" | ||
40 | ;; | ||
41 | *) | ||
42 | echo "Unknown installation directory: $appdir" | ||
43 | exit 1 | ||
44 | ;; | ||
45 | esac | ||
46 | fi | ||
47 | echo " $prefix$i -> /bin/busybox" | ||
48 | ln $linkopts $bb_path $prefix$i | ||
49 | done | ||
50 | |||
21 | exit 0 | 51 | exit 0 |
diff --git a/install.sh b/install.sh index 65190f59d..236f62a56 100755 --- a/install.sh +++ b/install.sh | |||
@@ -1,21 +1,51 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -e | 3 | set -e |
4 | 4 | set -x | |
5 | if [ "$1" = "" ]; then | 5 | if [ "$1" = "" ]; then |
6 | echo "No installation directory, aborting." | 6 | echo "No installation directory, aborting." |
7 | exit 1; | 7 | exit 1; |
8 | fi | 8 | fi |
9 | 9 | if [ "$2" = "--hardlinks" ]; then | |
10 | linkopts="-f" | ||
11 | else | ||
12 | linkopts="-fs" | ||
13 | fi | ||
14 | prefix=$1 | ||
10 | h=`sort busybox.links | uniq` | 15 | h=`sort busybox.links | uniq` |
11 | 16 | ||
12 | for i in $h ; do | 17 | |
13 | echo " $1$i -> /bin/busybox" | ||
14 | mkdir -p $1/`echo $i | sed -e 's/\/[^\/]*$//' ` | ||
15 | ln -fs /bin/busybox $1$i | ||
16 | done | ||
17 | rm -f $1/bin/busybox | 18 | rm -f $1/bin/busybox |
18 | mkdir -p $1/bin | 19 | mkdir -p $1/bin |
19 | install -m 755 busybox $1/bin/busybox | 20 | install -m 755 busybox $1/bin/busybox |
20 | 21 | ||
22 | for i in $h ; do | ||
23 | appdir=`dirname $i` | ||
24 | mkdir -p $prefix/$appdir | ||
25 | if [ "$2" = "--hardlinks" ]; then | ||
26 | bb_path="$prefix/bin/busybox" | ||
27 | else | ||
28 | case "$appdir" in | ||
29 | /) | ||
30 | bb_path="bin/busybox" | ||
31 | ;; | ||
32 | /bin) | ||
33 | bb_path="busybox" | ||
34 | ;; | ||
35 | /sbin) | ||
36 | bb_path="../bin/busybox" | ||
37 | ;; | ||
38 | /usr/bin|/usr/sbin) | ||
39 | bb_path="../../bin/busybox" | ||
40 | ;; | ||
41 | *) | ||
42 | echo "Unknown installation directory: $appdir" | ||
43 | exit 1 | ||
44 | ;; | ||
45 | esac | ||
46 | fi | ||
47 | echo " $prefix$i -> /bin/busybox" | ||
48 | ln $linkopts $bb_path $prefix$i | ||
49 | done | ||
50 | |||
21 | exit 0 | 51 | exit 0 |