Skip to content

Commit

Permalink
Update lorax build for pkexec command
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkankovsky committed Oct 3, 2024
1 parent 9e0f72a commit fd737f0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions dockerfile/anaconda-iso-creator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ RUN set -ex; \
COPY ["lorax-build", "/"]
COPY ["lorax-build-webui", "/"]
COPY ["adjust-templates-for-webui.patch", "/"]
COPY ["pkexec-command.patch", "/"]

RUN mkdir /lorax /anaconda-rpms /images

Expand Down
4 changes: 4 additions & 0 deletions dockerfile/anaconda-iso-creator/lorax-build
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ mkdir -p $REPO_DIR
cp -a $INPUT_RPMS/* $REPO_DIR || echo "RPM files can't be copied!" # We could just do the build with official repositories only
createrepo_c $REPO_DIR

cp -r /usr/share/lorax/templates.d/ /lorax/
patch -p2 -i /pkexec-command.patch

# build boot.iso with our rpms
. /etc/os-release
# The download.fedoraproject.org automatic redirector often selects download-ib01.f.o. for GitHub's cloud, which is too unreliable; use a mirror
# The --volid argument can cause different network interface naming: https://github.com/rhinstaller/kickstart-tests/issues/448
lorax -p Fedora -v "$VERSION_ID" -r "$VERSION_ID" \
--volid Fedora-S-dvd-x86_64-rawh \
--sharedir ./templates.d/99-generic/ \
-s http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/ \
-s file://$REPO_DIR/ \
"$@" \
Expand Down
4 changes: 4 additions & 0 deletions dockerfile/anaconda-iso-creator/lorax-build.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ mkdir -p $REPO_DIR
cp -a $INPUT_RPMS/* $REPO_DIR || echo "RPM files can't be copied!" # We could just do the build with official repositories only
createrepo_c $REPO_DIR

cp -r /usr/share/lorax/templates.d/ /lorax/
patch -p2 -i /pkexec-command.patch

# build boot.iso with our rpms
. /etc/os-release
# The download.fedoraproject.org automatic redirector often selects download-ib01.f.o. for GitHub's cloud, which is too unreliable; use a mirror
Expand All @@ -37,6 +40,7 @@ createrepo_c $REPO_DIR
lorax -p Fedora -v "$VERSION_ID" -r "$VERSION_ID" \
{% if distro_release == "rawhide" %}
--volid Fedora-S-dvd-x86_64-rawh \
--sharedir ./templates.d/99-generic/ \
{% else %}
--volid Fedora-S-dvd-x86_64-f{$ distro_release $} \
{% endif %}
Expand Down
39 changes: 39 additions & 0 deletions dockerfile/anaconda-iso-creator/pkexec-command.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From ed493f55462a0a8528f554e1f884bfa77f700520 Mon Sep 17 00:00:00 2001
From: Adam Kankovsky <[email protected]>
Date: Thu, 3 Oct 2024 09:52:26 +0200
Subject: [PATCH] Update cleanup for pkexec command

---
share/templates.d/99-generic/runtime-cleanup.tmpl | 1 -
share/templates.d/99-generic/runtime-postinstall.tmpl | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/share/templates.d/99-generic/runtime-cleanup.tmpl b/share/templates.d/99-generic/runtime-cleanup.tmpl
index 12c45189..200e3bed 100644
--- a/share/templates.d/99-generic/runtime-cleanup.tmpl
+++ b/share/templates.d/99-generic/runtime-cleanup.tmpl
@@ -291,7 +291,6 @@ removefrom openssh-clients /usr/libexec/*
removefrom openssh-server /etc/ssh/* /usr/libexec/openssh/sftp-server
removefrom pam /usr/share/locale/*
removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
-removefrom polkit /usr/bin/*
removefrom popt /usr/share/locale/*
removefrom procps-ng /usr/bin/free /usr/bin/pgrep /usr/bin/pkill
removefrom procps-ng /usr/bin/pmap /usr/bin/pwdx /usr/bin/skill /usr/bin/slabtop
diff --git a/share/templates.d/99-generic/runtime-postinstall.tmpl b/share/templates.d/99-generic/runtime-postinstall.tmpl
index 93069746..d5193c9b 100644
--- a/share/templates.d/99-generic/runtime-postinstall.tmpl
+++ b/share/templates.d/99-generic/runtime-postinstall.tmpl
@@ -85,6 +85,9 @@ symlink /etc/systemd/system/inst.rngd.service etc/systemd/system/basic.target.wa
## set up "install" user account
append etc/passwd "install:x:0:0:root:/root:/usr/libexec/anaconda/run-anaconda"
append etc/shadow "install::14438:0:99999:7:::"
+## set up "install-user" user account
+append etc/passwd "install-user:x:1001:1001::/home/install-user:/usr/bin/bash"
+append etc/shadow "install-user::14438:0:99999:7:::"
## remove root password
replace "root:\*:" "root::" etc/shadow

--
2.46.2

0 comments on commit fd737f0

Please sign in to comment.