From 17a47898e21412205a658e5e00fefde4e634f587 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sep 20 2016 11:43:25 +0000 Subject: Fix swap partition type creation, Set boot partition as bootable --- diff --git a/appliance-tools-partitioning-fixes.patch b/appliance-tools-partitioning-fixes.patch new file mode 100644 index 0000000..51861de --- /dev/null +++ b/appliance-tools-partitioning-fixes.patch @@ -0,0 +1,31 @@ +--- appliance-tools-007.8/appcreate/partitionedfs.py.orig 2016-09-20 12:42:15.950885273 +0100 ++++ appliance-tools-007.8/appcreate/partitionedfs.py 2016-09-20 12:42:25.905888013 +0100 +@@ -77,7 +77,7 @@ + + d = self.disks[p['disk']] + d['numpart'] += 1 +- if d['numpart'] > 3 and self.partition_layout == 'msdos': ++ if d['numpart'] > 4 and self.partition_layout == 'msdos': + # Increase allocation of extended partition to hold this partition + d['extended'] += p['size'] + p['type'] = 'logical' +@@ -106,6 +106,8 @@ + logging.debug("Add %s part at %d of size %d" % (p['type'], p['start'], p['size'])) + if p['fstype'].startswith('ext'): + fstype = 'ext2' ++ if p['fstype'].startswith('swap'): ++ fstype = 'linux-swap' + if p['fstype'] == 'vfat': + fstype = 'fat32' + rc = subprocess.call(["/sbin/parted", "-a", "opt", "-s", d['disk'].device, "mkpart", +@@ -264,6 +266,10 @@ + p['UUID'] = self.__getuuid(p['device']) + continue + ++ if mp == '/boot': ++ # mark the partition bootable ++ subprocess.call(["/sbin/parted", "-s", self.disks[p['disk']]['disk'].device, "set", str(p['num']), "boot", "on"]) ++ + if mp == 'biosboot': + subprocess.call(["/sbin/parted", "-s", self.disks[p['disk']]['disk'].device, "set", "1", "bios_grub", "on"]) + continue diff --git a/appliance-tools.spec b/appliance-tools.spec index 9528a1d..ff952dc 100644 --- a/appliance-tools.spec +++ b/appliance-tools.spec @@ -5,7 +5,7 @@ Summary: Tools for building Appliances Name: appliance-tools Version: 007.8 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2 Group: System Environment/Base URL: https://git.fedorahosted.org/git/appliance-tools.git @@ -18,7 +18,7 @@ URL: https://git.fedorahosted.org/git/appliance-tools.git # make dist Source0: appliance-tools-%{version}.tar.bz2 Patch0: appliance-tools-nss.hack -Patch1: at-fix-primary-part.patch +Patch1: appliance-tools-partitioning-fixes.patch Requires: livecd-tools >= 020 curl rsync kpartx Requires: zlib @@ -67,6 +67,10 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/ec2convert/*.pyc %changelog +* Tue Sep 20 2016 Peter Robinson 007.8-10 +- Fix swap partition type creation +- Set boot partition as bootable + * Sat Sep 17 2016 Peter Robinson 007.8-9 - Allow 4 primary partitions diff --git a/at-fix-primary-part.patch b/at-fix-primary-part.patch deleted file mode 100644 index c7b9d37..0000000 --- a/at-fix-primary-part.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- appliance-tools-007.8/appcreate/partitionedfs.py.orig 2016-09-15 19:14:08.895912451 +0000 -+++ appliance-tools-007.8/appcreate/partitionedfs.py 2016-09-15 19:24:12.223323876 +0000 -@@ -77,7 +77,7 @@ - - d = self.disks[p['disk']] - d['numpart'] += 1 -- if d['numpart'] > 3 and self.partition_layout == 'msdos': -+ if d['numpart'] > 4 and self.partition_layout == 'msdos': - # Increase allocation of extended partition to hold this partition - d['extended'] += p['size'] - p['type'] = 'logical'