Merge ~xnox/ubuntu/+source/casper:clean-shutdown into ubuntu/+source/casper:ubuntu/devel

Proposed by Dimitri John Ledkov
Status: Work in progress
Proposed branch: ~xnox/ubuntu/+source/casper:clean-shutdown
Merge into: ubuntu/+source/casper:ubuntu/devel
Diff against target: 90 lines (+44/-18)
4 files modified
debian/casper.install (+1/-0)
debian/changelog (+7/-0)
dev/null (+0/-18)
system/cdrom.mount (+36/-0)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov (community) Abstain
Ubuntu Desktop Pending
git-ubuntu developers Pending
Review via email: mp+373690@code.launchpad.net

Commit message

Pacify systemd about cdrom.mount on boot, and order it correctly to be the last one on shutdown.

# casper-stop, sometimes, does lazy unmount of /cdrom, and systemd
# doesn't like active, yet masked units. Instead of /dev/null'ing
# cdrom.mount let's define the behaviour we want.

# On boot, systemd complains that cdrom.mount exists, yet is bound to
# dev-sr0.device which udev didn't yet "plug". This trips up systemd
# to go into verbose mode with messages. All of which is a lie, given
# that initrd mounted /cdrom, which later after udev-coldplug systemd
# "catches up" with. Declate DefaultDependencies=no to prevent this
# nonesence (i.e. implicit cdrom.mount BindsTo=$What.device)

# Also, we lie about What=, as it could be anything, but systemd
# demands to specify something. Thank-fully systemd will not try
# mounting /dev/sr0 ontop of otherwise active cdrom.mount.

# Becuase of DefaultDependenices=no readd stanzas to say that /cdrom
# should be unmounted on shutdown, but only after / is unmounted.

# Given that things might be mounted from on-top of /cdrom, specify
# LazyUnmount=yes.

# Note, due https://github.com/systemd/systemd/issues/8587 we specify
# a full cdrom.mount unit, rather than a .d drop-in, as /cdrom is not
# declared in fstab or via a unit

To post a comment you must log in.
696164e... by Dimitri John Ledkov

typpo

Revision history for this message
Dimitri John Ledkov (xnox) :
review: Abstain
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This thing was under investigation by the desktop team to fix ISO boot & shutdown, cleanly with all the layers.

I don't know if we still need this.

Desktop team to confirm if we have flickerless boot & shutdown of the Ubuntu Desktop ISO without any delays or scary messages that we are failing to unmount something.

Unmerged commits

696164e... by Dimitri John Ledkov

typpo

ba8cd06... by Dimitri John Ledkov

Pacify systemd about cdrom.mount on boot, and order it correctly to be the last one on shutdown.

9342ab5... by Dimitri John Ledkov

Better

aa51ff5... by Dimitri John Ledkov

wip

dc4d5ed... by Dimitri John Ledkov

Import patches-unapplied version 1.422 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: d19e2ccd6c2f2621c2d963d26cbf50bef3e6452f

New changelog entries:
  * Add support for url=protocol://path/to/installer.iso netboot
    option. Using this, one can netboot and complete installations using
    kernel and initrd from the new Ubuntu Server Installer using `ip=dhcp
    url=http://..../ubuntu-19.10-live-server-arch.iso' cmdline paratemers.
    This is not specific to Server installer, and should work for Ubuntu
    Desktop images too. Using this patch, successfully completed netboot
    installation with dhcp networking over vlan on a POWER9 machine.

d19e2cc... by Dimitri John Ledkov

Import patches-unapplied version 1.421 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: f6c5b91cca39fae2cf936f65b9c22c4ddd24a47a

New changelog entries:
  * Drop empty directory (doesn't track well in git)
  * Use debian/casper.dirs to install conf.d

f6c5b91... by Dimitri John Ledkov

Import patches-unapplied version 1.420 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: 00adb03acba4e67ace46ff2e4dad9e02474eb617

New changelog entries:
  * Add dependency on finalrd for reliable live-session shutdown. Casper
    setup live systems do have layering violations (/ actually depends on
    /cdrom) and it appears that (although masked) the system manages to
    rip it out, resulting in filesystem errors preventing completing the
    shutdown. That's where pivot to finalrd comes in, to save the day and
    blast the running system into oblivion and complete the shutdown. LP:
    #1840122

00adb03... by Adam Conrad

Import patches-unapplied version 1.419 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: a95d97936ec7b066b56092c1ced6212e3e7e001d

New changelog entries:
  * scripts/casper: Fix shell syntax error introduced in the 1.417 upload.

a95d979... by Adam Conrad

Import patches-unapplied version 1.418 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: 06c1c7e89602361c3e825addd91de1707b209b5f

New changelog entries:
  * scripts/casper-helpers: Reintroduce try_mount() function, which was in
    use by (at least) VMWare in a custom installer scenario (LP: #1845535)
  * Persist crash reports as well as logs by default.

06c1c7e... by Michael Hudson-Doyle

Import patches-unapplied version 1.416 to ubuntu/eoan-proposed

Imported using git-ubuntu import.

Changelog parent: 2979afca5541784096098cef72db9ea732e4d2b9

New changelog entries:
  * Change the automatic log persistence to store the logs in the 'log'
    directory of the casper-rw filesystem.
  * When using full live session persistence, ignore a 'log' directory in the
    casper-rw filesystem, otherwise booting without and then with full
    persistence breaks.
    - Possibly the whole block of code scanning the casper-rw filesystem
      before using it should be deleted, but one thing at a time.
  * Add autopkgtests for various persistence scenarios, including the above.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/casper.install b/debian/casper.install
index 30256d2..858cf41 100644
--- a/debian/casper.install
+++ b/debian/casper.install
@@ -12,3 +12,4 @@ scripts usr/share/initramfs-tools
12conf-hooks.d usr/share/initramfs-tools12conf-hooks.d usr/share/initramfs-tools
13casper-md5check/casper-md5check usr/lib/casper13casper-md5check/casper-md5check usr/lib/casper
14casper.conf etc14casper.conf etc
15systemd/*.service usr/lib/systemd/system
diff --git a/debian/changelog b/debian/changelog
index 3db1d94..673359a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1casper (1.423) UNRELEASED; urgency=medium
2
3 * Pacify systemd about cdrom.mount on boot, and order it correctly to be
4 the last one on shutdown.
5
6 -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 04 Oct 2019 22:28:55 +0100
7
1casper (1.422) eoan; urgency=medium8casper (1.422) eoan; urgency=medium
29
3 * Add support for url=protocol://path/to/installer.iso netboot10 * Add support for url=protocol://path/to/installer.iso netboot
diff --git a/scripts/casper-bottom/25disable_cdrom.mount b/scripts/casper-bottom/25disable_cdrom.mount
4deleted file mode 10075511deleted file mode 100755
index c02f4cd..0000000
--- a/scripts/casper-bottom/25disable_cdrom.mount
+++ /dev/null
@@ -1,18 +0,0 @@
1#!/bin/sh
2
3PREREQ=""
4
5prereqs()
6{
7 echo "$PREREQ"
8}
9
10case $1 in
11# get pre-requisites
12prereqs)
13 prereqs
14 exit 0
15 ;;
16esac
17
18ln -s /dev/null /root/lib/systemd/system/cdrom.mount
diff --git a/system/cdrom.mount b/system/cdrom.mount
19new file mode 1006440new file mode 100644
index 0000000..236c6cc
--- /dev/null
+++ b/system/cdrom.mount
@@ -0,0 +1,36 @@
1# casper-stop, sometimes, does lazy unmount of /cdrom, and systemd
2# doesn't like active, yet masked units. Instead of /dev/null'ing
3# cdrom.mount let's define the behaviour we want.
4
5# On boot, systemd complains that cdrom.mount exists, yet is bound to
6# dev-sr0.device which udev didn't yet "plug". This trips up systemd
7# to go into verbose mode with messages. All of which is a lie, given
8# that initrd mounted /cdrom, which later after udev-coldplug systemd
9# "catches up" with. Declate DefaultDependencies=no to prevent this
10# nonesence (i.e. implicit cdrom.mount BindsTo=$What.device)
11
12# Also, we lie about What=, as it could be anything, but systemd
13# demands to specify something. Thank-fully systemd will not try
14# mounting /dev/sr0 ontop of otherwise active cdrom.mount.
15
16# Because of DefaultDependenices=no readd stanzas to say that /cdrom
17# should be unmounted on shutdown, but only after / is unmounted.
18
19# Given that things might be mounted from on-top of /cdrom, specify
20# LazyUnmount=yes.
21
22# Note, due https://github.com/systemd/systemd/issues/8587 we specify
23# a full cdrom.mount unit, rather than a .d drop-in, as /cdrom is not
24# declared in fstab or via a unit
25
26[Unit]
27DefaultDependencies=no
28After=casper.service
29Before=-.mount
30Before=umount.target
31Conflicts=umount.target
32
33[Mount]
34Where=/cdrom
35What=/dev/sr0
36LazyUnmount=yes

Subscribers

People subscribed via source and target branches