Merge ~jawn-smith/ubuntu/+source/livecd-rootfs:oem-user-check into ubuntu/+source/livecd-rootfs:ubuntu/devel

Proposed by William Wilson
Status: Needs review
Proposed branch: ~jawn-smith/ubuntu/+source/livecd-rootfs:oem-user-check
Merge into: ubuntu/+source/livecd-rootfs:ubuntu/devel
Diff against target: 36 lines (+12/-5)
2 files modified
debian/changelog (+6/-0)
live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot (+6/-5)
Reviewer Review Type Date Requested Status
Łukasz Zemczak (community) Approve
Dave Jones (community) Approve
git-ubuntu import Pending
Review via email: mp+439740@code.launchpad.net

Description of the change

We are making efforts to move some of the livecd-rootfs hook logic to packages such as ubuntu-settings. I have staged a change to ubuntu-settings to set up the oem-config user as a postinst for ubuntu-raspi-settings-desktop. I want to avoid an issue where both livecd-rootfs and ubuntu-raspi-settings desktop both try to do this setup, so have added some logic here to only run the oem-config setup steps if the oem user does not already exist.

To post a comment you must log in.
Revision history for this message
Dave Jones (waveform) wrote :

Looks reasonable to me in the context of the proposed ubuntu-raspi-settings-desktop changes [1]. We *could* remove the lines under the assumption that the postinst will take care of them but that potentially breaks other pre-installed desktop images (I'm not sure there are any official ones yet, but there might be so this is the safer option).

Also, better to stick hacks like this in the pile-of-hacks-known-as-livecd-rootfs than anywhere else under the assumption that many of them will disappear in a puff of ubuntu-image-flavoured-smoke in the coming cycle.

[1]: https://dpaste.com/CX2JGNYGK

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Looking good!

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Actually, wrong MP target! We have a dedicated livecd-rootfs repo: https://code.launchpad.net/livecd-rootfs

Unmerged commits

bfc687e... by William Wilson

Skip oem-config setup if oem user already exists

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 12c47d1..3dab9fa 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+livecd-rootfs (2.817) lunar; urgency=medium
7+
8+ * Skip oem-config setup in hooks if the oem user already exists.
9+
10+ -- William 'jawn-smith' Wilson <jawn-smith@ubuntu.com> Mon, 27 Mar 2023 09:30:08 -0400
11+
12 livecd-rootfs (2.816) lunar; urgency=medium
13
14 [ Chad Smith ]
15diff --git a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
16index 6dd49d8..cc3814e 100644
17--- a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
18+++ b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
19@@ -11,11 +11,12 @@ if [ "$IMAGEFORMAT" == "none" ]; then
20 touch /var/log/syslog
21 chown syslog:adm /var/log/syslog
22
23- # Create the oem user account
24- /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem
25-
26- /usr/sbin/oem-config-prepare --quiet
27- touch "/var/lib/oem-config/run"
28+ # Create the oem user account only if it doesn't already exist
29+ if ! id "oem" &>/dev/null; then
30+ /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem
31+ /usr/sbin/oem-config-prepare --quiet
32+ touch "/var/lib/oem-config/run"
33+ fi
34
35 # Update the fstab to include the "discard" option, and
36 # "x-systemd.growfs" to ensure the root partition is expanded on first

Subscribers

People subscribed via source and target branches