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.
This commit is contained in:
Adam Williamson 2016-06-23 16:49:40 -07:00
parent f925eaa63d
commit efd98f218d
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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