summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
l---------centos1
-rw-r--r--centos7/index.php (renamed from centos/index.php)2
-rw-r--r--centos8/drivers/kmod-arcmsr.rpmbin0 -> 45884 bytes
-rw-r--r--centos8/index.php8
-rw-r--r--config.php83
-rw-r--r--docs/driverdisk.txt23
-rw-r--r--index.php48
-rw-r--r--ipe.ks41
-rw-r--r--templates/base-centos71
-rw-r--r--templates/base-centos81
-rw-r--r--templates/base-fedora1
-rw-r--r--templates/packages-centos71
-rw-r--r--templates/packages-centos82
-rw-r--r--templates/packages-fedora2
-rw-r--r--templates/post-arcmsr12
l---------templates/post-ipecompute11
-rw-r--r--templates/storage-hdd (renamed from templates/hdd)6
-rw-r--r--templates/storage-raid0 (renamed from templates/raid0)4
-rw-r--r--templates/storage-raid1 (renamed from templates/raid1)4
19 files changed, 180 insertions, 61 deletions
diff --git a/centos b/centos
new file mode 120000
index 0000000..2fdf3e8
--- /dev/null
+++ b/centos
@@ -0,0 +1 @@
+centos7 \ No newline at end of file
diff --git a/centos/index.php b/centos7/index.php
index 00e5b3e..8852b6e 100644
--- a/centos/index.php
+++ b/centos7/index.php
@@ -1,6 +1,6 @@
<?php
-$DISTRIBUTION="centos";
+$DISTRIBUTION="centos7";
chdir("..");
require "index.php";
diff --git a/centos8/drivers/kmod-arcmsr.rpm b/centos8/drivers/kmod-arcmsr.rpm
new file mode 100644
index 0000000..1800645
--- /dev/null
+++ b/centos8/drivers/kmod-arcmsr.rpm
Binary files differ
diff --git a/centos8/index.php b/centos8/index.php
new file mode 100644
index 0000000..51b7cf7
--- /dev/null
+++ b/centos8/index.php
@@ -0,0 +1,8 @@
+<?php
+
+$DISTRIBUTION="centos8";
+
+chdir("..");
+require "index.php";
+
+?> \ No newline at end of file
diff --git a/config.php b/config.php
index c8d00e5..eb80538 100644
--- a/config.php
+++ b/config.php
@@ -1,70 +1,69 @@
<?php
-//$DEFAULT_SERVER = "ipecamera4";
-$DISTRIBUTIONS=array("centos", "fedora");
+$DEFAULT_SERVER = "ipecompute1";
+$DISTRIBUTIONS=array("centos7", "centos8", "fedora");
# disks will be synchronized with k3
-$KATRIN_SERVERS = array(
- "ks" => "ipekatrin-v4.ks",
+
+$SERVERS = array(
"templates" => "templates",
+ "sysdisks" => "sdb,sdc",
+ "eth" => array("eno1", "eno2"),
"domain" => "ipe.kit.edu",
"cidr" => 23,
"gw" => "141.52.64.207",
"ns" => "141.52.3.3,141.52.8.18",
"time" => "141.52.8.18",
- "sysdisks" => "sdb,sdc",
"append_sol" => "console=tty1 console=ttyS1,115200 earlyprint=serial,ttyS1,115200",
"raid" => "RAID1",
"size" => "80000",
+ "home_size" => "500000",
"bootsize" => "2048",
- "eth" => array("enp3s0f1", "enp3s0f0"),
+ "skip_security" => false,
+ "skip_minimal" => false,
+ "skip_home" => false,
);
-$IPE_SERVERS = array_merge($KATRIN_SERVERS, array(
+
+$KATRIN_SERVERS = array_merge($SERVERS, array(
+ "ks" => "ipekatrin-v4.ks",
+ "eth" => array("enp3s0f1", "enp3s0f0"),
+));
+
+$IPE_SERVERS = array_merge($SERVERS, array(
"ks" => "ipe.ks",
"cidr" => 24,
"base_net" => "192.168.26.",
"gw" => "192.168.26.117",
- "sysdisks" => "sda,sdb",
- "append_sol" => "",
- "raid" => "RAID1",
"size" => "200000",
- "home_size" => "800000",
- "bootsize" => "2048",
- "eth" => array("eth0", "eth1"),
- "skip_security" => true,
- "skip_minimal" => false,
- "skip_home" => false,
+
));
$ANDS_SERVERS = array_merge($IPE_SERVERS, array(
- "ks" => "ipe.ks",
- "cidr" => 24,
- "base_net" => "192.168.26.",
"base_ip" => 140,
- "gw" => "192.168.26.117",
- "sysdisks" => "sda,sdb",
- "append_sol" => "console=tty1 console=ttyS1,115200 earlyprint=serial,ttyS1,115200",
- "raid" => "RAID1",
- "size" => "200000",
-// "home_size" => "200000",
- "bootsize" => "2048",
- "eth" => array("eno1", "eno2"),
- "skip_security" => false,
- "skip_minimal" => false,
"skip_home" => true,
));
+$COMPUTE_SERVERS = array_merge($IPE_SERVERS, array(
+ "base_ip" => 130,
+ "raid" => "RAID0",
+ "skip_home" => false,
+));
+
+
$CAMERA_SERVERS = array_merge($IPE_SERVERS, array(
+ "base_ip" => 80,
+ "sysdisks" => "sda,sdb",
"raid" => "RAID0",
- "append_sol" => "console=tty1 console=ttyS1,115200 earlyprint=serial,ttyS1,115200",
- "eth" => array("eno1", "eno2"),
- "base_ip" => 80
+ "skip_security" => true
));
$STUDENT_SERVERS = array_merge($IPE_SERVERS, array(
+ "base_ip" => 60,
"eth" => array("enp9s0", "enp6s0"),
- "base_ip" => 60
+ "sysdisks" => "sda,sdb",
+ "append_sol" => "",
+ "skip_security" => true
));
@@ -102,6 +101,24 @@ $SERVER_LIST = array(
"eth" => array("enp9s0", "enp10s0"),
"sysdisks" => "sdb,sdc", // IPMI CDROM is emulates a disk which occasionaly get assigned to sdb/sdc, rebooting-retrying few times helps (it gets to sdd)
)),
+ "ipecompute1" => array_merge($COMPUTE_SERVERS, array(
+ "macs" => array("00:30:48:dd:5e:82", "00:30:48:dd:5e:83"),
+ "eth" => array("enp5s0", "enp6s0"),
+ "sysdisks" => "sdb",
+ "driverdisk" => "kmod-arcmsr.rpm"
+ )),
+ "ipecompute3" => array_merge($COMPUTE_SERVERS, array(
+ "macs" => array("00:25:90:62:c0:26", "00:25:90:62:c0:27"),
+ "eth" => array("enp5s0", "enp6s0"),
+ )),
+ "ipecompute2" => array_merge($COMPUTE_SERVERS, array(
+ "macs" => array("00:25:90:95:7c:6c", "00:25:90:95:7c:6d"),
+ "sysdisks" => "sdb,sdc"
+ )),
+ "ipecompute4" => array_merge($COMPUTE_SERVERS, array(
+ "macs" => array("0c:c4:7a:b3:28:8c", "0c:c4:7a:b3:28:8d"),
+ "sysdisks" => "sdi,sdj"
+ )),
"ipecamera0" => array_merge($CAMERA_SERVERS, array(
"macs" => array("bc:5f:f4:ad:96:e3", "bc:5f:f4:ad:96:eb"),
"eth" => array("enp20s0", "enp21s0"),
diff --git a/docs/driverdisk.txt b/docs/driverdisk.txt
new file mode 100644
index 0000000..6c0dd29
--- /dev/null
+++ b/docs/driverdisk.txt
@@ -0,0 +1,23 @@
+General
+-------
+ - DriverDisk work with ISO images or RPMs
+ https://www.marcanoonline.com/post/2016/07/red-hat-enterprise-linux-and-centos-7-driver-disk/
+ - Besides providing drivers to installer, it is also necessary to install it, e.g. in %post section.
+
+RPM
+---
+ - RPM should contain the driver for installer kernel
+ - RPM should provie 'kernel-modules' with appropriate version, e.g.
+ kernel-modules >= 3.10.0-327.el7.<arch>
+ - Collection of storage drivers is available at http://elrepo.org
+ https://elrepo.org/linux/elrepo/el8/x86_64/
+
+ISO (if more than 1 driver is required)
+---
+ rhhd3 # File, content is: Driver Update Disk version 3
+ rpms
+ x86_64
+ kmod-arcmsr-1.40.00.05-20180309.1.el8_0.elrepo.x86_64.rpm # RPM with drivers (see above)
+ repodata # Generated with createrepo/createrepo_c
+ repomd.xml
+ ...
diff --git a/index.php b/index.php
index 4e1bf17..dfb8e04 100644
--- a/index.php
+++ b/index.php
@@ -5,18 +5,36 @@ require "cidr.php";
require "config.php";
function get_templates(&$server) {
+ global $DISTRIBUTION;
+
$templates = array();
foreach (glob("{$server['templates']}/*") as $ffn) {
$fn = basename($ffn);
$templates[$fn] = file_get_contents($ffn);
}
+ $templates['distrib_base_config'] = $templates["base-$DISTRIBUTION"];
+ $templates['distrib_package_config'] = $templates["packages-$DISTRIBUTION"];
+ $templates['distrib_pre_config'] = $templates["pre-$DISTRIBUTION"];
+ $templates['distrib_post_config'] = $templates["post-$DISTRIBUTION"];
+
+ $srvid = $server['srvid'];
+ $templates['node_base_config'] = $templates["base-$srvid"];
+ $templates['node_package_config'] = $templates["packages-$srvid"];
+ $templates['node_pre_config'] = $templates["pre-$srvid"];
+ $templates['node_post_config'] = $templates["post-$srvid"];
+
+ $templates['nd_base_config'] = $templates["base-$srvid-$DISTRIBUTION"];
+ $templates['nd_package_config'] = $templates["packages-$srvid-$DISTRIBUTION"];
+ $templates['nd_pre_config'] = $templates["pre-$srvid-$DISTRIBUTION"];
+ $templates['nd_post_config'] = $templates["post-$srvid-$DISTRIBUTION"];
+
if ((isset($server["disk2"]))&&($server["raid"] !== false)) {
$raid = $server["raid"];
if (preg_match("/RAID(\d+)/i", $raid, $m)) $raid = $m[1];
- $templates['storage_config'] = $templates["raid{$raid}"];
+ $templates['storage_config'] = $templates["storage-raid{$raid}"];
} else {
- $templates['storage_config'] = $templates['hdd'];
+ $templates['storage_config'] = $templates['storage-hdd'];
}
unset($server['templates']);
@@ -25,10 +43,12 @@ function get_templates(&$server) {
}
function get_server($srvid) {
+ global $DISTRIBUTION;
global $SERVER_LIST;
global $NETMASK;
$server = $SERVER_LIST[$srvid];
+ $server['srvid'] = $srvid;
if (!isset($server["fqdn"]))
$server["fqdn"] = "{$srvid}.{$server['domain']}";
@@ -49,6 +69,12 @@ function get_server($srvid) {
}
}
+ $server["distribution"] = $DISTRIBUTION;
+ if ($server["driverdisk"])
+ $server["skip_driverdisk"] = false;
+ else
+ $server["skip_driverdisk"] = true;
+
if ($server["ip"]) {
$server["skip_ip"] = false;
} else {
@@ -88,7 +114,7 @@ function find_mac($macs, $mac_header) {
if (!is_array($macs)) $macs = array($macs);
foreach ($macs as $mac) {
- if (preg_match("/$mac/", $mac_header))
+ if (preg_match("/$mac/i", $mac_header))
return true;
}
return false;
@@ -108,7 +134,7 @@ function find_server_by_header($http_header, $value) {
global $SERVER_LIST;
foreach ($SERVER_LIST as $srvid => $server) {
- if ((is_array($server["headers"]))&&(isset($server["headers"][$http_header]))) {
+ if ((array_key_exists("headers", $server))&&(is_array($server["headers"]))&&(array_key_exists($http_header, $server["headers"]))) {
$expected = $server["headers"][$http_header];
if (!is_array($expected)) $expected = array($expected);
foreach ($expected as $re) {
@@ -150,14 +176,20 @@ function find_server() {
$server = find_server();
-$f = fopen("/srv/www/htdocs/ands/logs/kickstart.log", "a+");
+$f = fopen("../logs/kickstart.log", "a+");
if ($f) {
- fprintf($f, "%s %s at %s\n", $_SERVER["REMOTE_ADDR"], ($server?$server["fqdn"]:"-"), date(DATE_ISO8601));
+ if (isset($_SERVER["HTTP_ANDS_REAL_IP"])) $remote = $_SERVER["HTTP_ANDS_REAL_IP"];
+ elseif (isset($_SERVER["HTTP_ANDS_FORWARDED_FOR"])) $remote = $_SERVER["HTTP_ANDS_FORWARDED_FOR"];
+ elseif (isset($_SERVER["HTTP_X_REAL_IP"])) $remote = $_SERVER["HTTP_X_REAL_IP"];
+ elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) $remote = $_SERVER["HTTP_X_FORWARDED_FOR"];
+ else $remote = $_SERVER["REMOTE_ADDR"];
+
+ fprintf($f, "%s %s at %s\n", $remote, ($server?$server["fqdn"]:"-"), date(DATE_ISO8601));
fclose($f);
}
if (!$server) {
- $f = fopen("/srv/www/htdocs/ands/logs/kickstart-new.log", "a+");
+ $f = fopen("../logs/kickstart-new.log", "a+");
if ($f) {
fwrite($f, "%s\n", date(DATE_ISO8601));
fwrite($f, print_r($_SERVER, true));
@@ -208,7 +240,7 @@ foreach ($DISTRIBUTIONS as $distrib) {
$ks = preg_replace($patterns, $values, $ks);
if ($VERBOSE) {
- $f = fopen("/srv/www/htdocs/ands/logs/kickstart-verbose.log", "a+");
+ $f = fopen("../logs/kickstart-verbose.log", "a+");
if ($f) {
fwrite($f, "-----------------------------------------------------\n");
fwrite($f, "%s\n", date(DATE_ISO8601));
diff --git a/ipe.ks b/ipe.ks
index a0ae85f..475755b 100644
--- a/ipe.ks
+++ b/ipe.ks
@@ -1,11 +1,12 @@
#version=DEVEL
+@DISTRIB_BASE_CONFIG@
+@NODE_BASE_CONFIG@
+@ND_BASE_CONFIG@
+
# System authorization information
auth --enableshadow --passalgo=sha512
-# Use CDROM installation media
-cdrom
-
# Use graphical install (graphical is enforce by vnc requested at kernel args)
#text
graphical
@@ -26,7 +27,7 @@ network --hostname=@FQDN@
# Partition clearing information
-clearpart --all --drives=@SYSDISKS@
+clearpart --all --initlabel --drives=@SYSDISKS@
zerombr
# System bootloader configuration
@@ -35,10 +36,13 @@ bootloader --location=mbr --driveorder=@SYSDISKS@ --boot-drive=@BOOTDISK@ --app
#autopart --type=lvm
#reqpart --add-boot
+# rpm & iso are supported here
+@SKIP_DRIVERDISK@driverdisk --source=http://ufo.kit.edu/ands/kickstart/@DISTRIBUTION@/drivers/@DRIVERDISK@
@STORAGE_CONFIG@
+
logvol / --vgname=sysvg --size=@SIZE@ --name=lv_root --fstype=ext4
-@SKIP_HOME@logvol /home --vgname=sysvg --size=@HOME_SIZE@ --name=lv_home --fstype=ext4 --grow
+@SKIP_HOME@logvol /home --vgname=sysvg --size=@HOME_SIZE@ --name=lv_home --fstype=ext4 --grow
# Root password (KaaS)
@@ -63,14 +67,13 @@ poweroff
%packages
-@CENTOS@@^minimal
+@CENTOS7@@^minimal
@core
+@DISTRIB_PACKAGE_CONFIG@
+@NODE_PACKAGE_CONFIG@
+@ND_PACKAGE_CONFIG@
chrony
curl
-
-# Python2 required for ansible (and is not installed on Fedora)
-python
-@FEDORA@python-dnf
%end
%anaconda
@@ -97,22 +100,33 @@ if [ -b /dev/@DISK1@ ]; then
for name in /dev/@DISK1@?*; do
echo "Removing md superblock on $name"
mdadm --misc --zero-superblock $name
- dd if=/dev/zero of=$name bs=512 seek=$(( $(blockdev --getsz $name) - 1024 )) count=1024
+ dd if=/dev/zero of=$name bs=4096 count=1024
+ dd if=/dev/zero of=$name bs=4096 seek=$(( $(blockdev --getsz $name) - 1024 )) count=1024
done
+ dd if=/dev/zero of=/dev/@DISK1@ bs=4096 count=1024
+ #parted /dev/@DISK1@ --script -- mklabel gpt
fi
if [ -b /dev/@DISK2@ ]; then
for name in /dev/@DISK2@?*; do
echo "Removing md superblock on $name"
mdadm --misc --zero-superblock $name
- dd if=/dev/zero of=$name bs=512 seek=$(( $(blockdev --getsz $name) - 1024 )) count=1024
+ dd if=/dev/zero of=$name bs=4096 count=1024
+ dd if=/dev/zero of=$name bs=4096 seek=$(( $(blockdev --getsz $name) - 1024 )) count=1024
done
+ dd if=/dev/zero of=/dev/@DISK2@ bs=4096 count=1024
+ #parted /dev/@DISK2@ --script -- mklabel gpt
fi
+@DISTRIB_PRE_CONFIG@
+@NODE_PRE_CONFIG@
+@ND_PRE_CONFIG@
%end
%post --log=/var/log/ks02.log
yum install -y unzip
+@CENTOS8@alternatives --set python /usr/bin/python3
+
mkdir /root/.ssh
chmod 0700 /root/.ssh
curl http://ufo.kit.edu/ands/kickstart/authorized_keys -o /root/.ssh/authorized_keys
@@ -135,4 +149,7 @@ PREFIX=@CIDR@
#PREFEX1=
EOF
+@DISTRIB_POST_CONFIG@
+@NODE_POST_CONFIG@
+@ND_POST_CONFIG@
%end
diff --git a/templates/base-centos7 b/templates/base-centos7
new file mode 100644
index 0000000..2838fb1
--- /dev/null
+++ b/templates/base-centos7
@@ -0,0 +1 @@
+cdrom
diff --git a/templates/base-centos8 b/templates/base-centos8
new file mode 100644
index 0000000..0639731
--- /dev/null
+++ b/templates/base-centos8
@@ -0,0 +1 @@
+url --url="http://ftp.rz.uni-frankfurt.de/pub/mirrors/centos/8.0.1905/BaseOS/x86_64/os/"
diff --git a/templates/base-fedora b/templates/base-fedora
new file mode 100644
index 0000000..2838fb1
--- /dev/null
+++ b/templates/base-fedora
@@ -0,0 +1 @@
+cdrom
diff --git a/templates/packages-centos7 b/templates/packages-centos7
new file mode 100644
index 0000000..fdc793e
--- /dev/null
+++ b/templates/packages-centos7
@@ -0,0 +1 @@
+python
diff --git a/templates/packages-centos8 b/templates/packages-centos8
new file mode 100644
index 0000000..1b2dd8b
--- /dev/null
+++ b/templates/packages-centos8
@@ -0,0 +1,2 @@
+# python is required for ansible (and is not installed on Fedora)
+python3
diff --git a/templates/packages-fedora b/templates/packages-fedora
new file mode 100644
index 0000000..9aaeded
--- /dev/null
+++ b/templates/packages-fedora
@@ -0,0 +1,2 @@
+python3
+python3-dnf \ No newline at end of file
diff --git a/templates/post-arcmsr b/templates/post-arcmsr
new file mode 100644
index 0000000..be04566
--- /dev/null
+++ b/templates/post-arcmsr
@@ -0,0 +1,12 @@
+yum -y install https://www.elrepo.org/elrepo-release-8.0-2.el8.elrepo.noarch.rpm
+yum -y install kmod-arcmsr
+
+# But there is already a newer kernel.
+# weak-modules does not work automatically, add-kernel does not help
+# by default dracut copies module for old kernel (good), but does not load it. -I copies module, but depmod is not executed.
+kver=$(rpm -qv kernel | cut -d '-' -f 2-)
+/sbin/weak-modules --add-kernel $kver
+cp -r /lib/modules/4.18.0-80.el8.x86_64/extra/ /lib/modules/$kver
+depmod -a
+cp /boot/initramfs-$kver.img /boot/initramfs-$kver.img.orig
+dracut -f /boot/initramfs-$kver.img -I /lib/modules/$kver/extra/arcmsr/arcmsr.ko --force-drivers arcmsr $kver
diff --git a/templates/post-ipecompute1 b/templates/post-ipecompute1
new file mode 120000
index 0000000..11df7d6
--- /dev/null
+++ b/templates/post-ipecompute1
@@ -0,0 +1 @@
+post-arcmsr \ No newline at end of file
diff --git a/templates/hdd b/templates/storage-hdd
index 531581f..c8db327 100644
--- a/templates/hdd
+++ b/templates/storage-hdd
@@ -1,5 +1,5 @@
part biosboot --ondisk=@DISK1@ --asprimary --size=1 --fstype=biosboot
part /boot --ondisk=@DISK1@ --asprimary --size @BOOTSIZE@ --fstype=ext4
-part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
-part lvm.01 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow
-volgroup sysvg lvm.01
+part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
+part pv.01 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow
+volgroup sysvg pv.01
diff --git a/templates/raid0 b/templates/storage-raid0
index f612fa2..15734ff 100644
--- a/templates/raid0
+++ b/templates/storage-raid0
@@ -2,8 +2,8 @@ part biosboot --ondisk=@DISK1@ --asprimary --size=1 --fstype=biosboot
part biosboot --ondisk=@DISK2@ --asprimary --size=1 --fstype=biosboot
part raid.01 --ondisk=@DISK1@ --asprimary --size @BOOTSIZE@
part raid.02 --ondisk=@DISK2@ --asprimary --size @BOOTSIZE@
-part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
-part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended
+part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
+part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended
part pv.01 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow
part pv.02 --ondisk=@DISK2@ --asprimary --size @SIZE@ --grow
raid /boot --level=RAID1 --device=md0 raid.01 raid.02 --fstype=ext4
diff --git a/templates/raid1 b/templates/storage-raid1
index bcdb1c7..6d7e6e6 100644
--- a/templates/raid1
+++ b/templates/storage-raid1
@@ -2,8 +2,8 @@ part biosboot --ondisk=@DISK1@ --asprimary --size=1 --fstype=biosboot
part biosboot --ondisk=@DISK2@ --asprimary --size=1 --fstype=biosboot
part raid.01 --ondisk=@DISK1@ --asprimary --size @BOOTSIZE@
part raid.02 --ondisk=@DISK2@ --asprimary --size @BOOTSIZE@
-part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
-part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended
+part swap --ondisk=@DISK1@ --asprimary --fstype=swap --recommended
+part swap --ondisk=@DISK2@ --asprimary --fstype=swap --recommended
part raid.03 --ondisk=@DISK1@ --asprimary --size @SIZE@ --grow
part raid.04 --ondisk=@DISK2@ --asprimary --size @SIZE@ --grow
raid /boot --level=RAID1 --device=md0 raid.01 raid.02 --fstype=ext4