Match f31 branch

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-10-02 13:31:43 +03:00
parent ee1e8e0ce1
commit 7913f0ca22
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 1 additions and 83 deletions

View File

@ -12,7 +12,7 @@
Name: appliance-tools
Summary: Tools for building Appliances
Version: 009.0
Release: 7.0.riscv64%{?dist}
Release: 7%{?dist}
License: GPLv2
URL: https://pagure.io/appliance-tools
@ -22,9 +22,6 @@ Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.bz2
Patch0001: 0001-fstype-is-optional-for-swap-check-mountpoint-also.patch
Patch0002: 0001-Leave-more-space-4MB-for-uboot-before-the-first-part.patch
# Patches for U-Boot RISC-V (riscv64) extlinux support
Patch0020: uboot-riscv.patch
# Ensure system deps are installed (rhbz#1409536)
Requires: python%{python_pkgversion}-imgcreate >= 1:25.0-2
Requires: python%{python_pkgversion}-progress
@ -68,11 +65,6 @@ rm -rf %{buildroot}%{_datadir}/doc/%{name}
%{python_sitelib}/ec2convert/
%changelog
* Sun Aug 18 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 009.0-7.0.riscv64
- Allow user to override partition layout (clearpart kickstart command)
- Detect if DTB is available in boot prefix (usually /boot) for extlinux.conf
- Detect uImage / uInitrd for extlinux.conf
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 009.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

View File

@ -1,74 +0,0 @@
diff --git a/appcreate/appliance.py b/appcreate/appliance.py
index c6706cb..86b4437 100644
--- a/appcreate/appliance.py
+++ b/appcreate/appliance.py
@@ -169,7 +169,7 @@ class ApplianceImageCreator(ImageCreator):
packages = kickstart.get_packages(self.ks)
# make this the default
partition_layout = 'msdos'
- # set bootloader only if it is enabled and use user specified partition_layout
+ # set bootloader only if it is enabled
if ((not hasattr(self.ks.handler.bootloader, "disabled")) or
(hasattr(self.ks.handler.bootloader, "disabled") and self.ks.handler.bootloader.disabled is False)):
# check for extlinux in kickstart then grub2 and falling back to grub
@@ -188,11 +188,11 @@ class ApplianceImageCreator(ImageCreator):
self.bootloader = 'grub'
else:
logging.warning("WARNING! grub package not found.")
- else:
- # user explicitly disabled bootloader (i.e. not part of disk image)
- if hasattr(self.ks.handler.clearpart, "disklabel"):
- logging.debug("Using user set default disk label: {}".format(self.ks.handler.clearpart.disklabel))
- partition_layout = self.ks.handler.clearpart.disklabel
+
+ # user explicitly selected partition layout thus overrride the current selected
+ if hasattr(self.ks.handler.clearpart, "disklabel"):
+ logging.debug("Using user set default disk label: {}".format(self.ks.handler.clearpart.disklabel))
+ partition_layout = self.ks.handler.clearpart.disklabel
self.__instloop = PartitionedMount(self.__disks,
self._instroot,
@@ -352,18 +352,39 @@ class ApplianceImageCreator(ImageCreator):
for version in kernels[kernel]:
versions.append(version)
- if int(subprocess.Popen("ls " + self._instroot + "/boot/initramfs* | wc -l", shell=True, stdout=subprocess.PIPE).communicate()[0].decode("utf-8").strip()) > 0:
+ # Find kernel filename
+ if int(subprocess.Popen("ls " + self._instroot + "/boot/uImage* | wc -l", shell=True, stdout=subprocess.PIPE).communicate()[0].decode("utf-8").strip()) > 0:
+ # U-Boot wrapped kernel
+ kernelfn = "uImage"
+ else:
+ kernelfn = "vmlinuz"
+
+ logging.debug("Found kernel filename: %s" % kernelfn)
+
+ # Find ramdisk filename
+ if int(subprocess.Popen("ls " + self._instroot + "/boot/uInitrd* | wc -l", shell=True, stdout=subprocess.PIPE).communicate()[0].decode("utf-8").strip()) > 0:
+ # U-Boot wrapped ramdisk
+ initrd = "uInitrd"
+ initrd_ext = ""
+ elif int(subprocess.Popen("ls " + self._instroot + "/boot/initramfs* | wc -l", shell=True, stdout=subprocess.PIPE).communicate()[0].decode("utf-8").strip()) > 0:
initrd = "initramfs"
+ initrd_ext = ".img"
else:
initrd = "initrd"
+ initrd_ext = ".img"
+
+ logging.debug("Found ramdisk filename: %s" % initrd)
for v in versions:
extlinux += "label %s (%s)\n" % (self.name, v)
- extlinux += "\tkernel %s/vmlinuz-%s\n" % (prefix, v)
+ extlinux += "\tkernel %s/%s-%s\n" % (prefix, kernelfn, v)
extlinux += "\tappend ro root=%s %s\n" % (rootdev, options)
if 'extlinux-bootloader' in packages:
- extlinux += "\tfdtdir %s/dtb-%s/\n" % (prefix, v)
- extlinux += "\tinitrd %s/%s-%s.img\n\n" % (prefix, initrd, v)
+ logging.debug("Checking for %s/dtb-%s/" % (self._instroot + prefix, v))
+ if os.path.exists("%s/dtb-%s/" % (self._instroot + prefix, v)):
+ logging.debug("Found, adding fdtdir entry to extlinux.conf")
+ extlinux += "\tfdtdir %s/dtb-%s/\n" % (prefix, v)
+ extlinux += "\tinitrd %s/%s-%s%s\n\n" % (prefix, initrd, initrd_ext, v)
logging.debug("Writing extlinux config %s/boot/extlinux/extlinux.conf" % self._instroot)