From 908834ec887712f3bc860dbb30209e5b95e5d158 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Sat, 28 Oct 2023 11:15:25 -0500 Subject: [PATCH] generate-zbm: remove integrated syslinux support --- bin/generate-zbm | 79 ------------------------- docs/guides/void-linux/syslinux-mbr.rst | 4 +- docs/man/generate-zbm.5.rst | 16 +---- etc/zfsbootmenu/config.yaml | 3 - etc/zfsbootmenu/release.yaml | 2 - 5 files changed, 2 insertions(+), 102 deletions(-) diff --git a/bin/generate-zbm b/bin/generate-zbm index 3257c5176..e934eafe2 100755 --- a/bin/generate-zbm +++ b/bin/generate-zbm @@ -498,85 +498,6 @@ if ( enabled $config{Components} ) { printf "Created kernel image %s\n", $kernel_target; } -# Generate syslinux.cfg, requires components to be built -if ( enabled $config{Components}{syslinux} ) { - my $warning = <<"EOF"; - -DEPRECATION WARNING: syslinux support in generate-zbm is deprecated. - Support will be removed in the next release. - - As an alternative: consider one of the following two options: - - 1. Set `Components.Versions` to `false` in the ZFSBootMenu configuration and - maintain a static syslinux configuration. - - 2. Use the contrib/syslinux-update.sh script in the ZFSBootMenu repository - as a post-image hook for generate-zbm(5). - -EOF - print $warning; - - my $glob = sprintf( "%s/%s-*", $config{Components}{ImageDir}, $runConf{kernel_prefix} ); - my @listing = sort versioncmp glob($glob); - - # Filter EFI files, in case they're in the same directory - my @components; - foreach my $entry (@listing) { - if ( $entry =~ /EFI$/i ) { - next; - } - push( @components, $entry ); - } - - $runConf{syslinux_temp} = join( '/', $tempdir, 'syslinux.conf' ); - open CFG, '>', $runConf{syslinux_temp}; - - my $header = <<'EOF'; -UI menu.c32 -PROMPT 0 - -MENU TITLE Boot Menu -TIMEOUT 50 -EOF - - print CFG $header; - - my $add_default = 1; - while (@components) { - my $entry = pop(@components); - - my $directory = dirname($entry); - - # Strip the mountpoint prefix out to generate a correct path based on / - $directory =~ s/\Q$config{Global}{BootMountPoint}//; - - my $kernel = basename($entry); - my ( undef, $version ) = split( '-', $kernel ); - my $label = "ZFSBootMenu-$version"; - my $menu_label = "ZFSBootMenu $version"; - - if ($add_default) { - print CFG "DEFAULT $label\n\n"; - $add_default--; - } - - my $entry_text = <<"EOF"; -LABEL $label -MENU LABEL $menu_label -KERNEL $directory/$kernel -INITRD $directory/initramfs-$version.img -APPEND $runConf{cmdline} - -EOF - print CFG $entry_text; - - } - close CFG; - - make_path dirname( $config{Components}{syslinux}{Config} ); - safeCopy( $runConf{syslinux_temp}, $config{Components}{syslinux}{Config} ) or exit 1; -} - if ( nonempty $config{Global}{PostHooksDir} and -d $config{Global}{PostHooksDir} ) { while ( my $hook = <$config{Global}{PostHooksDir}/*> ) { next unless -x $hook; diff --git a/docs/guides/void-linux/syslinux-mbr.rst b/docs/guides/void-linux/syslinux-mbr.rst index 0c7879bc7..5ba370a6c 100644 --- a/docs/guides/void-linux/syslinux-mbr.rst +++ b/docs/guides/void-linux/syslinux-mbr.rst @@ -142,9 +142,7 @@ See :doc:`generate-zbm(5) ` for more details. Configure syslinux ~~~~~~~~~~~~~~~~~~ -The ``generate-zbm`` image-creation utility includes now-deprecated support for managing a syslinux configuration. -Because this capability is slated for removal and was not reliable in the first place, it is better to create a static -syslinux configuration. The ZFSBootMenu configuration described above disables explicit image versioning, which means +The ZFSBootMenu configuration described above disables explicit image versioning, which means that each invocation of ``generate-zbm`` will produce two output files at a predictable location: * ``/boot/syslinux/zfsbootmenu/vmlinuz-bootmenu`` diff --git a/docs/man/generate-zbm.5.rst b/docs/man/generate-zbm.5.rst index 9b7c4c0e2..0cd5db4e8 100644 --- a/docs/man/generate-zbm.5.rst +++ b/docs/man/generate-zbm.5.rst @@ -70,7 +70,7 @@ Kernel **CommandLine** - If you're making a unified EFI file or a syslinux configuration, this is the command line passed to the boot image. + If you're making a unified EFI file, this is the command line passed to the boot image. **Path** @@ -103,17 +103,6 @@ Components When *true* (which behaves as *1*) or any positive integer, **generate-zbm** will append the value of *Global.Version* to every image it produces, followed by a revision as *_$revision*. **generate-zbm** will save *Components.Versions* revisions of all images with versions matching the current value of *Global.Version*. In addition, **generate-zbm** will save the highest revision of the most recent *Components.Versions* image versions distinct from *Global.Version*. -Components.syslinux -------------------- - -**Enabled** - - When *true*, syslinux configuration generation is enabled. The default value is *false*. - -**Config** - - The path of the syslinux configuration file to produce. - EFI --- @@ -148,9 +137,6 @@ The following example will write separate, unversioned ZFSBootMenu kernel and in ImageDir: /boot/efi/EFI/zbm Versions: false Enabled: true - syslinux: - Config: /boot/syslinux/syslinux.cfg - Enabled: false EFI: ImageDir: /boot/efi/EFI/zbm Versions: 2 diff --git a/etc/zfsbootmenu/config.yaml b/etc/zfsbootmenu/config.yaml index e8b196cc2..261cc9b58 100644 --- a/etc/zfsbootmenu/config.yaml +++ b/etc/zfsbootmenu/config.yaml @@ -9,9 +9,6 @@ Components: ImageDir: /boot/efi/EFI/zbm Versions: 3 Enabled: true - syslinux: - Config: /boot/syslinux/syslinux.cfg - Enabled: false EFI: ImageDir: /boot/efi/EFI/zbm Versions: false diff --git a/etc/zfsbootmenu/release.yaml b/etc/zfsbootmenu/release.yaml index d77a6709a..7e96f93a5 100644 --- a/etc/zfsbootmenu/release.yaml +++ b/etc/zfsbootmenu/release.yaml @@ -5,8 +5,6 @@ Global: Components: Versions: false Enabled: true - syslinux: - Enabled: false EFI: Versions: false Enabled: true