Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
feat: lightdm and groupinstalls for image
Browse files Browse the repository at this point in the history
  • Loading branch information
tulilirockz committed Jun 5, 2023
1 parent 1bd880f commit d2e70da
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
25 changes: 23 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder

COPY etc /etc
COPY usr /usr
RUN chmod +x /etc/ublue-lightdm-workaround.sh

ARG IMAGE_NAME="${IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
Expand All @@ -17,11 +19,30 @@ ADD build.sh /tmp/build.sh
RUN /tmp/build.sh && \
pip install --prefix=/usr yafti && \
rm -rf /tmp/* /var/* && \
systemctl enable gdm && \
systemctl enable lightdm && \
systemctl enable ublue-lightdm-workaround && \
ostree container commit && \
mkdir -p /var/tmp && \
chmod -R 1777 /var/tmp

COPY config/touchegg.conf /usr/share/touchegg
FROM fedora:38 as deepinList

# Try to get a list of unversioned packages
RUN dnf group info \
deepin-desktop \
deepin-desktop-environment \
deepin-applications \
| awk '/^ /' \
| xargs dnf group info -v 2>/dev/null \
| awk '($2 == "fedora" || $2 == "updates" || $2 == "@System") && ($1 ~ /noarch/ || $1 ~ /x86_64/){print $1}' \
| awk 'NF -= 2{$0=$0; print}' FS='-' OFS='-' \
| tee /deepin.txt

FROM builder

COPY --from=deepinList /deepin.txt /tmp/deepin.txt

RUN xargs -a /tmp/deepin.txt rpm-ostree install \
&& rm -rf /var/*

RUN ostree container commit
6 changes: 6 additions & 0 deletions etc/profile.d/cinnamon-firstboot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if test "$(id -u)" -gt "0" && test -d "$HOME"; then
if test ! -e "$HOME"/.config/autostart/cinnamon-firstboot.desktop; then
mkdir -p "$HOME"/.config/autostart
cp -f /usr/share/ublue-os/firstboot/cinnamon-firstboot.desktop "$HOME"/.config/autostart
fi
fi
16 changes: 16 additions & 0 deletions etc/systemd/system/ublue-lightdm-workaround.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# LightDM install from a container is currently bugged.
# https://github.com/coreos/rpm-ostree/issues/4369
# https://github.com/fedora-silverblue/issue-tracker/issues/452
# This workaround creates the user before LightDM runs.

[Unit]
Description=Work around broken LightDM install
Before=lightdm.service

[Service]
Type=oneshot
ExecStart=/etc/ublue-lightdm-workaround.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
11 changes: 11 additions & 0 deletions etc/ublue-lightdm-workaround.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [ ! -d /var/cache/lightdm ]; then mkdir /var/cache/lightdm; fi
if [ ! -d /var/log/lightdm ]; then mkdir /var/log/lightdm; fi
if [ ! -d /var/lib/lightdm ]; then mkdir /var/lib/lightdm; fi
if [ ! -d /var/lib/lightdm-data ]; then mkdir /var/lib/lightdm-data; fi

getent group lightdm >/dev/null || groupadd -r lightdm
getent passwd lightdm >/dev/null || useradd -g lightdm -M -d /var/lib/lightdm -s /sbin/nologin -r lightdm

systemctl set-default graphical.target
2 changes: 1 addition & 1 deletion packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"all": {
"include": {
"all": [
"gdm",
"lightdm",
"python3-pip",
"deepin-control-center",
"deepin-desktop",
Expand Down

0 comments on commit d2e70da

Please sign in to comment.