-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from sreboot/rocky
Add RockyLinux image
- Loading branch information
Showing
7 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ARG ROCKY_RELEASE | ||
FROM rockylinux:${ROCKY_RELEASE} | ||
COPY helpers /helpers | ||
ARG ROCKY_RELEASE=${ROCKY_RELEASE} | ||
RUN cd /helpers; sh build.sh; cd /; rm -rf helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/sh | ||
set -ex | ||
echo Installing RockyLinux $ROCKY_RELEASE | ||
dnf update -y | ||
dnf install -y --allowerasing \ | ||
cronie \ | ||
systemd-sysv \ | ||
vim \ | ||
binutils \ | ||
dialog \ | ||
diffutils \ | ||
iputils \ | ||
openssh-server \ | ||
openssh-clients \ | ||
passwd \ | ||
procps-ng \ | ||
rsyslog \ | ||
sudo \ | ||
curl \ | ||
less \ | ||
man-db \ | ||
bind-utils \ | ||
net-tools | ||
|
||
|
||
# disable services we do not need | ||
systemctl mask systemd-remount-fs.service | ||
systemctl mask systemd-resolved fstrim.timer fstrim | ||
systemctl mask e2scrub_reap e2scrub_all e2scrub_all.timer | ||
|
||
# disable systemd features not present in lx (e.g. cgroup support) | ||
for S in \ | ||
systemd-hostnamed systemd-localed systemd-timedated systemd-logind \ | ||
systemd-initctl systemd-journald | ||
do | ||
O=/etc/systemd/system/${S}.service.d | ||
mkdir -p $O | ||
cp override.conf ${O}/override.conf | ||
done | ||
|
||
# This service doesn't exist yet but systemd will happily create the /dev/null | ||
# mapping for it. It comes in with nfs-common and fails because lx doesn't know | ||
# about rpc_pipefs. NFSv4 still seems to mount without this service and | ||
# lx_lockd is still started. Let's hide it from the user so they see don't see | ||
# unecessary failed services. | ||
systemctl mask run-rpc_pipefs.mount | ||
|
||
# lx hosts file | ||
cp hosts /etc/hosts.lx | ||
|
||
# make sure we get fresh ssh keys on first boot | ||
# note that rocky uses the [email protected] to regenerate missing keys | ||
/bin/rm -f -v /etc/ssh/ssh_host_*_key* | ||
|
||
# hostfile fix | ||
cp create_hosts_file.service /etc/systemd/system | ||
systemctl enable create_hosts_file.service | ||
|
||
# remove .dockerenv file because lx is not a docker | ||
cp remove_dockerenv_file.service /etc/systemd/system | ||
systemctl enable remove_dockerenv_file.service | ||
|
||
# some smf helper folders | ||
mkdir -p /var/svc /var/db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Create a Hostfile | ||
After=network.target auditd.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/mv /etc/hosts.lx /etc/hosts | ||
ExecStart=/bin/sed -i s/HOSTNAME/%H/g /etc/hosts | ||
ExecStartPost=/bin/systemctl disable create_hosts_file.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
# last line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# host file | ||
127.0.0.1 localhost | ||
127.0.1.1 HOSTNAME | ||
# The following lines are desirable for IPv6 capable hosts | ||
::1 localhost ip6-localhost ip6-loopback | ||
ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Service] | ||
PrivateTmp=no | ||
PrivateDevices=no | ||
PrivateNetwork=no | ||
ProtectSystem=no | ||
NoNewPrivileges=no | ||
ProtectHome=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Remove dockerenv file | ||
After=network.target auditd.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/rm -f /.dockerenv | ||
ExecStartPost=/bin/systemctl disable remove_dockerenv_file.service | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
# last line |