This patch adds support for the --append line to the bootloader config option in the kickstart file. It also adds some logic to propogate it to pxe boot images, as was already done with the iso-to-disk image creator.
Signed-off-by: Ian Main imain@redhat.com --- imgcreate/kickstart.py | 7 +++++++ imgcreate/live.py | 4 ++++ tools/livecd-iso-to-pxeboot.sh | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py index e352e98..6ff5a73 100644 --- a/imgcreate/kickstart.py +++ b/imgcreate/kickstart.py @@ -461,6 +461,13 @@ def get_default_kernel(ks, default = None): return default return ks.handler.bootloader.default
+def get_kernel_append_line(ks, default = None): + if not hasattr(ks.handler.bootloader, "appendLine"): + return default + if not ks.handler.bootloader.appendLine: + return default + return ks.handler.bootloader.appendLine + def get_repos(ks, repo_urls = {}): repos = [] for repo in ks.handler.repo.repoList: diff --git a/imgcreate/live.py b/imgcreate/live.py index f98f76c..c4e4d3e 100644 --- a/imgcreate/live.py +++ b/imgcreate/live.py @@ -99,6 +99,10 @@ class LiveImageCreatorBase(LoopImageCreator): r += " rhgb" if os.path.exists(self._instroot + "/usr/bin/plymouth"): r += " rhgb" + # Get --append line from kickstart bootloader option. + append_line = kickstart.get_kernel_append_line(self.ks) + if append_line: + r += " " + append_line return r
def _get_mkisofs_options(self, isodir): diff --git a/tools/livecd-iso-to-pxeboot.sh b/tools/livecd-iso-to-pxeboot.sh index b1ccf5f..8b5571a 100755 --- a/tools/livecd-iso-to-pxeboot.sh +++ b/tools/livecd-iso-to-pxeboot.sh @@ -101,6 +101,11 @@ else echo "Warning: You need to add pxelinux.0 to tftpboot/ subdirectory" fi
+# Get boot append line from original cd image. +if [ -f $CDMNT/isolinux/isolinux.cfg ]; then + APPEND=$(grep -m1 append isolinux.cfg | sed -e "s#CDLABEL=[^ ]*#/$ISOBASENAME#" -e "s/ *append *//") +fi + # pxelinux configuration. mkdir tftpboot/pxelinux.cfg cat > tftpboot/pxelinux.cfg/default <<EOF @@ -109,7 +114,7 @@ TIMEOUT 20 PROMPT 0 LABEL pxeboot KERNEL vmlinuz0 - APPEND initrd=initrd0.img root=/$ISOBASENAME rootfstype=iso9660 rootflags=loop + APPEND rootflags=loop $APPEND ONERROR LOCALBOOT 0 EOF