diff options
Diffstat (limited to 'applets/usage_compressed')
-rwxr-xr-x | applets/usage_compressed | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/applets/usage_compressed b/applets/usage_compressed index 8d343529d..12efd2c9c 100755 --- a/applets/usage_compressed +++ b/applets/usage_compressed | |||
@@ -9,12 +9,19 @@ test -x "$loc/usage" || exit 1 | |||
9 | test "$SED" || SED=sed | 9 | test "$SED" || SED=sed |
10 | test "$DD" || DD=dd | 10 | test "$DD" || DD=dd |
11 | 11 | ||
12 | sz=`"$loc/usage" | wc -c` || exit 1 | ||
13 | |||
14 | exec >"$target" | 12 | exec >"$target" |
15 | 13 | ||
16 | echo 'static const char packed_usage[] ALIGN1 = {' | 14 | echo '#define UNPACKED_USAGE \' |
15 | "$loc/usage" | od -v -t x1 \ | ||
16 | | $SED -e 's/^[^ ]*//' \ | ||
17 | -e 's/ //g' \ | ||
18 | -e '/^$/d' \ | ||
19 | -e 's/\(..\)/\\x\1/g' \ | ||
20 | -e 's/^/"/' \ | ||
21 | -e 's/$/" \\/' | ||
22 | echo '' | ||
17 | 23 | ||
24 | echo '#define PACKED_USAGE \' | ||
18 | ## Breaks on big-endian systems! | 25 | ## Breaks on big-endian systems! |
19 | ## # Extra effort to avoid using "od -t x1": -t is not available | 26 | ## # Extra effort to avoid using "od -t x1": -t is not available |
20 | ## # in non-CONFIG_DESKTOPed busybox od | 27 | ## # in non-CONFIG_DESKTOPed busybox od |
@@ -24,12 +31,11 @@ echo 'static const char packed_usage[] ALIGN1 = {' | |||
24 | ## -e 's/ //g' \ | 31 | ## -e 's/ //g' \ |
25 | ## -e '/^$/d' \ | 32 | ## -e '/^$/d' \ |
26 | ## -e 's/\(..\)\(..\)/0x\2,0x\1,/g' | 33 | ## -e 's/\(..\)\(..\)/0x\2,0x\1,/g' |
27 | 34 | ## -e 's/$/ \\/' | |
28 | "$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 2>/dev/null | od -v -t x1 \ | 35 | "$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 2>/dev/null | od -v -t x1 \ |
29 | | $SED -e 's/^[^ ]*//' \ | 36 | | $SED -e 's/^[^ ]*//' \ |
30 | -e 's/ //g' \ | 37 | -e 's/ //g' \ |
31 | -e '/^$/d' \ | 38 | -e '/^$/d' \ |
32 | -e 's/\(..\)/0x\1,/g' | 39 | -e 's/\(..\)/0x\1,/g' \ |
33 | 40 | -e 's/$/ \\/' | |
34 | echo '};' | 41 | echo '' |
35 | echo '#define SIZEOF_usage_messages' `expr 0 + $sz` | ||