summaryrefslogtreecommitdiff
path: root/i/pc104/initrd/conf/busybox/applets/usage_compressed
diff options
context:
space:
mode:
Diffstat (limited to 'i/pc104/initrd/conf/busybox/applets/usage_compressed')
-rwxr-xr-xi/pc104/initrd/conf/busybox/applets/usage_compressed19
1 files changed, 19 insertions, 0 deletions
diff --git a/i/pc104/initrd/conf/busybox/applets/usage_compressed b/i/pc104/initrd/conf/busybox/applets/usage_compressed
new file mode 100755
index 0000000..fd581cc
--- /dev/null
+++ b/i/pc104/initrd/conf/busybox/applets/usage_compressed
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+target="$1"
+loc="$2"
+
+test "$target" || exit 1
+test "$loc" || loc=.
+test -x "$loc/usage" || exit 1
+test "$SED" || SED=sed
+
+sz=`"$loc/usage" | wc -c` || exit 1
+
+exec >"$target"
+
+echo 'static const char packed_usage[] = '
+"$loc/usage" | bzip2 -1 | od -v -t x1 \
+| $SED -e 's/^[^ ]*//' -e 's/ *\(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
+echo ';'
+echo '#define SIZEOF_usage_messages' `expr 0 + $sz`