From 702dc96264a9f1415cd0f828e189786d7a7cb804 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 27 Oct 2020 16:04:03 -0700 Subject: [PATCH] netboot: Clear kernel cmdline data before writing new parmfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If this isn't cleared first it can end up with an unexpected cmdline if it doesn't completely overwrite the default data. Closes: https://github.com/ibm-s390-tools/s390-tools/pull/95 Reviewed-by: Viktor Mihajlovski Signed-off-by: Jan Höppner --- netboot/mk-s390image | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netboot/mk-s390image b/netboot/mk-s390image index 5058a193..7083d976 100755 --- a/netboot/mk-s390image +++ b/netboot/mk-s390image @@ -129,6 +129,9 @@ dobuild() parmfile_size=$(du -b $parmfile | cut -f1) if [ $parmfile_size -le $MAX_PARMFILE_SIZE ] then + # Clear any previous parameters + dd seek=$OFFS_COMMANDLINE_BYTES bs=1 count=$MAX_PARMFILE_SIZE \ + if=/dev/zero of=$image conv=notrunc status=none dd seek=$OFFS_COMMANDLINE_BYTES bs=1 if=$parmfile \ of=$image conv=notrunc status=none else