Accepting request 967468 from devel:kubic:ignition

- ignition-mount-initrd-fstab.service:
  - Don't ignore errors in loops
  - Unmount mount points recursively - a new submount may have appeared
  - Split umount part into own service file:
- ignition-umount-initrd-fstab.service:
  - Unmounts the additional mounts as soon as they are not required for Ignition any more; the ExecStop operation is running quite late in initrd and may unmount essential mount points flagged with "x-initrd.mount" (e.g. when storing /usr on a separate mount point). In theory this will also affect Ignition itself, but it hasn't been reported as a problem so far.
- Don't include non-MarkDown files in documentation

OBS-URL: https://build.opensuse.org/request/show/967468
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ignition?expand=0&rev=33
This commit is contained in:
Dominique Leuenberger 2022-04-08 23:43:49 +00:00 committed by Git OBS Bridge
commit 3237711740
7 changed files with 40 additions and 7 deletions

View File

@ -1,6 +1,6 @@
Changes for openSUSE / SLE: Changes for openSUSE / SLE:
* ignition-mount-initrd-fstab.service: * ignition-mount-initrd-fstab.service / ignition-umount-initrd-fstab.service:
Upstream Ignition will only mount partitions or subvolumes explicitly Upstream Ignition will only mount partitions or subvolumes explicitly
mentioned in the Ignition configuration. A default SUSE system, however, mentioned in the Ignition configuration. A default SUSE system, however,
is split over several subvolumes, and most users won't want to define is split over several subvolumes, and most users won't want to define

View File

@ -17,7 +17,4 @@ Before=ignition-files.service
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes ExecStart=/bin/sh -e -c 'eval $(awk '"'"'$4 ~ /x-initrd.mount/ && $1 !~ /^#/ {print "if ! findmnt /sysroot" $2 " >/dev/null; then mount -t " $3 " -o " $4 " " $1 " /sysroot" $2 "; fi;" }'"'"' /sysroot/etc/fstab)'
ExecStart=/bin/sh -c 'eval $(awk '"'"'$4 ~ /x-initrd.mount/ && $1 !~ /^#/ {print "if ! findmnt /sysroot" $2 " >/dev/null; then mount -t " $3 " -o " $4 " " $1 " /sysroot" $2 "; fi;" }'"'"' /sysroot/etc/fstab)'
ExecStop=/bin/sh -c 'if [ -f /sysroot/etc/systemd/system-preset/20-ignition.preset ]; then while read line; do systemctl --root=/sysroot $line; done < /sysroot/etc/systemd/system-preset/20-ignition.preset; fi'
ExecStop=/usr/bin/umount -a -O "x-initrd.mount"

View File

@ -9,6 +9,7 @@ set -e
. /run/ignition.env . /run/ignition.env
add_requires ignition-mount-initrd-fstab.service ignition-files.service add_requires ignition-mount-initrd-fstab.service ignition-files.service
add_requires ignition-umount-initrd-fstab.service ignition-files.service
add_requires ignition-enable-network.service ignition-fetch.service add_requires ignition-enable-network.service ignition-fetch.service
if [ -z "${PLATFORM_ID}" ]; then if [ -z "${PLATFORM_ID}" ]; then

View File

@ -0,0 +1,10 @@
[Unit]
Description=Unmount initrd fstab entries for Ignition
DefaultDependencies=false
Before=ignition-complete.target
After=ignition-files.service
[Service]
Type=oneshot
ExecStart=/bin/sh -e -c 'if [ -f /sysroot/etc/systemd/system-preset/20-ignition.preset ]; then while read line; do systemctl --root=/sysroot $line; done < /sysroot/etc/systemd/system-preset/20-ignition.preset; fi'
ExecStart=/bin/sh -e -c 'eval $(awk '"'"'$4 ~ /x-initrd.mount/ && $1 !~ /^#/ {print "if findmnt /sysroot" $2 " >/dev/null; then umount -R /sysroot" $2 "; fi;" }'"'"' /sysroot/etc/fstab)'

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Apr 5 14:57:20 UTC 2022 - Ignaz Forster <iforster@suse.com>
- ignition-mount-initrd-fstab.service:
- Don't ignore errors in loops
- Unmount mount points recursively - a new submount may have
appeared
- Split umount part into own service file:
- ignition-umount-initrd-fstab.service:
- Unmounts the additional mounts as soon as they are not
required for Ignition any more; the ExecStop operation is
running quite late in initrd and may unmount essential mount
points flagged with "x-initrd.mount" (e.g. when storing /usr on
a separate mount point). In theory this will also affect
Ignition itself, but it hasn't been reported as a problem so
far.
-------------------------------------------------------------------
Mon Apr 4 17:23:10 UTC 2022 - Ignaz Forster <iforster@suse.com>
- Don't include non-MarkDown files in documentation
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Mar 25 09:59:53 UTC 2022 - Ignaz Forster <iforster@suse.com> Fri Mar 25 09:59:53 UTC 2022 - Ignaz Forster <iforster@suse.com>

View File

@ -25,6 +25,7 @@ Group: System/Management
URL: https://github.com/coreos/ignition URL: https://github.com/coreos/ignition
Source: %{name}-%{version}.tar.xz Source: %{name}-%{version}.tar.xz
Source1: ignition-mount-initrd-fstab.service Source1: ignition-mount-initrd-fstab.service
Source2: ignition-umount-initrd-fstab.service
Source3: ignition-suse-generator Source3: ignition-suse-generator
Source4: module-setup.sh Source4: module-setup.sh
Source5: 02_ignition_firstboot Source5: 02_ignition_firstboot
@ -88,7 +89,7 @@ which creates firstboot_happened after the first boot.
mkdir dracut/30ignition-microos grub systemd_suse mkdir dracut/30ignition-microos grub systemd_suse
chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE12} chmod +x %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE12}
cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE13} %{SOURCE14} dracut/30ignition-microos/ cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE13} %{SOURCE14} dracut/30ignition-microos/
%ifarch aarch64 %{arm} %ifarch aarch64 %{arm}
cp %{SOURCE21} dracut/30ignition-microos/ignition-userconfig-timeout.conf cp %{SOURCE21} dracut/30ignition-microos/ignition-userconfig-timeout.conf
%else %else
@ -150,7 +151,7 @@ fi
%files %files
%license LICENSE %license LICENSE
%doc README.md README.SUSE docs %doc README.md README.SUSE docs/*.md
%{_prefix}/lib/dracut/modules.d/30ignition %{_prefix}/lib/dracut/modules.d/30ignition
%{_prefix}/lib/dracut/modules.d/30ignition-microos %{_prefix}/lib/dracut/modules.d/30ignition-microos
%{_bindir}/ignition-validate %{_bindir}/ignition-validate

View File

@ -21,6 +21,8 @@ install() {
"$systemdsystemunitdir/ignition-enable-network.service" "$systemdsystemunitdir/ignition-enable-network.service"
inst_simple "$moddir/ignition-mount-initrd-fstab.service" \ inst_simple "$moddir/ignition-mount-initrd-fstab.service" \
"$systemdsystemunitdir/ignition-mount-initrd-fstab.service" "$systemdsystemunitdir/ignition-mount-initrd-fstab.service"
inst_simple "$moddir/ignition-umount-initrd-fstab.service" \
"$systemdsystemunitdir/ignition-umount-initrd-fstab.service"
inst_simple "$moddir/ignition-userconfig-timeout.conf" \ inst_simple "$moddir/ignition-userconfig-timeout.conf" \
"$systemdsystemunitdir/dev-disk-by\x2dlabel-ignition.device.d/ignition-userconfig-timeout.conf" "$systemdsystemunitdir/dev-disk-by\x2dlabel-ignition.device.d/ignition-userconfig-timeout.conf"
inst_simple "$moddir/ignition-touch-selinux-autorelabel.conf" \ inst_simple "$moddir/ignition-touch-selinux-autorelabel.conf" \