Skip to content

Commit

Permalink
Upgrade dracut module: Update /usr mounting solution
Browse files Browse the repository at this point in the history
Originally we had implemented our own mount_usr.sh script, which
took care about mounting the /usr when it is present on separate
partition / mountpoint. It took care also about LVM activation.

However, it has been problematic in various cases (e.g. when device
needed more time for initialisation - e.g. when connected using FC).
Let's use instead existing system solutions, starting
the upgrade.target after initrd-fs.target (instead of just
basic.target).

TBD

jira: RHEL-3344
  • Loading branch information
pirat89 committed Aug 30, 2024
1 parent 9f2f172 commit bc5fd7e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ install() {
inst_binary grep

# script to actually run the upgrader binary
inst_hook upgrade 49 "$_moddir/mount_usr.sh"
inst_hook upgrade 50 "$_moddir/do-upgrade.sh"

#NOTE: some clean up?.. ideally, everything should be inside the leapp*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/usr/bin/true
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ install() {
ln -sf "../${s}.service" "$upgrade_wantsdir"
done

# Setup modified initrd-cleanup.service in the upgrade initramfs to enable
# storage initialisation using systemd-fstab-generator. We want to run the
# initrd-parse-etc.service but this one triggers also the initrd-cleanup.service
# which triggers the switch-root and isolated actions that basically kills
# the original upgrade service when used.
# The initrd-parse-etc.service has different content across RHEL systems,
# so we override rather initrd-cleanup.service instead as we do not need
# that one for the upgrade process.
mkdir -p "${unitdir}/initrd-cleanup.service.d"
inst_simple "${_moddir}/initrd-cleanup-override.conf" "${unitdir}/initrd-cleanup.service.d/initrd-cleanup-override.conf"

# just try : set another services into the wantsdir
# sysroot.mount \
# dracut-mount \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=System Upgrade
Documentation=man:upgrade.target(7)
# ##sysinit.target sockets.target initrd-root-fs.target initrd-root-device.target initrd-fs.target
Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target
Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target initrd-parse-etc.service
Requires=basic.target sysroot.mount
After=basic.target sysroot.mount
After=basic.target sysroot.mount initrd-fs.target
AllowIsolate=yes

0 comments on commit bc5fd7e

Please sign in to comment.