diff options
author | Jon Clausen <jac@nordu.net> | 2018-07-31 10:42:35 +0200 |
---|---|---|
committer | Jon Clausen <jac@nordu.net> | 2018-07-31 10:42:35 +0200 |
commit | 55282ee15f1eeefc5a68d843003b09a6f2f6da1d (patch) | |
tree | 1c10216ac264d70cb7dba451793d5732b5970f7c | |
parent | 0cae593ee142c94c77818e5538c82572f8b767c6 (diff) |
added support for setting tty+ttyS
-rwxr-xr-x | adapt-ks-template | 22 | ||||
-rwxr-xr-x | create-boot-floppy | 20 | ||||
-rw-r--r-- | ks-template/hw/dell/R7425/100g-dtn.ks | 2 | ||||
-rw-r--r-- | ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks | 2 | ||||
-rwxr-xr-x | prep-boot-floppy-and-ks-config | 23 |
5 files changed, 63 insertions, 6 deletions
diff --git a/adapt-ks-template b/adapt-ks-template index 9f7640f..a2026e6 100755 --- a/adapt-ks-template +++ b/adapt-ks-template @@ -32,9 +32,11 @@ Options: --template Template to use. This is a relative path, plus the name of the template file. Default: ${Template} + -h, --help this --sec-ip IP of secondary interface --sec-nm Netmask of secondary interface - -h, --help this + --tty console number + --ttyS serial console number EOF } @@ -105,6 +107,14 @@ function parse_commadline { TmpDir="${2}" shift ;; + --tty) + tty="${2}" + shift + ;; + --ttyS) + ttyS="${2}" + shift + ;; *) echo "what do you mean \"$1\"?" exit 1 @@ -165,6 +175,14 @@ 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 ${@} @@ -198,6 +216,8 @@ 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" if [ "x${PublishPath}" = "x" ] then diff --git a/create-boot-floppy b/create-boot-floppy index 6178e76..31e965c 100755 --- a/create-boot-floppy +++ b/create-boot-floppy @@ -36,6 +36,8 @@ 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 If --cosmos-hash is set to 'disabled', the kickstart stage should skip cosmos bootstrapping, and leave the system unmanaged. @@ -95,6 +97,14 @@ function parse_commadline { TmpDir="${2}" shift ;; + --tty) + tty="${2}" + shift + ;; + --ttyS) + ttyS="${2}" + shift + ;; *) echo "what do you mean \"$1\"?" exit 1 @@ -153,6 +163,14 @@ 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" @@ -233,7 +251,7 @@ route ### # Set install parameters: set base http://\\$"{"ks"}"/install/centos/7/os/x86_64 -kernel \\$"{"base"}"/images/pxeboot/vmlinuz text console=tty1 console=ttyS1,115200n8 ip=\\$"{"ip"}" netmask=\\$"{"nm"}" gateway=\\$"{"gw"}" repo=\\$"{"base"}" ks=http://\\$"{"ks"}"/install/ks/\\$"{"hn"}".ks cosmoshash=${CosmosHash} +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} 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 318e6f2..76ece0b 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=tty1 console=ttyS1,115200n8 +bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sdb elevator=deadline console=ttyTTY console=ttySTTYS,115200n8 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 790c099..ca5d6ef 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=tty1 console=ttyS1,115200n8 +bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda elevator=deadline console=ttyTTY console=ttySTTYS,115200n8 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 6c857c5..9fd45a7 100755 --- a/prep-boot-floppy-and-ks-config +++ b/prep-boot-floppy-and-ks-config @@ -45,6 +45,8 @@ Options: dell/R7425/100g-dtn.ks --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 @@ -111,6 +113,14 @@ function parse_commadline { TemplateOpt="--template ${2}" shift ;; + --tty) + tty="${2}" + shift + ;; + --ttyS) + ttyS="${2}" + shift + ;; *) echo "what do you mean \"$1\"?" exit 1 @@ -181,6 +191,14 @@ 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 ${@} @@ -194,11 +212,12 @@ 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} + -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --tty "${tty}" \ + --ttyS "${ttyS}" ${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} + --sec-nm ${SecNM} ${TemplateOpt} --tty "${tty}" --ttyS "${ttyS}" # When this script calls the other two, PublishPath *is* set, so expect # everything of value to be evacuated, and just clean up: |