summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-06-10 22:33:00 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-06-12 11:27:57 +0000
commit76bab46026741f401ae8501dd458d90182781b1f (patch)
tree038b011e1acdb22bbc44e8b219c83571c682d202
parent3d6d13ffb4d44c27837884fcb4be337615acc514 (diff)
Rework: Move xz/gzip switch to post-install.
This is highly unlikely to be upstreamed in any other form than this. Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--patches/fuel-agent/0008-bootstrap-Use-gzip-instead-of-xz-compression.patch35
-rw-r--r--patches/opnfv-fuel/0033-bootstrap-Use-gzip-instead-of-xz-compression.patch52
2 files changed, 52 insertions, 35 deletions
diff --git a/patches/fuel-agent/0008-bootstrap-Use-gzip-instead-of-xz-compression.patch b/patches/fuel-agent/0008-bootstrap-Use-gzip-instead-of-xz-compression.patch
deleted file mode 100644
index 19176c90..00000000
--- a/patches/fuel-agent/0008-bootstrap-Use-gzip-instead-of-xz-compression.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Wed, 9 Mar 2016 23:02:17 +0100
-Subject: [PATCH] bootstrap: Use gzip instead of xz compression.
-
-bootstrap mksquashfs using qemu-user-static is extremely slow,
-taking up to one hour. gzip, on the other hand, is reasonably fast.
-According to [1], xz is slower, with not much size gain.
-
-[1] https://jonathancarter.org/2015/04/06/squashfs-performance-testing/
----
- contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/consts.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/consts.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/consts.py
-index d507156..688197d 100644
---- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/consts.py
-+++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/consts.py
-@@ -24,7 +24,7 @@ COMPRESSED_CONTAINER_FORMAT = "tar.gz"
- UNCOMPRESSED_CONTAINER_FORMAT = "directory"
- ROOTFS = {'name': 'rootfs',
- 'mask': 'rootfs',
-- 'compress_format': 'xz',
-+ 'compress_format': 'gzip',
- 'uri': 'http://127.0.0.1:8080/bootstraps/{uuid}/root.squashfs',
- 'format': 'ext4',
- 'container': 'raw'}
-@@ -34,7 +34,7 @@ BOOTSTRAP_MODULES = [
- 'uri': 'http://127.0.0.1:8080/bootstraps/{uuid}/vmlinuz'},
- {'name': 'initrd',
- 'mask': 'initrd',
-- 'compress_format': 'xz',
-+ 'compress_format': 'gzip',
- 'uri': 'http://127.0.0.1:8080/bootstraps/{uuid}/initrd.img'},
- ROOTFS
- ]
diff --git a/patches/opnfv-fuel/0033-bootstrap-Use-gzip-instead-of-xz-compression.patch b/patches/opnfv-fuel/0033-bootstrap-Use-gzip-instead-of-xz-compression.patch
new file mode 100644
index 00000000..e7b176b9
--- /dev/null
+++ b/patches/opnfv-fuel/0033-bootstrap-Use-gzip-instead-of-xz-compression.patch
@@ -0,0 +1,52 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Fri, 10 Jun 2016 22:30:29 +0200
+Subject: [PATCH] bootstrap: Use gzip instead of xz compression.
+
+bootstrap mksquashfs using qemu-user-static is extremely slow,
+taking up to one hour. gzip, on the other hand, is reasonably fast.
+According to [1], xz is slower, with not much size gain.
+
+[1] https://jonathancarter.org/2015/04/06/squashfs-performance-testing/
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ .../post-scripts/80_prepare_cross_builds.sh | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
+index 3839d62..7ceaacc 100755
+--- a/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
++++ b/build/f_isoroot/f_bootstrap/post-scripts/80_prepare_cross_builds.sh
+@@ -27,6 +27,11 @@ if which dpkg > /dev/null 2>&1; then
+ exit 1
+ fi
+
++ # Determine python site-packages directory location
++ PYTHON_SITEPKGS_DIR=$(python -c \
++ "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
++ [ -d ${PYTHON_SITEPKGS_DIR} ] || exit 1
++
+ # Cross-build timeout adjustments
+ #
+ # Since `execute_shell_command` mcagent is used for building the target
+@@ -40,6 +45,20 @@ if which dpkg > /dev/null 2>&1; then
+ # the maximum timeout value for mcagent has to be increased (use 2h).
+ sed -i.bak -r 's/^(\s+:timeout\s*=>)\s*[[:digit:]]+$/\1 7200/' \
+ /usr/libexec/mcollective/mcollective/agent/execute_shell_command.ddl
++
++ # Bootstrap: Use gzip instead of xz compression.
++ #
++ # bootstrap mksquashfs via `qemu-user-static` is extremely slow,
++ # taking up to one hour. gzip, on the other hand, is reasonably fast.
++
++ # See the following article for a comparison between gzip and xz
++ # https://jonathancarter.org/2015/04/06/squashfs-performance-testing/
++ # xz is slower, with very little size gain.
++ if [ -f ${PYTHON_SITEPKGS_DIR}/fuel_bootstrap/consts.py ]; then
++ sed -i.bak -r "s/^(\s+'compress_format'\s*:\s*').*?('.*)$/\1gzip\2/g" \
++ ${PYTHON_SITEPKGS_DIR}/fuel_bootstrap/consts.py
++ echo "INFO: [xz] => [gzip] updated bootstrap initrd / rootfs compression."
++ fi
+ fi
+ fi
+