summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xadapt-ks-template29
-rw-r--r--ks-template/hw/dell/R7425/100g-dtn.ks6
-rw-r--r--ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks6
-rwxr-xr-xprep-boot-floppy-and-ks-config21
4 files changed, 55 insertions, 7 deletions
diff --git a/adapt-ks-template b/adapt-ks-template
index 6514745..39fc977 100755
--- a/adapt-ks-template
+++ b/adapt-ks-template
@@ -29,6 +29,8 @@ Options:
-M, --netmask Netmask of target system
-N, --nameserver Nameserver of target system
-P, --publish-path Path where results will be stored
+ --boot-dev device to install bootloader on
+ --root-dev device to use for system
--cosmos-tag Tag in ndn-sysconf to reference
--template Template to use. This is a relative path, plus the
name of the template file. Default:
@@ -97,6 +99,14 @@ function parse_commadline {
Kserver="$2"
shift
;;
+ --boot-dev)
+ BootDev="${2}"
+ shift
+ ;;
+ --root-dev)
+ RootDev="${2}"
+ shift
+ ;;
--cosmos-tag)
CosmosTag="${2}"
shift
@@ -185,6 +195,22 @@ function check_options {
then
NS="109.105.96.141"
fi
+ if [ "x${BootDev}" = "x" ]
+ then
+ BootDev="sda"
+ fi
+ if [ "x${RootDev}" = "x" ]
+ then
+ RootDev="sda"
+ fi
+ if [ "${RootDev}" = "${BootDev}" ]
+ then
+ UseDisk="${RootDev}"
+ ClearPart="${RootDev}"
+ else
+ UseDisk="${BootDev},${RootDev}"
+ ClearPart="${BootDev},${RootDev}"
+ fi
}
parse_commadline ${@}
@@ -227,6 +253,9 @@ 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/${KrnlCmdLineOpt}/g" "${TmpDir}/ks-template"
+sed -ie "s/BOOTDEV/${BootDev}/g" "${TmpDir}/ks-template"
+sed -ie "s/CLEARPART/${ClearPart}/g" "${TmpDir}/ks-template"
+sed -ie "s/USEDISK/${UseDisk}/g" "${TmpDir}/ks-template"
if [ "x${PublishPath}" = "x" ]
then
diff --git a/ks-template/hw/dell/R7425/100g-dtn.ks b/ks-template/hw/dell/R7425/100g-dtn.ks
index 8ff914b..274e55b 100644
--- a/ks-template/hw/dell/R7425/100g-dtn.ks
+++ b/ks-template/hw/dell/R7425/100g-dtn.ks
@@ -10,7 +10,7 @@ url --url=http://INSTALLSERVER/install/centos/7/os/x86_64/
text
# Run the Setup Agent on first boot
firstboot --enable
-ignoredisk --only-use=sda,sdb
+ignoredisk --only-use=USEDISK
# Keyboard layouts
keyboard --vckeymap=us --xlayouts=''
# System language
@@ -34,10 +34,10 @@ 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 elevator=deadline KRNLCMDLINE" --location=mbr --boot-drive=sda
+bootloader --append=" crashkernel=auto elevator=deadline KRNLCMDLINE" --location=mbr --boot-drive=BOOTDEV
autopart --type=lvm --nohome
# Partition clearing information
-clearpart --all --drives=sda,sdb
+clearpart --all --drives=CLEARPART
# Boot the installed system automatically once the install finishes;
reboot
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 b067897..eee064b 100644
--- a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks
+++ b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks
@@ -10,7 +10,7 @@ url --url=http://INSTALLSERVER/install/centos/7/os/x86_64/
text
# Run the Setup Agent on first boot
firstboot --enable
-ignoredisk --only-use=sda
+ignoredisk --only-use=USEDISK
# Keyboard layouts
keyboard --vckeymap=us --xlayouts=''
# System language
@@ -37,10 +37,10 @@ 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 elevator=deadline KRNLCMDLINE" --location=mbr --boot-drive=sda
+bootloader --append=" crashkernel=auto elevator=deadline KRNLCMDLINE" --location=mbr --boot-drive=BOOTDEV
autopart --type=lvm
# Partition clearing information
-clearpart --all --initlabel --drives=sda
+clearpart --all --initlabel --drives=CLEARPART
# Boot the installed system automatically once the install finishes;
#reboot
diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config
index 9befc42..b8d1aef 100755
--- a/prep-boot-floppy-and-ks-config
+++ b/prep-boot-floppy-and-ks-config
@@ -41,6 +41,8 @@ Options:
-N, --nameserver Nameserver of target system
-P, --publish-path Path where results will be stored
-S, --cosmos-hash Hash used by cosmos to verify stuff
+ --boot-dev device to install bootloader on
+ --root-dev device to use for system
--cosmos-tag Tag in ndn-sysconf to reference
--template Template to use. This is a relative path, plus the
name of the template file. Example:
@@ -111,6 +113,14 @@ function parse_commadline {
CosmosHash="$2"
shift
;;
+ --boot-dev)
+ BootDev="${2}"
+ shift
+ ;;
+ --root-dev)
+ RootDev="${2}"
+ shift
+ ;;
--cosmos-tag)
CosmosTag="${2}"
shift
@@ -197,6 +207,14 @@ function check_options {
CosmosHash="2f15e1edb02f14607084f167929bc145ed47954d"
fi
# optional/defaults:
+ if [ "x${BootDev}" = "x" ]
+ then
+ BootDev="sda"
+ fi
+ if [ "x${RootDev}" = "x" ]
+ then
+ RootDev="sda"
+ fi
if [ ! "x${CosmosTag}" = "x" ]
then
CosmosTagOpt="--cosmos-tag ${CosmosTag}"
@@ -232,7 +250,8 @@ ${ScriptPath}/create-boot-floppy -D ${Domain} -G ${GW} -H ${Host} \
${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} ${KrnlCmdLineOpt} ${CosmosTagOpt} \
- --gen-cmd ${SelfCommandLine}
+ --gen-cmd ${SelfCommandLine} --boot-dev "${BootDev}" \
+ --root-dev "${RootDev}"
# When this script calls the other two, PublishPath *is* set, so expect
# everything of value to be evacuated, and just clean up: