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
diff --git a/debian/changelog b/debian/changelog
index 12c47d1..3dab9fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1livecd-rootfs (2.817) lunar; urgency=medium
2
3 * Skip oem-config setup in hooks if the oem user already exists.
4
5 -- William 'jawn-smith' Wilson <jawn-smith@ubuntu.com> Mon, 27 Mar 2023 09:30:08 -0400
6
1livecd-rootfs (2.816) lunar; urgency=medium7livecd-rootfs (2.816) lunar; urgency=medium
28
3 [ Chad Smith ]9 [ Chad Smith ]
diff --git a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
index 6dd49d8..cc3814e 100644
--- a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
+++ b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot
@@ -11,11 +11,12 @@ if [ "$IMAGEFORMAT" == "none" ]; then
11 touch /var/log/syslog11 touch /var/log/syslog
12 chown syslog:adm /var/log/syslog12 chown syslog:adm /var/log/syslog
1313
14 # Create the oem user account14 # Create the oem user account only if it doesn't already exist
15 /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem15 if ! id "oem" &>/dev/null; then
1616 /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem
17 /usr/sbin/oem-config-prepare --quiet17 /usr/sbin/oem-config-prepare --quiet
18 touch "/var/lib/oem-config/run"18 touch "/var/lib/oem-config/run"
19 fi
1920
20 # Update the fstab to include the "discard" option, and21 # Update the fstab to include the "discard" option, and
21 # "x-systemd.growfs" to ensure the root partition is expanded on first22 # "x-systemd.growfs" to ensure the root partition is expanded on first

Subscribers

People subscribed via source and target branches