summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Clausen <jac@nordu.net>2018-07-31 14:57:14 +0200
committerJon Clausen <jac@nordu.net>2018-07-31 14:57:14 +0200
commit8673d6306458fb82e5160032f731f4c83b41c325 (patch)
tree1062b29e2098a917b3fec3ef9749f26f5a19450c
parent55282ee15f1eeefc5a68d843003b09a6f2f6da1d (diff)
allow direct kernel commands instead of tty+ttyS
-rwxr-xr-xadapt-ks-template22
-rwxr-xr-xcreate-boot-floppy21
-rw-r--r--ks-template/hw/dell/R7425/100g-dtn.ks2
-rw-r--r--ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks2
-rwxr-xr-xprep-boot-floppy-and-ks-config17
5 files changed, 18 insertions, 46 deletions
diff --git a/adapt-ks-template b/adapt-ks-template
index a2026e6..3e3e20a 100755
--- a/adapt-ks-template
+++ b/adapt-ks-template
@@ -33,10 +33,9 @@ Options:
name of the template file. Default:
${Template}
-h, --help this
+ --krnl-cmdline add stuff to destination system kernel cmdline
--sec-ip IP of secondary interface
--sec-nm Netmask of secondary interface
- --tty console number
- --ttyS serial console number
EOF
}
@@ -107,12 +106,8 @@ function parse_commadline {
TmpDir="${2}"
shift
;;
- --tty)
- tty="${2}"
- shift
- ;;
- --ttyS)
- ttyS="${2}"
+ --krnl-cmdline)
+ KrnlCmdLine="${2}"
shift
;;
*)
@@ -175,14 +170,6 @@ function check_options {
then
NS="109.106.96.141"
fi
- if [ "x${tty}" = "x" ]
- then
- tty=1
- fi
- if [ "x${ttyS}" = "x" ]
- then
- ttyS=1
- fi
}
parse_commadline ${@}
@@ -216,8 +203,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/ttyTTY/tty${tty}/g" "${TmpDir}/ks-template"
-sed -ie "s/ttySTTYS/ttyS${ttyS}/g" "${TmpDir}/ks-template"
+sed -ie "s/KRNLCMDLINE/${KrnlCmdLine}/g" "${TmpDir}/ks-template"
if [ "x${PublishPath}" = "x" ]
then
diff --git a/create-boot-floppy b/create-boot-floppy
index 31e965c..2cb7a87 100755
--- a/create-boot-floppy
+++ b/create-boot-floppy
@@ -36,8 +36,7 @@ Options:
-N, --nameserver Nameserver of target system
-S, --cosmos-hash Hash used by cosmos to verify stuff
-h, --help this
- --tty console number
- --ttyS serial console number
+ --inst-cmdline add stuff to the install system kernel command line
If --cosmos-hash is set to 'disabled', the kickstart stage should skip cosmos
bootstrapping, and leave the system unmanaged.
@@ -97,12 +96,8 @@ function parse_commadline {
TmpDir="${2}"
shift
;;
- --tty)
- tty="${2}"
- shift
- ;;
- --ttyS)
- ttyS="${2}"
+ --inst-cmdline)
+ InstCmdLine="${2}"
shift
;;
*)
@@ -163,14 +158,6 @@ function check_options {
else
mkdir -p "${TmpDir}"
fi
- if [ "x${tty}" = "x" ]
- then
- tty=1
- fi
- if [ "x${ttyS}" = "x" ]
- then
- ttyS=1
- fi
}
# Host="kas-fiona-10-02"
@@ -251,7 +238,7 @@ route
###
# Set install parameters:
set base http://\\$"{"ks"}"/install/centos/7/os/x86_64
-kernel \\$"{"base"}"/images/pxeboot/vmlinuz text console=tty${tty} console=ttyS${ttyS},115200n8 ip=\\$"{"ip"}" netmask=\\$"{"nm"}" gateway=\\$"{"gw"}" repo=\\$"{"base"}" ks=http://\\$"{"ks"}"/install/ks/\\$"{"hn"}".ks cosmoshash=${CosmosHash}
+kernel \\$"{"base"}"/images/pxeboot/vmlinuz text ${InstCmdLine} ip=\\$"{"ip"}" netmask=\\$"{"nm"}" gateway=\\$"{"gw"}" repo=\\$"{"base"}" ks=http://\\$"{"ks"}"/install/ks/\\$"{"hn"}".ks cosmoshash=${CosmosHash}
initrd \\$"{"base"}"/images/pxeboot/initrd.img
###
# Boot into install
diff --git a/ks-template/hw/dell/R7425/100g-dtn.ks b/ks-template/hw/dell/R7425/100g-dtn.ks
index 76ece0b..8c8865e 100644
--- a/ks-template/hw/dell/R7425/100g-dtn.ks
+++ b/ks-template/hw/dell/R7425/100g-dtn.ks
@@ -34,7 +34,7 @@ skipx
timezone Europe/Copenhagen --isUtc
user --name=jac --password=$6$t3nu7Hd9pAQCpy7J$uRbZOadIBN7AeRdQwG67ac4OD5nDCK9vb2wWlR1PWwovE7ssu/MngMsViP71ITVuij84.aF6a2c5IhTcYZv.0. --iscrypted --gecos="Jon Clausen" --groups=wheel
# System bootloader configuration
-bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sdb elevator=deadline console=ttyTTY console=ttySTTYS,115200n8
+bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sdb elevator=deadline KRNLCMDLINE
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=sdb
diff --git a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks
index ca5d6ef..35792eb 100644
--- a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks
+++ b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks
@@ -37,7 +37,7 @@ skipx
timezone Europe/Copenhagen --isUtc
user --name=jac --password=$6$t3nu7Hd9pAQCpy7J$uRbZOadIBN7AeRdQwG67ac4OD5nDCK9vb2wWlR1PWwovE7ssu/MngMsViP71ITVuij84.aF6a2c5IhTcYZv.0. --iscrypted --gecos="Jon Clausen" --groups=wheel
# System bootloader configuration
-bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda elevator=deadline console=ttyTTY console=ttySTTYS,115200n8
+bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda elevator=deadline KRNLCMDLINE
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=sda
diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config
index 9fd45a7..2a9883f 100755
--- a/prep-boot-floppy-and-ks-config
+++ b/prep-boot-floppy-and-ks-config
@@ -43,10 +43,10 @@ Options:
name of the template file. Example:
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
--sec-ip IP of secondary interface
--sec-nm Netmask of secondary interface
- --tty console number
- --ttyS serial console number
-h, --help this
If --cosmos-hash is set to 'disabled', the kickstart stage should skip cosmos
@@ -113,12 +113,12 @@ function parse_commadline {
TemplateOpt="--template ${2}"
shift
;;
- --tty)
- tty="${2}"
+ --inst-cmdline)
+ InstCmdLineOpt="--inst-cmdline ${2}"
shift
;;
- --ttyS)
- ttyS="${2}"
+ --krnl-cmdline)
+ KrnlCmdLineOpt="--krnl-cmdline ${2}"
shift
;;
*)
@@ -212,12 +212,11 @@ ScriptPath=$(echo $0 | sed -e "s#/${Self}##")
#echo $ScriptPath
${ScriptPath}/create-boot-floppy -D ${Domain} -G ${GW} -H ${Host} \
- -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --tty "${tty}" \
- --ttyS "${ttyS}"
+ -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} ${InstCmdLineOpt}
${ScriptPath}/adapt-ks-template -D ${Domain} -G ${GW} -H ${Host} \
-I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --sec-ip ${SecIP} \
- --sec-nm ${SecNM} ${TemplateOpt} --tty "${tty}" --ttyS "${ttyS}"
+ --sec-nm ${SecNM} ${TemplateOpt} ${KrnlCmdLineOpt}
# When this script calls the other two, PublishPath *is* set, so expect
# everything of value to be evacuated, and just clean up: