Skip to content

Commit 303ee68

Browse files
authored
Merge pull request #320 from SUSE/fix_update_bootloader_path
Fix update bootloader
2 parents da0a97e + b13bd0c commit 303ee68

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

helper/service.tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
suse-migration-mount-system -> [
22
suse-migration-ssh-keys,
33
suse-migration-pre-checks,
4-
suse-migration-post-mount-system.service -> suse-migration-setup-host-network -> suse-migration-prepare -> [
4+
suse-migration-btrfs-snapshot-pre-migration -> suse-migration-post-mount-system -> suse-migration-setup-host-network -> suse-migration-prepare -> [
55
suse-migration-console-log,
6-
suse-migration-product-setup -> suse-migration -> suse-migration-apparmor-selinux -> suse-migration-grub-setup -> suse-migration-update-bootloader -> suse-migration-regenerate-initrd -> suse-migration-kernel-load -> suse-migration-reboot
6+
suse-migration-product-setup -> suse-migration -> suse-migration-apparmor-selinux -> suse-migration-wicked-networkmanager -> suse-migration-btrfs-snapshot-post-migration -> suse-migration-grub-setup -> suse-migration-update-bootloader -> suse-migration-regenerate-initrd -> suse-migration-kernel-load -> suse-migration-reboot
77
]
88
]

suse_migration_services/units/update_bootloader.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#
1818
"""systemd service to install the shim package and update the bootloader"""
1919
import logging
20+
import os.path
2021

2122
# project
2223
from suse_migration_services.command import Command
@@ -38,10 +39,11 @@ def main():
3839

3940
root_path = Defaults.get_system_root_path()
4041

41-
log.info('Installing the shim package')
42-
install_shim_package(root_path)
43-
log.info('Updating the shimbootloader')
44-
install_secure_bootloader(root_path)
42+
if os.path.exists('/sys/firmware/efi'):
43+
log.info('Installing the shim package')
44+
install_shim_package(root_path)
45+
log.info('Updating the shimbootloader')
46+
install_secure_bootloader(root_path)
4547
log.info('Updating the bootloader')
4648
update_bootloader_config(root_path)
4749

@@ -110,13 +112,13 @@ def update_bootloader_config(root_path):
110112

111113
try:
112114
log.info(
113-
'Running chroot {0} update-bootloader --reinit'.format(root_path)
115+
'Running chroot {0} /sbin/update-bootloader --reinit'.format(root_path)
114116
)
115117
Command.run(
116118
[
117119
'chroot',
118120
root_path,
119-
'update-bootloader',
121+
'/sbin/update-bootloader',
120122
'--reinit'
121123
]
122124
)

systemd/suse-migration-btrfs-snapshot-post-migration.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Unit]
22
Description=Snapper btrfs snapshot after migration
3-
After=suse-migration.service
3+
After=suse-migration.service suse-migration-apparmor-selinux.service suse-migration-wicked-networkmanager.service
44
Requisite=suse-migration.service
55
Before=suse-migration-grub-setup.service
66
ConditionPathExists=/run/suse_migration_snapper_btrfs_pre_snapshot_number

systemd/suse-migration-reboot.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Unit]
22
Description=Reboot System
3-
After=suse-migration-kernel-load.service
3+
After=suse-migration-kernel-load.service suse-migration-update-bootloader.service
44
ConditionKernelCommandLine=!migration.noreboot
55

66
[Service]

test/unit/units/update_bootloader_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_main(
114114
[
115115
'chroot',
116116
'/system-root',
117-
'update-bootloader',
117+
'/sbin/update-bootloader',
118118
'--reinit'
119119
]
120120
)

0 commit comments

Comments
 (0)