Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[experimental] Upgrade dracut module: Update /usr mounting solution #1202

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from leapp.actors import Actor
from leapp.libraries.actor import enable_lvm_autoactivation as enable_lvm_autoactivation_lib
from leapp.models import UpgradeInitramfsTasks
from leapp.tags import IPUWorkflowTag, FactsPhaseTag


class EnableLVMAutoactivationInUpgradeInitramfs(Actor):
"""
Enable LVM autoactivation in upgrade initramfs.

Produce instructions for upgrade initramfs generation that will result in LVM
autoactivation in the initramfs.
"""

name = 'enable_lvm_autoactivation_in_upgrade_initramfs'
consumes = ()
produces = (UpgradeInitramfsTasks)
tags = (FactsPhaseTag, IPUWorkflowTag)

def process(self):
enable_lvm_autoactivation_lib.emit_lvm_autoactivation_instructions()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from leapp.libraries.stdlib import api
from leapp.models import UpgradeInitramfsTasks

def emit_lvm_autoactivation_instructions():
files_to_include = [
'/usr/sbin/pvscan',
'/usr/sbin/vgchange',
'/usr/lib/udev/rules.d/69-dm-lvm.rules' # Rule that triggers pvscan and vgchange when LVM device is detected
]
lvm_autoactivation_instructions = UpgradeInitramfsTasks(include_files=files_to_include)

api.produce(lvm_autoactivation_instructions)
Loading