diff --git a/.gitignore b/.gitignore index 021e1a5..c548c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /diskimage-builder-0.0.1-5b37036.tar.gz /diskimage-builder-0.0.1.tar.gz /diskimage-builder-0.0.5.tar.gz +/diskimage-builder-0.1.5.tar.gz diff --git a/0001-Mount-root-filesystem-readonly-during-boot.patch b/0001-Mount-root-filesystem-readonly-during-boot.patch new file mode 100644 index 0000000..8ce64f6 --- /dev/null +++ b/0001-Mount-root-filesystem-readonly-during-boot.patch @@ -0,0 +1,31 @@ +From 2c8d4b227175a472e4bae20d3ccbc3abe5913f81 Mon Sep 17 00:00:00 2001 +From: Derek Higgins +Date: Thu, 23 Jan 2014 15:56:30 +0000 +Subject: [PATCH 1/6] Mount root filesystem readonly during boot + +If creating an image of a disto without grub2 extlinux is instead used, +extlinux was being configured to mount the root filesystem as +read/write which in turn causes e2fsck to fail to test the filesystem, +on RHEL 6.5 this causes the boot process to fail. + +Change-Id: I07859e0df9a2bc1ddd8c5f2ed4509ba14312e140 +--- + elements/vm/finalise.d/51-bootloader | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/elements/vm/finalise.d/51-bootloader b/elements/vm/finalise.d/51-bootloader +index 11fd053..9cd6fad 100755 +--- a/elements/vm/finalise.d/51-bootloader ++++ b/elements/vm/finalise.d/51-bootloader +@@ -49,7 +49,7 @@ DEFAULT linux + + LABEL linux + KERNEL $kernel +- APPEND rw root=LABEL=cloudimg-rootfs ++ APPEND ro root=LABEL=cloudimg-rootfs + INITRD $initrd + _EOF_ + } +-- +1.8.4.2 + diff --git a/0001-Set-raw-image-size-to-be-multiple-of-64k.patch b/0001-Set-raw-image-size-to-be-multiple-of-64k.patch deleted file mode 100644 index cd4e4b7..0000000 --- a/0001-Set-raw-image-size-to-be-multiple-of-64k.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e8c73cde4944492dfaab07e0bf1848486bba4f31 Mon Sep 17 00:00:00 2001 -From: Derek Higgins -Date: Sun, 8 Sep 2013 01:03:19 +0100 -Subject: [PATCH 1/5] Set raw image size to be multiple of 64k - -This works around a bug in qemu-img causing it to sometimes error if -compressing a raw image that isn't a multiple of 64k (the qcow2 -cluster size). -https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 -http://lists.gnu.org/archive/html/qemu-devel/2013-04/msg02520.html - -Change-Id: I88f8bb5c6bf3606ef5856b085a284af6b8858dbb ---- - bin/disk-image-create | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/bin/disk-image-create b/bin/disk-image-create -index de14433..8b60760 100755 ---- a/bin/disk-image-create -+++ b/bin/disk-image-create -@@ -125,7 +125,11 @@ if [ -n "$DIB_IMAGE_SIZE" ]; then - truncate -s${DIB_IMAGE_SIZE}G $TMP_IMAGE_PATH - else - # in kb*0.75 - underreport to get a slightly bigger device -- _NEEDED_SIZE=$(sudo du --block-size=750 -x -s ${TMP_BUILD_DIR}/built | awk ' { print $1 } ') -+ # Rounding down size so that is is a multiple of 64, works around a bug in -+ # qemu-img that may occur when compressing raw images that aren't a multiple -+ # of 64k. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1180021 -+ _NEEDED_SIZE=$(sudo du --block-size=750 -x -s ${TMP_BUILD_DIR}/built | \ -+ awk ' { print $1 - ( $1 % 64) } ') - truncate -s${_NEEDED_SIZE}K $TMP_IMAGE_PATH - if [ "$FS_TYPE" = "ext4" ] ; then - # Very conservative to handle images being resized a lot --- -1.8.1.4 - diff --git a/0002-Add-package-mapping-for-default-jre.patch b/0002-Add-package-mapping-for-default-jre.patch deleted file mode 100644 index 0dc4b16..0000000 --- a/0002-Add-package-mapping-for-default-jre.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 43b96d91c2561312c09b6278d12b62d4f2ce887c Mon Sep 17 00:00:00 2001 -From: Matthew Farrellee -Date: Tue, 10 Sep 2013 20:01:21 -0400 -Subject: [PATCH 2/5] Add package mapping for default-jre - -Change-Id: Idffbc84ea2afaf2584c1bb79729c3e0cf52b851e ---- - elements/fedora/bin/map-packages | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/elements/fedora/bin/map-packages b/elements/fedora/bin/map-packages -index 52ae48c..5ac21b7 100755 ---- a/elements/fedora/bin/map-packages -+++ b/elements/fedora/bin/map-packages -@@ -53,6 +53,7 @@ package_map = { - 'mysql-client-5.5' : 'mariadb', - 'mysql-server-5.5' : 'mariadb-server', - 'libmysql-java' : 'mysql-connector-java', -+ 'default-jre' : 'java', - } - - for arg in sys.argv[1:]: --- -1.8.1.4 - diff --git a/0003-Fixes-files-ordering-when-choosing-newest-image.patch b/0003-Fixes-files-ordering-when-choosing-newest-image.patch deleted file mode 100644 index df45289..0000000 --- a/0003-Fixes-files-ordering-when-choosing-newest-image.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0eaddbd214fa03f2a4a4041686c7ca62a21e4941 Mon Sep 17 00:00:00 2001 -From: Jan Provaznik -Date: Thu, 12 Sep 2013 11:26:57 +0200 -Subject: [PATCH 3/5] Fixes files ordering when choosing newest image - -For example if there are following kernels in undercloud/overcloud -image: -/boot/vmlinuz-3.9.5-301.fc19.i686.PAE -/boot/vmlinuz-3.10.10-200.fc19.i686.PAE -then disk-image-get-kernel picks vmlinuz-3.9.5. It should use the -newest one. - -Change-Id: I7bbf06705e85370d66c7dd8a5d4f8d6c93b21c0c -Fixes: bug #1224365 ---- - bin/disk-image-get-kernel | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/bin/disk-image-get-kernel b/bin/disk-image-get-kernel -index 3c2679c..ac631ee 100755 ---- a/bin/disk-image-get-kernel -+++ b/bin/disk-image-get-kernel -@@ -85,11 +85,11 @@ BOOTDIR="$WORK_DIR/boot" - KERNEL= - RAMDISK= - if [ -f $WORK_DIR/etc/redhat-release ]; then -- KERNEL=$(basename `ls -1 $BOOTDIR/vmlinuz* | sort -n | tail -1`) -- RAMDISK=$(basename `ls -1 $BOOTDIR/initramfs* | sort -n | tail -1`) -+ KERNEL=$(basename `ls -1rv $BOOTDIR/vmlinuz* | head -1`) -+ RAMDISK=$(basename `ls -1rv $BOOTDIR/initramfs* | head -1`) - elif [ -f $WORK_DIR/etc/debian_version ]; then -- KERNEL=$(basename `ls -1 $BOOTDIR/vmlinuz*generic | sort -n | tail -1`) -- RAMDISK=$(basename `ls -1 $BOOTDIR/initrd*generic | sort -n | tail -1`) -+ KERNEL=$(basename `ls -1rv $BOOTDIR/vmlinuz*generic | head -1`) -+ RAMDISK=$(basename `ls -1rv $BOOTDIR/initrd*generic | head -1`) - else - echo "ERROR: Unable to detect operating system" - exit 1 --- -1.8.1.4 - diff --git a/0004-Remove-r-option-from-kpartx-for-successful-build.patch b/0004-Remove-r-option-from-kpartx-for-successful-build.patch deleted file mode 100644 index ea843fe..0000000 --- a/0004-Remove-r-option-from-kpartx-for-successful-build.patch +++ /dev/null @@ -1,29 +0,0 @@ -From ccd7b86b606e678bf7281baff05c420b089c5d8f Mon Sep 17 00:00:00 2001 -From: Jeff Peeler -Date: Thu, 12 Sep 2013 17:56:30 -0400 -Subject: [PATCH 4/5] Remove -r option from kpartx for successful build - -This option does not exist on RHEL hosts and matches what is -currently present in elements/rhel/root.d/10-rhel-cloud-image. - -Change-Id: I578233c1f37d035c67600fc60e7c4eb4ff75cbb3 ---- - elements/fedora/root.d/10-fedora-cloud-image | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/elements/fedora/root.d/10-fedora-cloud-image b/elements/fedora/root.d/10-fedora-cloud-image -index 693ea2d..6be721a 100755 ---- a/elements/fedora/root.d/10-fedora-cloud-image -+++ b/elements/fedora/root.d/10-fedora-cloud-image -@@ -43,7 +43,7 @@ else - # NOTE: On F17 (parted-3.0-10.fc17.x86_64), partprobe of - # /dev/loop0 does not create /dev/loop0p2, while kpartx at - # least creates /dev/mapper/loop0p2. -- LOOPDEV=$(sudo kpartx -avr $WORKING/$RAW_FILE | awk "/loop[0-9]+$MAGIC_BIT/ {print \$3}") -+ LOOPDEV=$(sudo kpartx -av $WORKING/$RAW_FILE | awk "/loop[0-9]+$MAGIC_BIT/ {print \$3}") - if ! timeout 5 sh -c "while ! [ -e /dev/mapper/$LOOPDEV ]; do sleep 1; done"; then - echo "Error: Could not find /dev/mapper/$LOOPDEV" - exit 1 --- -1.8.1.4 - diff --git a/0005-Install-fedora-grub-from-cached-rpm-during-finalise.patch b/0005-Install-fedora-grub-from-cached-rpm-during-finalise.patch deleted file mode 100644 index 815bc87..0000000 --- a/0005-Install-fedora-grub-from-cached-rpm-during-finalise.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 9ba761ef27a3ac53588394d2ebbee59e6d7e5ed7 Mon Sep 17 00:00:00 2001 -From: Steve Baker -Date: Sun, 15 Sep 2013 06:06:08 +1200 -Subject: [PATCH 5/5] Install fedora grub from cached rpm during finalise - -When uninstalling grub2, leave all its dependencies -including grub2-tools installed to minimise the number of packages -which need to be installed in the finalise stage. - -Since the yum cache is unmounted during finalise, installing -grub2 in finalise is slowed by re-populating the yum cache. - -This change copies the grub2 rpm out of the yum cache so it can be installed -from file during finalise. - -This should prevent disk becoming full during finalise on Fedora. - -Closes-Bug: #1217185 - -Change-Id: If095adc4abb52a19a3aa0b1caebfb3e4d8f605ef ---- - elements/fedora/pre-install.d/15-fedora-remove-grub | 13 ++++++++++++- - elements/vm/finalise.d/51-bootloader | 7 ++++++- - 2 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/elements/fedora/pre-install.d/15-fedora-remove-grub b/elements/fedora/pre-install.d/15-fedora-remove-grub -index 8c83ab8..5541e76 100755 ---- a/elements/fedora/pre-install.d/15-fedora-remove-grub -+++ b/elements/fedora/pre-install.d/15-fedora-remove-grub -@@ -2,7 +2,18 @@ - - set -e - --yum remove -y grub2-tools -+yum remove -y grub2 -+# Install grub2 dependencies to minimise packages installed during finalise. -+install-packages grub2-tools gettext os-prober system-logos -+ -+# Ensure grub2 rpm is in the yum cache -+install-packages -d grub2 -+ -+# Copy grub2 rpm out of mounted yum cache for install during finalise -+mkdir /tmp/grub -+basearch=$(cat /etc/yum/vars/basearch) -+cp $(find /tmp/yum/$basearch -regex ".*/grub2-[0-9].*\.rpm") /tmp/grub -+echo "rpm -i /tmp/grub/*.rpm" > /tmp/grub/install - - #GRUB_CFG=/boot/grub2/grub.cfg - -diff --git a/elements/vm/finalise.d/51-bootloader b/elements/vm/finalise.d/51-bootloader -index 412ecd1..891dc39 100755 ---- a/elements/vm/finalise.d/51-bootloader -+++ b/elements/vm/finalise.d/51-bootloader -@@ -53,7 +53,12 @@ _EOF_ - - function install_grub2 { - -- install-packages grub-pc -+ # Check for offline installation of grub -+ if [ -f "/tmp/grub/install" ] ; then -+ source /tmp/grub/install -+ else -+ install-packages grub-pc -+ fi - - # XXX: grub-probe on the nbd0/loop0 device returns nothing - workaround, manually - # specify modules. https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1073731 --- -1.8.1.4 - diff --git a/diskimage-builder.spec b/diskimage-builder.spec index 18d5beb..4fd450e 100644 --- a/diskimage-builder.spec +++ b/diskimage-builder.spec @@ -1,12 +1,14 @@ Name: diskimage-builder Summary: Image building tools for OpenStack -Version: 0.0.5 +Version: 0.1.5 Release: 1%{?dist} License: ASL 2.0 Group: System Environment/Base URL: https://launchpad.net/diskimage-builder Source0: http://tarballs.openstack.org/diskimage-builder/%{name}-%{version}.tar.gz +Patch0001: 0001-Mount-root-filesystem-readonly-during-boot.patch + BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools @@ -21,6 +23,8 @@ Requires: curl %prep %setup -q -n %{name}-%{version} +%patch0001 -p1 + %build %{__python} setup.py build @@ -48,6 +52,9 @@ Components of TripleO that are responsible for building disk images. %{_datadir}/%{name}/elements %changelog +* Mon Jan 27 2014 Jeff Peeler 0.1.5-1 +- rebase to 0.1.5 + patch to fix RHEL 6.5 boot (rhbz#1057217) + * Wed Oct 9 2013 Jeff Peeler 0.0.5-1 - rebase to 0.0.5 diff --git a/sources b/sources index 7b8e64e..727e1c3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2d6f4c387795d1aa9bc6891646ae70ee diskimage-builder-0.0.5.tar.gz +5112f106e88b0eda28f7b0ad02f37799 diskimage-builder-0.1.5.tar.gz