~dbungert/curtin:flock-ex

Last commit made on 2024-03-25
Get this branch:
git clone -b flock-ex https://git.launchpad.net/~dbungert/curtin
Only Dan Bungert can upload to this branch. If you are Dan Bungert please log in for upload directions.

Branch merges

Branch information

Name:
flock-ex
Repository:
lp:~dbungert/curtin

Recent commits

204562c... by Dan Bungert

block/zfs: flock for ZFS

Add flock calls around encrypted ZFS creation areas

LP: #2057661

974c0d0... by Dan Bungert

block/meta: add flock calls around disk wipe

LP: #2016860

63b0445... by Dan Bungert

util: add FlockEx context manager

a02daee... by Olivier Gayot

apt-config: avoid APT complaints about sources backup files

Before apt-config makes a change to ubuntu.sources or another source
file, it backs up the original file by appending the .curtin.old
extension.

However, by default, APT will emit a warning when a file with an unknown
extension is present in the etc/apt/sources.list.d directory. Currently,
known extensions are .sources and .list so when APT sees our .curtin.old
files, it does emit a warning.

 > N: Ignoring file 'ubuntu.sources.curtin.old' in directory
 '/etc/apt/sources.list.d/' as it has an invalid filename extension

Through Dir::Ignore-Files-Silently directives, APT can be configured to
ignore (i.e., not warn) some of the files that have unknown extensions.
By default, the list includes:

 Dir::Ignore-Files-Silently:: "\.disabled$";
 Dir::Ignore-Files-Silently:: "\.bak$";
 Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
 Dir::Ignore-Files-Silently:: "\.ucf-[a-z]+$";
 Dir::Ignore-Files-Silently:: "\.save$";
 Dir::Ignore-Files-Silently:: "\.orig$";
 Dir::Ignore-Files-Silently:: "\.distUpgrade$";

We now back up the files using the .curtin.orig extension instead of
.curtin.old so that APT does not complain.

LP: #2058741

Signed-off-by: Olivier Gayot <email address hidden>

4d9513d... by Dan Bungert

py3.12: fix test deprecations

Swap two unittest deprecated calls for their supported coutnerparts
* s/assertRaisesRegexp/assertRaisesRegex/
* s/assertEquals/assertEqual/

Also fix whitespace lint issues created from doing the above.

54cc7d9... by Olivier Gayot

Merge branch 'nvme-stas-of-only'

https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/462257

69e3154... by Alexsander de Souza

feat(distro): add AlmaLinux support

fixes LP#1922970

7db312f... by Chris Peterson

curthooks: copy installation media metadata

a5b815b... by Olivier Gayot

apt: ensure systemd knows it runs in a chroot, when executing postinst

Since we added the --mount-proc option to unshare, the postinst script
for openssh-server (and most likely other packages) started failing with
the following error when `systemctl daemon-reload` was invoked:

  > Failed to connect to bus: No data available

Before the option was added, it would simply do nothing because systemd
rightly understood it was running in a chroot.

To determine if we are running in a chroot, systemd checks if
/proc/1/root (corresponding to the init process) and / are the same
inode. If they are different, systemd assumes we are in a chroot.

However, we are running apt-get in a new PID namespace which means that
in the new namespace, apt-get gets assigned PID 1 and is therefore the
"init" process.

Now that /proc is properly mounted in the chroot, when systemd compares
/proc/1/root and /, it sees they are identical because the init process
(which is apt-get) is actually running inside the chroot.

Without the --mount-proc option, /proc/1 in the chroot would still refer
to the systemd init process (running outside the chroot), so it would
work properly.

With the SYSTEMD_OFFLINE variable, one can "force" systemd to assume
it is running in a chroot. Let's use it when running commands in a
chroot, and when the variable is not already defined.

LP: #2056570

Signed-off-by: Olivier Gayot <email address hidden>

4b3395b... by Olivier Gayot

nvme-o-tcp: factorize parsing of NVMe controllers

In three different places now, we have code parsing the storage
configuration to extract the NVMe controllers. This is too much.

This patch introduces a single implementation in curtin/block/nvme.py.

Signed-off-by: Olivier Gayot <email address hidden>