summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-02 10:16:08 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-02 10:18:20 +0000
commit8ac3ad1c206ffea37fb24d678951505a2b289aa4 (patch)
tree8183bd6b97d5929793ba5631e7bfb505209f5dcf
parent37b9f371440caeac6d33ce3d52752e2bf08cbac3 (diff)
downloadinfrastructure-8ac3ad1c206ffea37fb24d678951505a2b289aa4.tar.gz
Add 'shrink' configure extension
Just a bit of a hack to reduce image sizes, in the absence of debug stripping.
-rw-r--r--shrink.configure26
-rw-r--r--systems/build-system-armv7lhf-jetson.morph1
2 files changed, 27 insertions, 0 deletions
diff --git a/shrink.configure b/shrink.configure
new file mode 100644
index 00000000..6574f651
--- /dev/null
+++ b/shrink.configure
@@ -0,0 +1,26 @@
+# Shrink images a bit.
+
+# If you're not deploying on ARM, you need to have a cross 'strip' available...
+# you can use the armv7lhf-cross-toolchain stratum.
+STRIP=arm-none-eabi-strip
+
+root=$1
+
+gcc_libexec=$1/usr/libexec/gcc/armv7-unknown-linux-gnueabihf/4.9.2/
+# Just delete Fortan
+rm $gcc_libexec/f951
+
+$STRIP $gcc_libexec/cc1
+$STRIP $gcc_libexec/cc1plus
+$STRIP $gcc_libexec/collect2
+$STRIP $gcc_libexec/lto1
+$STRIP $gcc_libexec/plugins/gengtype
+
+$STRIP $1/usr/libexec/git-core
+$STRIP $1/bin/*
+$STRIP $1/usr/bin/*
+$STRIP $1/lib/*.so
+$STRIP $1/usr/lib/*.so
+
+rm -R $1/usr/share/doc
+rm -R $1/usr/share/man
diff --git a/systems/build-system-armv7lhf-jetson.morph b/systems/build-system-armv7lhf-jetson.morph
index cc4c9bf9..c8c3d02b 100644
--- a/systems/build-system-armv7lhf-jetson.morph
+++ b/systems/build-system-armv7lhf-jetson.morph
@@ -38,3 +38,4 @@ configuration-extensions:
- fstab
- mason
- cloud-init
+- shrink