From efd98f218dada296f133b24b1c0c9ab2010d8556 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 23 Jun 2016 16:49:40 -0700 Subject: [PATCH] deal with #1349586 and #1349664 when building desktop images A couple of bugs showed up with the graphical desktop images (Workstation and KDE) for Fedora 24. Setting graphical.target as the default by doing the symlink during image build, in the virt-builder appliance, leaves it incorrectly labelled; in F24 this seems to stop systemd from reading it, so it falls back to rescue.target when createhdds boots the image to try and get the selinux autorelabel done, and relabelling never happens. So instead, we change the default target with a firstboot command (which will get run when createhdds boots to do the relabel, so by the time openQA boots the image, the target will be changed). Also, a tricky bug in fedora-release has the ultimate effect that if you start with a minimal install then install a desktop environment on top - like we effectively do for these images - the login manager service for the desktop does not get enabled, as it should. So we work around that by explicitly enabling the appropriate service with (again) a firstboot command. Pushing without review as garretraziel is out this week and we need these fixes - without them disk image generation in prod is broken, which breaks quite a lot of tests. --- desktop.commands | 6 +++++- kde.commands | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/desktop.commands b/desktop.commands index 17ccdd9..dda4647 100644 --- a/desktop.commands +++ b/desktop.commands @@ -2,6 +2,10 @@ root-password password:weakpassword update selinux-relabel install @workstation-product-environment -link /usr/lib/systemd/system/graphical.target:/etc/systemd/system/default.target firstboot-command useradd -m -p '' test firstboot-command echo 'test:weakpassword' | chpasswd +# we do this on firstboot (i.e. when createhdds boots to do the selinux +# relabel) so the selinux label on the symlink is correct; see RHBZ #1349586 +firstboot-command systemctl set-default graphical.target +# workaround RHBZ #1349664 +firstboot-command systemctl enable gdm.service diff --git a/kde.commands b/kde.commands index b586b10..0ce6392 100644 --- a/kde.commands +++ b/kde.commands @@ -2,8 +2,12 @@ root-password password:weakpassword update selinux-relabel install @kde-desktop-environment -link /usr/lib/systemd/system/graphical.target:/etc/systemd/system/default.target delete /etc/systemd/system/multi-user.target.wants/initial-setup-text.service delete /etc/systemd/system/graphical.target.wants/initial-setup-graphical.service firstboot-command useradd -m -p '' test firstboot-command echo 'test:weakpassword' | chpasswd +# we do this on firstboot (i.e. when createhdds boots to do the selinux +# relabel) so the selinux label on the symlink is correct; see RHBZ #1349586 +firstboot-command systemctl set-default graphical.target +# workaround RHBZ #1349664 +firstboot-command systemctl enable sddm.service