[master 1/2] don't build upgrade.img anymore

wgwoods installerbot-noreply at redhat.com
Wed Aug 19 21:46:26 UTC 2015


From: Will Woods <wwoods at redhat.com>

fedup is deprecated and abandoned. Let's save time and disk by not
building `upgrade.img` when nothing is going to use it anymore.

For the record, performing upgrades using an initramfs from the new
system turns out to be fragile and hard to support:

* dracut initramfs isn't generic enough to handle booting all systems
  (e.g. missing vconsole.conf means you get keymaps wrong, so users
  can't unlock encrypted disks)

* The ABI differences between the two versions of plymouth, systemd,
  etc. requires nasty workarounds at best and causes nightmarish
  systemd crashes at worst

This patch removes all the code that built and installed `upgrade.img`.

For backwards compatibility, the API retains the `doupgrade` keyword
argument, and the `--noupgrade` flag is still accepted.
---
 docs/lorax.1            |  4 ----
 share/aarch64.tmpl      |  3 ---
 share/arm.tmpl          | 32 --------------------------------
 share/ppc.tmpl          |  5 -----
 share/ppc64le.tmpl      |  5 -----
 share/s390.tmpl         |  5 -----
 share/x86.tmpl          | 12 ------------
 src/pylorax/__init__.py | 15 ---------------
 8 files changed, 81 deletions(-)

diff --git a/docs/lorax.1 b/docs/lorax.1
index e4870f1..e341b49 100644
--- a/docs/lorax.1
+++ b/docs/lorax.1
@@ -79,9 +79,6 @@ volume id
 \fB\-\-nomacboot\fR
 
 .TP
-\fB\-\-noupgrade\fR
-
-.TP
 \fB\-\-logfile=LOGFILE\fR
 Path to logfile
 
@@ -95,4 +92,3 @@ Martin Gracik
 Will Woods
 Brian C. Lane
 .fi
-
diff --git a/share/aarch64.tmpl b/share/aarch64.tmpl
index 18b2f6d..042d32d 100644
--- a/share/aarch64.tmpl
+++ b/share/aarch64.tmpl
@@ -17,9 +17,6 @@ mkdir ${KERNELDIR}
     ## normal aarch64
     installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
     installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
-    %if doupgrade:
-        installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-    %endif
 %endfor
 
 #FIXME: this will need adjusted when we have a real bootloader.
diff --git a/share/arm.tmpl b/share/arm.tmpl
index 5c4895e..72db741 100644
--- a/share/arm.tmpl
+++ b/share/arm.tmpl
@@ -36,22 +36,6 @@ mkdir ${KERNELDIR}
         platforms = platforms + delimiter + kernel.flavor
         delimiter = ','
 %>
-
-        %if doupgrade:
-            ## install upgrade image
-            installupgradeinitrd images-${kernel.flavor}-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade-${kernel.flavor}.img
-
-            runcmd mkimage \
-                 -A arm -O linux -T ramdisk -C none \
-                 -a 0 -e 0 \
-                 -n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
-                 -d ${outroot}/${KERNELDIR}/upgrade-${kernel.flavor}.img \
-                    ${outroot}/${KERNELDIR}/uUpgrade-${kernel.flavor}
-
-            treeinfo images-${kernel.flavor}-${basearch} uupgrade ${KERNELDIR}/uUpgrade-${kernel.flavor}
-
-        %endif
-
         ## create U-Boot wrapped images
 
         runcmd mkimage \
@@ -75,21 +59,6 @@ mkdir ${KERNELDIR}
         installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
         installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
 
-        %if doupgrade:
-            ## install upgrade image
-            installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-
-	    runcmd mkimage \
-                -A arm -O linux -T ramdisk -C none \
-                -a 0 -e 0 \
-                -n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
-                -d ${outroot}/${KERNELDIR}/upgrade.img \
-                   ${outroot}/${KERNELDIR}/uUpgrade
-
-            treeinfo images-${basearch} uupgrade ${KERNELDIR}/uUpgrade
-
-        %endif
-
         ## create U-Boot wrapped images
 
         runcmd mkimage \
@@ -131,4 +100,3 @@ treeinfo ${basearch} platforms ${platforms}
 %>
 
 ## FIXME: ARM may need some extra boot config
-
diff --git a/share/ppc.tmpl b/share/ppc.tmpl
index 5d7040a..08e7239 100644
--- a/share/ppc.tmpl
+++ b/share/ppc.tmpl
@@ -68,11 +68,6 @@ install ${configdir}/mapping ${BOOTDIR}
     installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
     installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
 
-    %if doupgrade:
-        ## upgrade image
-        installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-    %endif
-
     ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
     runcmd ${inroot}/${WRAPPER} -p of \
            -D ${inroot}/${WRAPPER_DATA} \
diff --git a/share/ppc64le.tmpl b/share/ppc64le.tmpl
index 14aa0ad..28a08cb 100644
--- a/share/ppc64le.tmpl
+++ b/share/ppc64le.tmpl
@@ -54,11 +54,6 @@ install ${configdir}/mapping ${BOOTDIR}
     installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
     installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
 
-    %if doupgrade:
-        ## upgrade image
-        installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-    %endif
-
     treeinfo images-${kernel.arch} zimage
 %endfor
 
diff --git a/share/s390.tmpl b/share/s390.tmpl
index 9d7eb00..8d8d04a 100644
--- a/share/s390.tmpl
+++ b/share/s390.tmpl
@@ -26,11 +26,6 @@ replace @INITRD_LOAD_ADDRESS@ ${INITRD_ADDRESS} generic.ins
 installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/kernel.img
 installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
 
-%if doupgrade:
-    ## upgrader image
-    installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-%endif
-
 ## s390 needs some extra boot config
 createaddrsize ${INITRD_ADDRESS} ${outroot}/${BOOTDIR}/initrd.img ${outroot}/${BOOTDIR}/initrd.addrsize
 
diff --git a/share/x86.tmpl b/share/x86.tmpl
index 7273e28..7e22758 100644
--- a/share/x86.tmpl
+++ b/share/x86.tmpl
@@ -44,30 +44,18 @@ mkdir ${KERNELDIR}
         ## i386 PAE
         installkernel images-xen ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
         installinitrd images-xen ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
-        %if doupgrade:
-            installupgradeinitrd images-xen ${kernel.upgrade.path} ${KERNELDIR}/upgrade-${kernel.flavor}.img
-        %endif
     %else:
         ## normal i386, x86_64
         installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
         installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
-        %if doupgrade:
-            installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
-        %endif
     %endif
 %endfor
 
 hardlink ${KERNELDIR}/vmlinuz ${BOOTDIR}
 hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
-%if doupgrade:
-    hardlink ${KERNELDIR}/upgrade.img ${BOOTDIR}
-%endif
 %if basearch == 'x86_64':
     treeinfo images-xen kernel ${KERNELDIR}/vmlinuz
     treeinfo images-xen initrd ${KERNELDIR}/initrd.img
-    %if doupgrade:
-        treeinfo images-xen upgrade ${KERNELDIR}/upgrade.img
-    %endif
 %endif
 
 ## WHeeeeeeee, EFI.
diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index cbe66c3..09b4aff 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -338,21 +338,6 @@ def run(self, dbo, product, version, release, variant="", bugurl="",
 
         treebuilder.rebuild_initrds(add_args=anaconda_args)
 
-        if doupgrade:
-            # Build upgrade.img. It'd be nice if these could coexist in the same
-            # image, but that would increase the size of the anaconda initramfs,
-            # which worries some people (esp. PPC tftpboot). So they're separate.
-            try:
-                # If possible, use the 'fedup' plymouth theme
-                themes = runcmd_output(['plymouth-set-default-theme', '--list'],
-                                       root=installroot)
-                if 'fedup' in themes.splitlines():
-                    os.environ['PLYMOUTH_THEME_NAME'] = 'fedup'
-            except RuntimeError:
-                pass
-            upgrade_args = dracut_args + ["--add", "system-upgrade"]
-            treebuilder.rebuild_initrds(add_args=upgrade_args, prefix="upgrade")
-
         logger.info("populating output tree and building boot images")
         treebuilder.build()
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/lorax/commit/f0cd75e4f0b313f6b713d4e1609a718ba68cde9b


More information about the anaconda-patches mailing list