Skip to content

Commit ceade0e

Browse files
Added support for building redhat isos and updated simp rpm deps (#885)
1 parent 282cbd2 commit ceade0e

File tree

16 files changed

+1393
-8
lines changed

16 files changed

+1393
-8
lines changed

Puppetfile.pinned

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ mod 'simp-environment',
4545

4646
mod 'simp-gpgkeys',
4747
:git => 'https://github.com/simp/simp-gpgkeys',
48-
:tag => '3.1.5'
48+
:tag => '3.2.0'
4949

5050
mod 'simp-simp_selinux_policy',
5151
:git => 'https://github.com/simp/simp-selinux-policy',
@@ -335,7 +335,7 @@ mod 'simp-selinux',
335335

336336
mod 'simp-simp',
337337
:git => 'https://github.com/simp/pupmod-simp-simp',
338-
:tag => '4.16.5'
338+
:tag => '4.16.6'
339339

340340
mod 'simp-simpkv',
341341
:git => 'https://github.com/simp/pupmod-simp-simpkv',

build/distributions/CentOS/8Stream/x86_64/DVD/ks/dvd/auto.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ baseurl=file://${SIMP_REPO_DIR}/SIMP
328328
enabled=1
329329
gpgcheck=1
330330
gpgkey=file:///var/www/yum/SIMP/GPGKEYS/RPM-GPG-KEY-SIMP-6
331-
file:///var/www/yum/SIMP/GPGKEYS/RPM-GPG-KEY-SIMP
331+
file:///var/ww/yum/SIMP/GPGKEYS/RPM-GPG-KEY-SICURA-CE-RELEASE
332332
$flocal_gpg_simp_lines
333333

334334
[flocal-puppet]

build/distributions/CentOS/8Stream/x86_64/bolt_pulp3_config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ AppStream:
391391
- name: javapackages-filesystem # provides javapackages-filesystem for java-1.8.0-openjdk-headless MODULE: javapackages-runtime:201801
392392

393393
extras:
394-
- url: http://mirror.centos.org/centos/8-stream/extras/x86_64/os/
394+
url: http://mirror.centos.org/centos/8-stream/extras/x86_64/os/
395395
#url: https://download.simp-project.com/simp/yum/experimental/simp6/el/8/x86_64/extras/
396396
rpms:
397397
- name: centos-release-advanced-virtualization
@@ -424,7 +424,7 @@ extras:
424424
- name: centos-release-storage-common
425425
- name: centos-release-stream
426426
- name: centos-release-virt-common
427-
- name: centos-stream-repos
427+
#- name: centos-stream-repos # This package doesn't exist in the streams version of extras
428428
- name: elrepo-release
429429
- name: epel-next-release
430430

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
set default="0"
2+
3+
function load_video {
4+
insmod efi_gop
5+
insmod efi_uga
6+
insmod video_bochs
7+
insmod video_cirrus
8+
insmod all_video
9+
}
10+
11+
load_video
12+
set gfxpayload=keep
13+
insmod gzio
14+
insmod part_gpt
15+
insmod ext2
16+
17+
set timeout=-1
18+
19+
submenu 'SIMP images, FIPS enabled >' {
20+
menuentry 'SIMP, FIPS enabled, STIG partitioning, disk encrypted' {
21+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg simp_disk_crypt simp_install=auto
22+
initrdefi /images/pxeboot/initrd.img
23+
}
24+
menuentry 'SIMP, FIPS enabled, STIG partitioning' {
25+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg simp_install=auto
26+
initrdefi /images/pxeboot/initrd.img
27+
}
28+
menuentry 'SIMP, FIPS enabled, user-specified disk partitioning' {
29+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg simp_opt=prompt simp_install=auto
30+
initrdefi /images/pxeboot/initrd.img
31+
}
32+
}
33+
34+
submenu 'SIMP images, FIPS disabled >' {
35+
menuentry 'SIMP, FIPS disabled, STIG partitioning, disk encrypted' {
36+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg fips=0 simp_disk_crypt simp_install=auto
37+
initrdefi /images/pxeboot/initrd.img
38+
}
39+
menuentry 'SIMP, FIPS disabled, STIG partitioning' {
40+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg fips=0 simp_install=auto
41+
initrdefi /images/pxeboot/initrd.img
42+
}
43+
menuentry 'SIMP, FIPS disabled, user-specified disk partitioning' {
44+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/auto.cfg fips=0 simp_opt=prompt simp_install=auto
45+
initrdefi /images/pxeboot/initrd.img
46+
}
47+
}
48+
49+
submenu 'Minimal Linux images >' {
50+
menuentry 'Minimal Linux image, FIPS enabled, STIG partitioning, disk encryption' {
51+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/min.cfg simp_disk_crypt simp_install=auto
52+
initrdefi /images/pxeboot/initrd.img
53+
}
54+
menuentry 'Minimal Linux image, FIPS enabled, STIG partitioning' {
55+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/min.cfg simp_install=auto
56+
initrdefi /images/pxeboot/initrd.img
57+
}
58+
menuentry 'Minimal Linux image, FIPS disabled, STIG partitioning, disk encryption' {
59+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/min.cfg simp_disk_crypt fips=0 simp_install=auto
60+
initrdefi /images/pxeboot/initrd.img
61+
}
62+
menuentry 'Minimal Linux image, FIPS disabled, STIG partitioning' {
63+
linuxefi /images/pxeboot/vmlinuz ks=cdrom:/ks/dvd/min.cfg fips=0 simp_install=auto
64+
initrdefi /images/pxeboot/initrd.img
65+
}
66+
}
67+
68+
submenu 'Other Options >' {
69+
menuentry 'Rescue installed system' {
70+
linuxefi /images/pxeboot/vmlinuz rescue askmethod
71+
initrdefi /images/pxeboot/initrd.img
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+

3+
4+
- 0aNOTE:07 To disable FIPS, add 0afips=007 to any option.
5+
6+
- To auto-install SIMP, type 0asimp <ENTER>07.
7+
- This will erase your existing system!
8+
- You need at least 50GB of disk space for this to succeed.
9+
- Disk will be encrypted and partitioned to be STIG compliant.
10+
- Type 0asimp-nocrypt <ENTER>07 instead to disable encryption.
11+
12+
- To install SIMP with disk prompt, type 0asimp-prompt <ENTER>07.
13+
- This will erase your existing system!
14+
- This will allow you to specify the system disk partitioning.
15+
16+
- To auto-install a minimized system type 0alinux-min <ENTER>07.
17+
- This will erase your existing system!
18+
- You need at least 50GB of disk space for this to succeed.
19+
- Disk will be encrypted and partitioned to be STIG compliant.
20+
- Type 0alinux-min-nocrypt <ENTER>07 instead to disable encryption.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
default simp
2+
prompt 1
3+
display boot.msg
4+
label simp
5+
kernel vmlinuz
6+
append inst.ks=cdrom:/dev/cdrom:/ks/dvd/auto.cfg initrd=initrd.img simp_disk_crypt simp_install=auto
7+
label simp-nocrypt
8+
kernel vmlinuz
9+
append inst.ks=cdrom:/dev/cdrom:/ks/dvd/auto.cfg initrd=initrd.img simp_install=auto
10+
label simp-prompt
11+
kernel vmlinuz
12+
append inst.ks=cdrom:/dev/cdrom:/ks/dvd/auto.cfg initrd=initrd.img simp_opt=prompt simp_install=auto
13+
label linux-min
14+
kernel vmlinuz
15+
append inst.ks=cdrom:/dev/cdrom:/ks/dvd/min.cfg initrd=initrd.img simp_disk_crypt simp_install=auto
16+
label linux-min-nocrypt
17+
kernel vmlinuz
18+
append inst.ks=cdrom:/dev/cdrom:/ks/dvd/min.cfg initrd=initrd.img simp_install=auto
19+
label local
20+
localboot 0
21+
label memtest86
22+
kernel memtest
23+
append -
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
= Intro =
2+
3+
This directory has been set up as an example of how you can configure your
4+
kickstart directory.
5+
6+
It should suffice for most clients built from the default load, but you may
7+
extend this kickstart space as fits your needs.
8+
9+
It is suggested that you always start with the pupclient*.cfg files and only add
10+
additional diskdetect scripts to meet your space needs. If you extend the
11+
kickstart files, particularly the package lists, then future management of the
12+
systems may become overly complicated.
13+
14+
Remember, the premise of this system is that you start small and secure and you
15+
extend via Puppet to create your desired environment.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#!/bin/sh
2+
3+
DISK=""
4+
5+
for disk in \
6+
/sys/block/sd[a-z] \
7+
/sys/block/sd[a-z][a-z] \
8+
/sys/block/cciss!c[0-9]d[0-9] \
9+
/sys/block/cciss!c[0-9]d[0-9][0-9] \
10+
/sys/block/cciss!c[0-9][0-9]d[0-9] \
11+
/sys/block/cciss!c[0-9][0-9]d[0-9][0-9] \
12+
/sys/block/xvd[a-z] \
13+
/sys/block/xvd[a-z][a-z] \
14+
/sys/block/vd[a-z] \
15+
/sys/block/vd[a-z][a-z] \
16+
/sys/block/hd[a-z] \
17+
/sys/block/nvme[0-9]n[0-9] \
18+
;
19+
do
20+
[ -d "$disk" ] || continue
21+
22+
# Ignore removable and virtual devices.
23+
24+
if [ -f "$disk"/removable ]; then
25+
if read removable junk < "$disk"/removable; then
26+
[ "$removable" != "0" ] && continue
27+
fi
28+
fi
29+
30+
if [ -f "$disk"/device/vendor -a -f "$disk"/device/model ]; then
31+
if read vendor junk < "$disk"/device/vendor && \
32+
read model junk < "$disk"/device/model; then
33+
[ "$vendor" != "VMware" -a "$model" = "Virtual" ] && continue
34+
fi
35+
fi
36+
37+
# Found the first disk.
38+
39+
# Convert cciss!c0d0 to cciss/c0d0
40+
DISK="`basename $disk | sed 's@!@/@g'`"
41+
break
42+
done
43+
44+
touch /tmp/part-include
45+
46+
# To automatically decrypt your system, the cryptfile needs to be located in an
47+
# unencrypted portion of the system. This is *not* secure but does allow users
48+
# to go in later and change the password without needing to reformat their
49+
# systems.
50+
51+
# For EL6
52+
if [ ! -d /boot ]; then
53+
mkdir /boot
54+
fi
55+
56+
grep -q simp_disk_crypt /proc/cmdline || grep -q simp_crypt_disk /proc/cmdline
57+
encrypt=$?
58+
59+
if [ $encrypt -eq 0 ]; then
60+
cat /dev/random | LC_CTYPE=C tr -dc "[:alnum:]" | head -c 256 > /boot/disk_creds
61+
passphrase=`cat /boot/disk_creds`
62+
63+
echo $DISK > /boot/crypt_disk
64+
fi
65+
66+
# This parses out some command line options generally only used by the
67+
# DVD, but available to PXE clients as well.
68+
69+
simp_opt=`awk -F "simp_opt=" '{print $2}' /proc/cmdline | cut -f1 -d' '`
70+
71+
if [ "$simp_opt" == "prompt" ]; then
72+
# This is the recommended workaround for a RedHat bug (BZ#1954408) where
73+
# the installation program attempts to perform automatic partitioning, even
74+
# when you do not specify any partitioning commands in the kickstart file.
75+
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.4_release_notes/known-issues#known-issue_installer-and-image-creation
76+
# This will cause the "Installation Destination" icon to show an "Kickstart
77+
# insufficient" error, which, in turn, will force the user to partition the
78+
# disks manually.
79+
echo "reqpart" > /tmp/part-include
80+
else
81+
cat << EOF > /tmp/part-include
82+
clearpart --all --initlabel --drives=${DISK}
83+
part /boot --fstype=ext4 --size=1024 --ondisk ${DISK} --asprimary --fsoptions=nosuid,nodev
84+
part /boot/efi --fstype=efi --size=400 --ondisk ${DISK} --asprimary
85+
EOF
86+
87+
# In EL8 (8.2) the partitioning fails if --encrypted is used and the size=1.
88+
# The size was set to equal the sum of all the logical partitions (20G) to prevent this.
89+
# You can probably use a smaller size but we have not, at this time, determined how
90+
# small the initial size of the partion can to be to prevent the error.
91+
92+
if [ $encrypt -eq 0 ]; then
93+
echo "part pv.01 --size=20480 --grow --ondisk ${DISK} --encrypted --passphrase=${passphrase}" >> /tmp/part-include
94+
else
95+
echo "part pv.01 --size=1 --grow --ondisk ${DISK}" >> /tmp/part-include
96+
fi
97+
fi
98+
99+
if [ "$simp_opt" != "prompt" ]; then
100+
cat << EOF >> /tmp/part-include
101+
volgroup VolGroup00 pv.01
102+
logvol swap --fstype=swap --name=SwapVol --vgname=VolGroup00 --size=1024
103+
logvol / --fstype=ext4 --name=RootVol --vgname=VolGroup00 --size=10240 --fsoptions=iversion
104+
logvol /tmp --fstype=ext4 --name=TmpVol --vgname=VolGroup00 --size=2048 --fsoptions=nosuid,noexec,nodev
105+
logvol /home --fstype=ext4 --name=HomeVol --vgname=VolGroup00 --size=1024 --fsoptions=nosuid,noexec,nodev,iversion
106+
logvol /var --fstype=ext4 --name=VarVol --vgname=VolGroup00 --size=1024 --grow
107+
logvol /var/log --fstype=ext4 --name=VarLogVol --vgname=VolGroup00 --size=4096 --fsoptions=nosuid,noexec,nodev
108+
logvol /var/log/audit --fstype=ext4 --name=VarLogAuditVol --vgname=VolGroup00 --size=1024 --fsoptions=nosuid,noexec,nodev
109+
EOF
110+
fi

0 commit comments

Comments
 (0)