bnemec pushed to diskimage-builder (master). "Merge pull request #5 from redhat-openstack/extend_mkfs_options (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri Mar 27 16:57:24 UTC 2015


>From b53dbd46b0d594190b44902b1ec53a31f45b026a Mon Sep 17 00:00:00 2001
From: Ben Nemec <bnemec at redhat.com>
Date: Fri, 27 Mar 2015 11:47:23 -0500
Subject: Merge pull request #5 from redhat-openstack/extend_mkfs_options

Changelog:
- Merge pull request #5 from redhat-openstack/extend_mkfs_options
- Open MKFS_OPTS for extension in disk-image-create
- Merge pull request #4 from rbrady/run-registration-once
- Merge pull request #3 from rbrady/fix-satellite-repo
- Run Registration Once

diff --git a/0022-Open-MKFS_OPTS-for-extension-in-disk-image-create.patch b/0022-Open-MKFS_OPTS-for-extension-in-disk-image-create.patch
new file mode 100644
index 0000000..28609e4
--- /dev/null
+++ b/0022-Open-MKFS_OPTS-for-extension-in-disk-image-create.patch
@@ -0,0 +1,74 @@
+From 60f14cc9afde96a2b8f407911352c45ecba4d56e Mon Sep 17 00:00:00 2001
+From: Ethan Gafford <egafford at redhat.com>
+Date: Thu, 26 Mar 2015 16:59:26 -0400
+Subject: [PATCH] Open MKFS_OPTS for extension in disk-image-create
+
+At present, MKFS_OPTS is closed for modification. The ability
+to extend the set of MKFS_OPTS adds a great deal of power for
+knowledgeable end-users. (And in some specific circumstances,
+it is vital to success, as in the case of building RHEL/CentOS
+6 images from RHEL/CentOS 7 hosts, in which case -O ^64bit is
+required in order for the image to boot.)
+
+Presently upstream at https://review.openstack.org/#/c/165149;
+however, as this patch is needed for RHOS 6 A3, I am adding it
+here as well. Thanks.
+---
+ bin/disk-image-create | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/bin/disk-image-create b/bin/disk-image-create
+index c38a200..9b9a850 100755
+--- a/bin/disk-image-create
++++ b/bin/disk-image-create
+@@ -58,6 +58,8 @@ function show_options () {
+     echo "       Making this value unnecessarily large will consume extra disk space "
+     echo "       on the root partition with extra file system inodes."
+     echo "    --min-tmpfs size -- minimum size in GB needed in tmpfs to build the image"
++    echo "    --mkfs-options -- option flags to be passed directly to mkfs."
++    echo "       Options should be passed as a single string value."
+     echo "    --no-tmpfs -- do not use tmpfs to speed image build"
+     echo "    --offline -- do not update cached resources"
+     echo "    --qemu-img-options -- option flags to be passed directly to qemu-img."
+@@ -88,7 +90,8 @@ function show_options () {
+ INSTALL_PACKAGES=""
+ COMPRESS_IMAGE="true"
+ DIB_ROOT_LABEL=""
+-TEMP=`getopt -o a:ho:t:xucnp: -l no-tmpfs,offline,help,min-tmpfs:,image-size:,image-cache:,max-online-resize:,qemu-img-options:,ramdisk-element:,root-label: -n $SCRIPTNAME -- "$@"`
++MKFS_OPTS=""
++TEMP=`getopt -o a:ho:t:xucnp: -l no-tmpfs,offline,help,min-tmpfs:,image-size:,image-cache:,max-online-resize:,mkfs-options:,qemu-img-options:,ramdisk-element:,root-label: -n $SCRIPTNAME -- "$@"`
+ if [ $? -ne 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+ 
+ # Note the quotes around `$TEMP': they are essential!
+@@ -109,6 +112,7 @@ while true ; do
+         --image-cache) export DIB_IMAGE_CACHE=$2; shift 2;;
+         --max-online-resize) export MAX_ONLINE_RESIZE=$2; shift 2;;
+         --min-tmpfs) export DIB_MIN_TMPFS=$2; shift 2;;
++        --mkfs-options) MKFS_OPTS=$2; shift 2;;
+         --no-tmpfs) shift; export DIB_NO_TMPFS=1;;
+         --offline) shift; export DIB_OFFLINE=1;;
+         --qemu-img-options) QEMU_IMG_OPTIONS=$2; shift 2;;
+@@ -173,8 +177,6 @@ fi
+ unmount_image
+ mv $TMP_BUILD_DIR/mnt $TMP_BUILD_DIR/built
+ 
+-MKFS_OPTS=""
+-
+ if [ -n "$DIB_IMAGE_SIZE" ]; then
+   truncate -s${DIB_IMAGE_SIZE}G $TMP_IMAGE_PATH
+ else
+@@ -189,12 +191,12 @@ else
+     # Very conservative to handle images being resized a lot
+     # Without -J option specified, default journal size will be set to 32M
+     # and online resize will be failed with error of needs too many credits.
+-    MKFS_OPTS="-i 4096 -J size=64"
++    MKFS_OPTS="-i 4096 -J size=64 $MKFS_OPTS"
+   fi
+ fi
+ 
+ if [ -n "$MAX_ONLINE_RESIZE" ]; then
+-    MKFS_OPTS="$MKFS_OPTS -E resize=$MAX_ONLINE_RESIZE"
++    MKFS_OPTS="-E resize=$MAX_ONLINE_RESIZE $MKFS_OPTS"
+ fi
+ 
+ LOOPDEV=$(sudo losetup --show -f $TMP_IMAGE_PATH)
diff --git a/diskimage-builder.spec b/diskimage-builder.spec
index 1139ed5..1ed0781 100644
--- a/diskimage-builder.spec
+++ b/diskimage-builder.spec
@@ -1,7 +1,7 @@
 Name:		diskimage-builder
 Summary:	Image building tools for OpenStack
 Version:	0.1.34
-Release:	20%{?dist}
+Release:	21%{?dist}
 License:	ASL 2.0
 Group:		System Environment/Base
 URL:		https://launchpad.net/diskimage-builder
@@ -28,6 +28,7 @@ Patch0018: 0018-Don-t-trace-RHEL-registration-scripts.patch
 Patch0019: 0019-Switch-manage_etc_hosts-from-True-to-localhost.patch
 Patch0020: 0020-Fix-Satellite-Repo.patch
 Patch0021: 0021-Run-Registration-Once.patch
+Patch0022: 0022-Open-MKFS_OPTS-for-extension-in-disk-image-create.patch
 
 BuildArch: noarch
 BuildRequires: python2-devel
@@ -67,6 +68,7 @@ Requires: dib-utils
 %patch0019 -p1
 %patch0020 -p1
 %patch0021 -p1
+%patch0022 -p1
 
 %build
 %{__python} setup.py build
@@ -119,6 +121,13 @@ Components of TripleO that are responsible for building disk images.
 %{_datadir}/%{name}/elements
 
 %changelog
+* Fri Mar 27 2015 Ben Nemec <bnemec at redhat.com> 0.1.34-21
+- Merge pull request #5 from redhat-openstack/extend_mkfs_options
+- Open MKFS_OPTS for extension in disk-image-create
+- Merge pull request #4 from rbrady/run-registration-once
+- Merge pull request #3 from rbrady/fix-satellite-repo
+- Run Registration Once
+
 * Mon Feb 09 2015 James Slagle <jslagle at redhat.com> 0.1.34-20
 - Merge pull request #4 from rbrady/run-registration-once
 - Merge pull request #3 from rbrady/fix-satellite-repo
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/diskimage-builder.git/commit/?h=master&id=b53dbd46b0d594190b44902b1ec53a31f45b026a


More information about the scm-commits mailing list