Merge ~laney/ubiquity:oem-config-nm into ubiquity:master

Proposed by Iain Lane
Status: Rejected
Rejected by: Iain Lane
Proposed branch: ~laney/ubiquity:oem-config-nm
Merge into: ubiquity:master
Diff against target: 31 lines (+9/-0)
2 files modified
bin/oem-config-firstboot (+1/-0)
bin/oem-config-prepare (+8/-0)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Pending
Ubuntu Installer Team Pending
Review via email: mp+392142@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

You could probably do this in another way, by statically shipping the symlink or statically requiring NM. I felt like it was better to this dynamically if the 'underlying' system wants NM, but I don't feel very strongly about it.

Unmerged commits

90b18e2... by Iain Lane

oem-config-{prepare,firstboot}: Set up NetworkManager if it is already used

We change the default target from graphical.target to oem-config.target.
That means things from the old default transaction - including
multi-user.target's depends like NM - aren't automatically included any
more.

Most things we don't need, since this is a very minimal session, but NM
is useful when running oem-config for geoip and also potentially for
preseeding. Let's make sure it gets started.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/oem-config-firstboot b/bin/oem-config-firstboot
2index bb8aba7..7ce1520 100755
3--- a/bin/oem-config-firstboot
4+++ b/bin/oem-config-firstboot
5@@ -91,6 +91,7 @@ for try in $(seq 1 $TRY); do
6 /bin/systemctl disable oem-config.service || true
7 /bin/systemctl disable oem-config.target || true
8 rm -f /lib/systemd/system/oem-config.* || true
9+ rm -f /etc/systemd/system/oem-config.target.wants/ || true
10 RET="$(echo GET oem-config/reboot | debconf-communicate)" || true
11 if [ "${RET#* }" = true ]; then
12 /usr/bin/grub-editenv - unset recordfail || true
13diff --git a/bin/oem-config-prepare b/bin/oem-config-prepare
14index fba5680..c866e67 100755
15--- a/bin/oem-config-prepare
16+++ b/bin/oem-config-prepare
17@@ -33,6 +33,14 @@ if [ "$(id -u)" = 0 ]; then
18 /bin/systemctl enable oem-config.service
19 /bin/systemctl enable oem-config.target
20 /bin/systemctl set-default oem-config.target
21+ # We just changed the default target from graphical.target, but we
22+ # still want NM.
23+ for unit in /etc/systemd/system/multi-user.target.wants/NetworkManager*; do
24+ if [ -L "${unit}" ]; then
25+ mkdir -p /etc/systemd/system/oem-config.target.wants/
26+ cp -a "${unit}" /etc/systemd/system/oem-config.target.wants/
27+ fi
28+ done
29 else
30 pkexec "$0" ${quiet:+--quiet} "$@"
31 exit 0

Subscribers

People subscribed via source and target branches