summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Clausen <jac@nordu.net>2018-07-31 15:47:21 +0200
committerJon Clausen <jac@nordu.net>2018-07-31 15:47:21 +0200
commita055b0bb2824b95017c6a4eb5fa75e76f29bce99 (patch)
treec0e1c3491873295b6a874cdec93b23f8ae54d451
parent8673d6306458fb82e5160032f731f4c83b41c325 (diff)
use escaped semicolon for kernel cmdline whitespace substitution
-rwxr-xr-xadapt-ks-template10
-rwxr-xr-xcreate-boot-floppy9
-rwxr-xr-xprep-boot-floppy-and-ks-config21
3 files changed, 28 insertions, 12 deletions
diff --git a/adapt-ks-template b/adapt-ks-template
index 3e3e20a..5dcbee7 100755
--- a/adapt-ks-template
+++ b/adapt-ks-template
@@ -37,6 +37,12 @@ Options:
--sec-ip IP of secondary interface
--sec-nm Netmask of secondary interface
+To avoid shell interpretation of whitespace in --krnl-cmdline use escaped
+semicolon:
+ To achieve this:
+ console=tty1 console=ttyS0,115200n8
+ write this:
+ console=tty1\;console=ttyS0,115200n8
EOF
}
@@ -107,7 +113,7 @@ function parse_commadline {
shift
;;
--krnl-cmdline)
- KrnlCmdLine="${2}"
+ KrnlCmdLineOpt="--krnl-cmdline $(echo ${2} | sed -e 's/;/ /g')"
shift
;;
*)
@@ -203,7 +209,7 @@ sed -ie "s/PRIGATEWAY/${GW}/g" "${TmpDir}/ks-template"
sed -ie "s/PRINAMESERVERS/${NS}/g" "${TmpDir}/ks-template"
sed -ie "s/SECIP/${SecIP}/g" "${TmpDir}/ks-template"
sed -ie "s/SECNETMASK/${SecNM}/g" "${TmpDir}/ks-template"
-sed -ie "s/KRNLCMDLINE/${KrnlCmdLine}/g" "${TmpDir}/ks-template"
+sed -ie "s/KRNLCMDLINE/${KrnlCmdLineOpt}/g" "${TmpDir}/ks-template"
if [ "x${PublishPath}" = "x" ]
then
diff --git a/create-boot-floppy b/create-boot-floppy
index 2cb7a87..a6f0a43 100755
--- a/create-boot-floppy
+++ b/create-boot-floppy
@@ -43,6 +43,13 @@ bootstrapping, and leave the system unmanaged.
If -N, -K, -S options are not given, default values are provided.
+To avoid shell interpretation of whitespace in --inst-cmdline use escaped
+semicolon:
+ To achieve this:
+ console=tty1 console=ttyS0,115200n8
+ write this:
+ console=tty1\;console=ttyS0,115200n8
+
The script needs ipxe and syslinux to run, and 'sudo' to copy things onto the
floppy image
@@ -97,7 +104,7 @@ function parse_commadline {
shift
;;
--inst-cmdline)
- InstCmdLine="${2}"
+ InstCmdLineOpt="--inst-cmdline $(echo ${2} | sed -e 's/;/ /g')"
shift
;;
*)
diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config
index 2a9883f..9432c16 100755
--- a/prep-boot-floppy-and-ks-config
+++ b/prep-boot-floppy-and-ks-config
@@ -44,7 +44,7 @@ Options:
supermicro/SYS-5018D-FN8T/dtn-10g.ks
dell/R7425/100g-dtn.ks
--inst-cmdline add stuff to the install system kernel command line
- --krnl-cmdline add stuff to the install system kernel command line
+ --krnl-cmdline add stuff to the destination system kernel command line
--sec-ip IP of secondary interface
--sec-nm Netmask of secondary interface
-h, --help this
@@ -54,6 +54,13 @@ bootstrapping, and leave the system unmanaged.
If -N, -K, -S options are not given, default values are provided.
+To avoid shell interpretation of whitespace in --inst-cmdline and
+--krnl-cmdline use escaped semicolon:
+ To achieve this:
+ console=tty1 console=ttyS0,115200n8
+ write this:
+ console=tty1\;console=ttyS0,115200n8
+
EOF
}
@@ -114,10 +121,14 @@ function parse_commadline {
shift
;;
--inst-cmdline)
+ # hand over the argument unchanged, and let create-boot-floppy parse it
+ #InstCmdLineOpt="--inst-cmdline $(echo ${2} | sed -e 's/;/ /g')"
InstCmdLineOpt="--inst-cmdline ${2}"
shift
;;
--krnl-cmdline)
+ # hand over the argument unchanged, and let adapt-ks-template parse it
+ #KrnlCmdLineOpt="--krnl-cmdline $(echo ${2} | sed -e 's/;/ /g')"
KrnlCmdLineOpt="--krnl-cmdline ${2}"
shift
;;
@@ -191,14 +202,6 @@ function check_options {
then
PublishPath="/var/www/html/install"
fi
- if [ "x${tty}" = "x" ]
- then
- tty=1
- fi
- if [ "x${ttyS}" = "x" ]
- then
- ttyS=1
- fi
}
parse_commadline ${@}