From 6b2555c99854bd57d39383f14f8b81381c611386 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Tue, 15 Apr 2025 22:19:35 -0500 Subject: [PATCH] [bootloader] Simply bootloader logic to ensure we can use /cdrom elsewhere Instead of utilizing a contextualprocess to only bind-mount /cdrom to /media/cdrom when it's a specific type of system, simply add it to the mounts for all flavors, and move the specific copy of the vmlinuz file to a dedicated shellprocess module. This will be re-factored next cycle, ideally being worked directly into a dedicated C++ module instead of several, miscellaneous shell scripts wrapped in YAML. --- common/modules/before_bootloader_mkdirs_context.conf | 10 ---------- common/modules/copy_vmlinuz_shellprocess.conf | 5 +++++ common/modules/mount.conf | 3 +++ debian/changelog | 6 ++++++ kubuntu/settings.conf | 8 ++++---- lubuntu/settings.conf | 8 ++++---- ubuntuunity/settings.conf | 8 ++++---- 7 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 common/modules/before_bootloader_mkdirs_context.conf create mode 100644 common/modules/copy_vmlinuz_shellprocess.conf diff --git a/common/modules/before_bootloader_mkdirs_context.conf b/common/modules/before_bootloader_mkdirs_context.conf deleted file mode 100644 index 6aeb829..0000000 --- a/common/modules/before_bootloader_mkdirs_context.conf +++ /dev/null @@ -1,10 +0,0 @@ ---- -dontChroot: true -timeout: 10 -firmwareType: - efi: - - -cp /cdrom/casper/vmlinuz ${ROOT}/boot/vmlinuz-$(uname -r) - - -mkdir -pv ${ROOT}/media/cdrom - - -mount --bind /cdrom ${ROOT}/media/cdrom - bios: - - -cp /cdrom/casper/vmlinuz ${ROOT}/boot/vmlinuz-$(uname -r) diff --git a/common/modules/copy_vmlinuz_shellprocess.conf b/common/modules/copy_vmlinuz_shellprocess.conf new file mode 100644 index 0000000..6c2d2c5 --- /dev/null +++ b/common/modules/copy_vmlinuz_shellprocess.conf @@ -0,0 +1,5 @@ +--- +dontChroot: true +timeout: 60 +script: + - command: "cp /cdrom/casper/vmlinuz ${ROOT}/boot/vmlinuz-$(uname -r)" diff --git a/common/modules/mount.conf b/common/modules/mount.conf index 2e9ca68..17be9b5 100644 --- a/common/modules/mount.conf +++ b/common/modules/mount.conf @@ -21,6 +21,9 @@ extraMounts: - device: /run/systemd/resolve mountPoint: /run/systemd/resolve options: [ bind ] + - device: /cdrom + mountPoint: /media/cdrom + options: [ bind ] mountOptions: - filesystem: default diff --git a/debian/changelog b/debian/changelog index 56e228d..e035cbe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,11 @@ calamares-settings-ubuntu (1:25.04.26) UNRELEASED; urgency=medium + * [bootloader] Instead of utilizing a contextualprocess to only bind-mount + /cdrom to /media/cdrom when it's a specific type of system, simply add it + to the mounts for all flavors, and move the specific copy of the vmlinuz + file to a dedicated shellprocess module. This will be re-factored next + cycle, ideally being worked directly into a dedicated C++ module instead + of several, miscellaneous shell scripts wrapped in YAML. -- Simon Quigley Tue, 15 Apr 2025 22:15:17 -0500 diff --git a/kubuntu/settings.conf b/kubuntu/settings.conf index 7490e37..2dafd7f 100644 --- a/kubuntu/settings.conf +++ b/kubuntu/settings.conf @@ -2,12 +2,12 @@ modules-search: [ local ] instances: -- id: before_bootloader_mkdirs - module: contextualprocess - config: before_bootloader_mkdirs_context.conf - id: before_bootloader module: contextualprocess config: before_bootloader_context.conf +- id: copy_vmlinuz_shellprocess + module: shellprocess + config: copy_vmlinuz_shellprocess.conf - id: logs module: shellprocess config: shellprocess_logs.conf @@ -53,7 +53,7 @@ sequence: - displaymanager - networkcfg - hwclock - - contextualprocess@before_bootloader_mkdirs + - shellprocess@copy_vmlinuz_shellprocess - shellprocess@bug-LP#1829805 - shellprocess@fixconkeys_part1 - shellprocess@fixconkeys_part2 diff --git a/lubuntu/settings.conf b/lubuntu/settings.conf index 9e25d71..391d3a8 100644 --- a/lubuntu/settings.conf +++ b/lubuntu/settings.conf @@ -2,12 +2,12 @@ modules-search: [ local ] instances: -- id: before_bootloader_mkdirs - module: contextualprocess - config: before_bootloader_mkdirs_context.conf - id: before_bootloader module: contextualprocess config: before_bootloader_context.conf +- id: copy_vmlinuz_shellprocess + module: shellprocess + config: copy_vmlinuz_shellprocess.conf - id: logs module: shellprocess config: shellprocess_logs.conf @@ -57,7 +57,7 @@ sequence: - pkgselectprocess - dracutlukscfg - dracut - - contextualprocess@before_bootloader_mkdirs + - shellprocess@copy_vmlinuz_shellprocess - shellprocess@bug-LP#1829805 - shellprocess@fixconkeys_part1 - shellprocess@fixconkeys_part2 diff --git a/ubuntuunity/settings.conf b/ubuntuunity/settings.conf index 10956a5..25748dd 100644 --- a/ubuntuunity/settings.conf +++ b/ubuntuunity/settings.conf @@ -2,12 +2,12 @@ modules-search: [ local ] instances: -- id: before_bootloader_mkdirs - module: contextualprocess - config: before_bootloader_mkdirs_context.conf - id: before_bootloader module: contextualprocess config: before_bootloader_context.conf +- id: copy_vmlinuz_shellprocess + module: shellprocess + config: copy_vmlinuz_shellprocess.conf - id: logs module: shellprocess config: shellprocess_logs.conf @@ -53,7 +53,7 @@ sequence: - displaymanager - networkcfg - hwclock - - contextualprocess@before_bootloader_mkdirs + - shellprocess@copy_vmlinuz_shellprocess - shellprocess@bug-LP#1829805 - shellprocess@fixconkeys_part1 - shellprocess@fixconkeys_part2