Repository navigation
Expand file tree
/
Copy pathstream10-installer
More file actions
97 lines (81 loc) · 3.46 KB
/
Copy pathstream10-installer
File metadata and controls
97 lines (81 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# vim: set ft=dockerfile:
# -*- mode: dockerfile-mode -*-
# code: language=dockerfile insertSpaces=true tabSize=4
FROM quay.io/centos-bootc/centos-bootc:stream10
ARG TARGETARCH
# NOTE: bootc containers are shipped with empty /boot. While these images are created,
# /boot is moved to /usr/lib/bootupd/updates by bootupd. When bootc install is
# run to create a disk image, it calls bootupd that unpacks /usr/lib/bootupd/updates
# back into /boot/efi.
#
# For the installer ISO image, we need the /boot to be populated, to fulfill the
# container-native ISO contract (https://github.com/ondrejbudai/bootc-isos#container-native-iso-contract-v010).
#
# Reinstall shim-x64 to ensure that required files are not missing from /boot/efi/EFI
#
# This will have to change later due to https://fedoraproject.org/wiki/Changes/BootLoaderUpdatesPhase1
RUN dnf reinstall -y \
shim-x64 \
&& dnf clean all
# Packages needed for Anaconda; and build dependencies
RUN dnf install -y \
anaconda \
anaconda-install-img-deps \
anaconda-dracut \
dracut-config-generic \
dracut-network \
net-tools \
grub2-efi-x64-cdboot \
plymouth \
default-fonts-core-sans \
default-fonts-other-sans \
google-noto-sans-cjk-fonts \
xorriso \
squashfs-tools \
fuse-overlayfs \
&& dnf clean all
# NOTE: This stopped working on the latest c10s images, because nothing is installing to /usr/lib/efi/*/*/EFI
# shim-x64 is still installing to /boot/efi as of shim-x64-16.1-1.el10.x86_64. See the section above for more details.
# RUN mkdir -p /boot/efi \
# && cp -rva /usr/lib/efi/*/*/EFI /boot/efi
RUN mkdir -p /usr/lib/image-builder/bootc
COPY <<EOT /usr/lib/image-builder/bootc/iso.yaml
label: "CentOS-Stream-10-bootc-Installer"
grub2:
entries:
- name: "Install CentOS Stream 10 (bootc)"
linux: "/images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS-Stream-10-bootc-Installer console=tty0 inst.graphical selinux=0 rhgb quiet"
initrd: "/images/pxeboot/initrd.img"
EOT
COPY <<EOT /usr/share/anaconda/interactive-defaults.ks
bootc --source-imgref containers-storage:quay.io/redhat-services-prod/insights-management-tenant/image-builder-bootc-foundry/stream10-qcow2:latest
EOT
RUN echo "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda" >> /etc/passwd && \
echo "install::14438:0:99999:7:::" >> /etc/shadow && \
passwd -d root
RUN mv /usr/share/anaconda/list-harddrives-stub /usr/bin/list-harddrives && \
mv /etc/yum.repos.d /etc/anaconda.repos.d && \
ln -s /lib/systemd/system/anaconda.target /etc/systemd/system/default.target && \
rm -v /usr/lib/systemd/system-generators/systemd-gpt-auto-generator
RUN rm /usr/lib/systemd/system/autovt@.service \
&& ln -s /usr/lib/systemd/system/anaconda-shell@.service /usr/lib/systemd/system/autovt@.service
RUN mkdir /usr/lib/systemd/logind.conf.d
COPY <<EOT /usr/lib/systemd/logind.conf.d/anaconda-shell.conf
[Login]
ReserveVT=2
EOT
RUN kernel=$(kernel-install list --json pretty | jq -r '.[] | select(.has_kernel == true) | .version') && \
DRACUT_NO_XATTR=1 dracut --force -v --zstd --reproducible --no-hostonly \
--add "anaconda" \
--add "lvm" \
"/usr/lib/modules/${kernel}/initramfs.img" "${kernel}"
RUN mkdir /etc/systemd/user/pipewire.service.d/
COPY <<EOT /etc/systemd/user/pipewire.service.d/allowroot.conf
[Unit]
ConditionUser=
EOT
RUN mkdir /etc/systemd/user/pipewire.socket.d/
COPY <<EOT /etc/systemd/user/pipewire.socket.d/allowroot.conf
[Unit]
ConditionUser=
EOT