diff options
| author | Mhd Sulhan <ms@kilabit.info> | 2015-09-02 15:10:50 +0700 |
|---|---|---|
| committer | Mhd Sulhan <ms@kilabit.info> | 2015-09-02 15:10:50 +0700 |
| commit | 1416433db7bba2bf06b1355ff48d526075ea82ff (patch) | |
| tree | 9b096c018b011bad7e5daa0b1b98ede74c47ca43 | |
| parent | 57f81d8294ad99e78fd0d1725f14e0c2f38f9fe8 (diff) | |
| download | arch-docker-1416433db7bba2bf06b1355ff48d526075ea82ff.tar.xz | |
arch-base: include binutils and sed packages.
* Add en_US to locale.
* Change LC_MESSAGES to "C".
* Move and make strip command as function.
* Group strip commands into strip_bin and strip_lib functions.
* Group clean commands into clean_common function .
| -rwxr-xr-x | arch-base/bootstrap.sh | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/arch-base/bootstrap.sh b/arch-base/bootstrap.sh index 971f728..84b4767 100755 --- a/arch-base/bootstrap.sh +++ b/arch-base/bootstrap.sh @@ -6,11 +6,36 @@ ## (4) generate locale. ## (5) set locale preferences. ## (6) stripping binaries. -## (7) remove unneeded files. -## (8) remove unneeded packages. +## (7) remove unneeded packages. +## (8) remove unneeded files. shopt -s extglob +strip_bin() { + find /usr/bin -type f \( -perm -0100 \) -print | + xargs file | + sed -n '/executable .*not stripped/s/: TAB .*//p' | + xargs -rt strip --strip-unneeded +} + +strip_lib() { + find /usr/lib -type f \( -perm -0100 \) -print | + xargs file | + sed -n '/executable .*not stripped/s/: TAB .*//p' | + xargs -rt strip --strip-unneeded +} + +clean_common() { + rm -rf /usr/include/* + rm -rf /usr/share/doc/* + rm -rf /usr/share/licenses/* + rm -rf /usr/share/locale/* + rm -rf /usr/share/man/* + rm -rf /usr/share/info/* + rm -rf /var/cache/pacman/pkg/* + rm -rf /var/log/* +} + ## (0) export LANG=C.UTF-8 @@ -25,6 +50,7 @@ cp /usr/share/zoneinfo/UTC /etc/localtime ## (3) echo "==> set locale to en_GB.UTF-8." echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen +echo "en_US.UTF-8 UTF-8" > /etc/locale.gen ## (4) echo "==> generate locale." @@ -33,34 +59,24 @@ echo "==> generate locale." ## (5) echo "==> set locale preferences." echo "LANG=en_GB.UTF-8" > "$rootfs"/etc/locale.conf -echo "LC_MESSAGES=C.UTF-8" >> "$rootfs"/etc/locale.conf +echo "LC_MESSAGES=C" >> "$rootfs"/etc/locale.conf ## (6) echo "==> striping binaries." -cd / - -find usr/bin -type f \( -perm -0100 \) -print | - xargs file | - sed -n '/executable .*not stripped/s/: TAB .*//p' | - xargs -rt strip --strip-unneeded - -find usr/lib -type f \( -perm -0100 \) -print | - xargs file | - sed -n '/executable .*not stripped/s/: TAB .*//p' | - xargs -rt strip --strip-unneeded +strip_bin +strip_lib ## (7) -echo "==> cleaning." +pacman -Rs --noconfirm db +pacman -Rdd --noconfirm perl -cd / -rm -r usr/share/perl5/* -rm -r usr/share/locale/* -rm -r usr/share/man/* +## (8) +echo "==> cleaning." -find usr/share/i18n/charmaps/ \! -name "UTF-8.gz" -delete -find usr/share/i18n/locales/ \! -name "en_GB" -delete +find /usr/share/i18n/charmaps/ \! -name "UTF-8.gz" -delete +find /usr/share/i18n/locales/ \! -name "en_GB" -delete -find usr/share/terminfo/ \ +find /usr/share/terminfo/ \ \! -name ansi \ \! -name cygwin \ \! -name linux \ @@ -70,21 +86,10 @@ find usr/share/terminfo/ \ \! -name xterm \ -delete -rm -r usr/share/texinfo/* -rm -r usr/share/zoneinfo/* -rm -r usr/share/doc/* -rm -r usr/share/iana-etc/* -rm -r usr/share/info/* -rm -r usr/share/gtk-doc/* -rm -r usr/share/readline/* -rm -r usr/share/licenses/* - -rm -r usr/include/* - - -## (8) remove unneeded packages. -pacman -Rs --noconfirm sed binutils db -pacman -Rdd --noconfirm perl +rm -rf /usr/share/texinfo/* +rm -rf /usr/share/zoneinfo/* +rm -rf /usr/share/iana-etc/* +rm -rf /usr/share/gtk-doc/* +rm -rf /usr/share/readline/* -rm -r var/cache/pacman/pkg/* -rm -r var/log/* +clean_common |
