From ec3a12d0db24b1021b11d7a5709eabacd6a40ddb Mon Sep 17 00:00:00 2001 From: David Ward Date: Mon, 18 Jan 2021 10:54:59 -0500 Subject: [PATCH] fedora-live-base: Handle livecd-creator vs. livemedia-creator builds Test for $LIVE_ROOT (set by livecd-creator) before running commands specific to a livecd-creator build. Do not modify the Lorax template during livemedia-creator builds; the change belongs in Lorax itself. Related: https://github.com/weldr/lorax/pull/1107 Resolves: rhbz#1430546 --- fedora-live-base.ks | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/fedora-live-base.ks b/fedora-live-base.ks index 8e1830c..e50ed3a 100644 --- a/fedora-live-base.ks +++ b/fedora-live-base.ks @@ -327,23 +327,15 @@ touch /etc/machine-id %post --nochroot -cp $INSTALL_ROOT/usr/share/licenses/*-release-common/* $LIVE_ROOT/ +# For livecd-creator builds only (lorax/livemedia-creator handles this directly) +if [ -n "$LIVE_ROOT" ]; then + cp "$INSTALL_ROOT"/usr/share/licenses/*-release-common/* "$LIVE_ROOT/" -# only works on x86, x86_64 -if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then - # For livecd-creator builds - if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi - cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS - - # For lorax/livemedia-creator builds - sed -i ' - /## make boot.iso/ i\ - # Add livecd-iso-to-disk script to .iso filesystem at /LiveOS/\ - <% f = "usr/bin/livecd-iso-to-disk" %>\ - %if exists(f):\ - install ${f} ${LIVEDIR}/${f|basename}\ - %endif\ - ' /usr/share/lorax/templates.d/99-generic/live/x86.tmpl + # only installed on x86, x86_64 + if [ -f /usr/bin/livecd-iso-to-disk ]; then + mkdir -p "$LIVE_ROOT/LiveOS" + cp /usr/bin/livecd-iso-to-disk "$LIVE_ROOT/LiveOS" + fi fi %end