Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT MERGE: Prefer https://github.com/rhinstaller/anaconda/pull/5401/ #5969

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions data/liveinst/liveinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@

BACKEND_READY_FLAG=/run/anaconda/backend_ready

WAYLAND_DISPLAY_SOCKET=/tmp/anaconda-wldisplay

# Detect and save the wayland socket before re-exec
if [ -n "$WAYLAND_DISPLAY" ]; then
if [ -e "$WAYLAND_DISPLAY_SOCKET" ]; then
rm -f "${WAYLAND_DISPLAY_SOCKET}"
fi
touch "${WAYLAND_DISPLAY_SOCKET}"
echo "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" > ${WAYLAND_DISPLAY_SOCKET}
fi

# The command needs to be run with root privileges, so if it was started
# unprivileged, restart running as root.
if [ "$(id -u)" -ne 0 ]; then
xhost +si:localuser:root
if [ -z "$WAYLAND_DISPLAY" ]; then
xhost +si:localuser:root
fi
pkexec "$0" "$@"
exit $?
fi
Expand All @@ -38,6 +51,19 @@ if [ -n "${PKEXEC_UID}" ]; then
done
fi

# pkexec clears WAYLAND_DISPLAY from environment
if [ -z "$WAYLAND_DISPLAY" ] && [ -e "$WAYLAND_DISPLAY_SOCKET" ]; then
WAYLAND_DISPLAY=$(cat "${WAYLAND_DISPLAY_SOCKET}")
export WAYLAND_DISPLAY
fi

# use the correct home and config directories for system settings
PKEXEC_USER=$(id -un "${PKEXEC_UID}")
HOME=$(bash -c "cd ~${PKEXEC_USER} && pwd")
export HOME
XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CONFIG_HOME

# Allow running another command in the place of anaconda, but in this same
# environment. This allows storage testing to make use of all the module
# loading and lvm control in this file, too.
Expand Down Expand Up @@ -175,8 +201,10 @@ start_anaconda() {
$ANACONDA "$@"
}

# Force the X11 backend since sudo and wayland do not mix
export GDK_BACKEND=x11
# If no wayland socket is set, force x11 so that it loads correctly
if [ -z "$WAYLAND_DISPLAY" ]; then
export GDK_BACKEND=x11
fi

if [ -x /usr/bin/udisks ]; then
/usr/bin/udisks --inhibit -- start_anaconda "$@"
Expand Down
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 ["adjust-templates-for-weston.patch", "/"]

RUN mkdir /lorax /anaconda-rpms /images

Expand Down
56 changes: 56 additions & 0 deletions dockerfile/anaconda-iso-creator/adjust-templates-for-weston.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From 3b6fcfc755ee9b2a5b4de7965ee2e3fc41045379 Mon Sep 17 00:00:00 2001
From: Neal Gompa <[email protected]>
Date: Thu, 18 Jan 2024 11:59:00 -0500
Subject: [PATCH] templates.d/99-generic/runtime-cleanup: Do not purge sound
packages

These cause the build to fail when adding Weston to the boot.iso.
---
share/templates.d/99-generic/runtime-cleanup.tmpl | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/share/templates.d/99-generic/runtime-cleanup.tmpl b/share/templates.d/99-generic/runtime-cleanup.tmpl
index aad31f77..e4148b7c 100644
--- a/share/templates.d/99-generic/runtime-cleanup.tmpl
+++ b/share/templates.d/99-generic/runtime-cleanup.tmpl
@@ -9,8 +9,6 @@ remove usr/share/i18n
## perl needed for powerpc-utils
## perl is needed by /usr/bin/rxe_cfg from libibverbs

-## no sound support, thanks
-removepkg flac-libs libsndfile pipewire pulseaudio* rtkit sound-theme-freedesktop wireplumber*
## we don't create new initramfs/bootloader conf inside anaconda
## (that happens inside the target system after we install dracut/grubby)
removepkg dracut-network grubby anaconda-dracut
@@ -52,7 +50,6 @@ removepkg mtools glibc-gconv-extra

## various other things we remove to save space
removepkg diffutils file
-removepkg libasyncns
removepkg lvm2-libs
removepkg mobile-broadband-provider-info
removepkg rmt rpcbind squashfs-tools
@@ -196,7 +193,6 @@ removefrom libidn2 /usr/share/locale/*
removefrom libnotify /usr/bin/*
removefrom libsemanage /etc/selinux/*
removefrom libstdc++ /usr/share/*
-removefrom libvorbis /usr/${libdir}/libvorbisenc.*
removefrom libxml2 /usr/bin/*
removefrom linux-firmware /usr/lib/firmware/dvb*
removefrom linux-firmware /usr/lib/firmware/*_12mhz*
@@ -365,11 +361,7 @@ removefrom gstreamer1-plugins-base --allbut \
removepkg geoclue2

## And remove the packages that those extra libraries pulled in
-removepkg cdparanoia-libs opus libtheora libvisual flac-libs gsm avahi-glib avahi-libs \
- ModemManager-glib
-
-## metacity requires libvorbis and libvorbisfile, but enc/dec are no longer needed
-removefrom libvorbis --allbut /usr/${libdir}/libvorbisfile.* /usr/${libdir}/libvorbis.*
+removepkg cdparanoia-libs libvisual avahi-glib avahi-libs ModemManager-glib

## Remove build-id links, they are used with debuginfo
remove /usr/lib/.build-id
--
2.43.0

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 /adjust-templates-for-weston.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 /adjust-templates-for-weston.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 @@ -40,6 +43,7 @@ lorax -p Fedora -v "$VERSION_ID" -r "$VERSION_ID" \
{% else %}
--volid Fedora-S-dvd-x86_64-f{$ distro_release $} \
{% endif %}
--sharedir ./templates.d/99-generic/ \
-s http://dl.fedoraproject.org/pub/fedora/linux/development/{$ distro_release $}/Everything/x86_64/os/ \
{% elif distro_name == "rhel" and distro_release == 10 %}
MAJOR_VERSION=${VERSION_ID%%.*}
Expand Down
Loading