Skip to content

Commit 55f08b9

Browse files
committed
generate-zbm: remove integrated syslinux support
1 parent 6c63c1d commit 55f08b9

File tree

5 files changed

+5
-102
lines changed

5 files changed

+5
-102
lines changed

bin/generate-zbm

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -498,85 +498,6 @@ if ( enabled $config{Components} ) {
498498
printf "Created kernel image %s\n", $kernel_target;
499499
}
500500

501-
# Generate syslinux.cfg, requires components to be built
502-
if ( enabled $config{Components}{syslinux} ) {
503-
my $warning = <<"EOF";
504-
505-
DEPRECATION WARNING: syslinux support in generate-zbm is deprecated.
506-
Support will be removed in the next release.
507-
508-
As an alternative: consider one of the following two options:
509-
510-
1. Set `Components.Versions` to `false` in the ZFSBootMenu configuration and
511-
maintain a static syslinux configuration.
512-
513-
2. Use the contrib/syslinux-update.sh script in the ZFSBootMenu repository
514-
as a post-image hook for generate-zbm(5).
515-
516-
EOF
517-
print $warning;
518-
519-
my $glob = sprintf( "%s/%s-*", $config{Components}{ImageDir}, $runConf{kernel_prefix} );
520-
my @listing = sort versioncmp glob($glob);
521-
522-
# Filter EFI files, in case they're in the same directory
523-
my @components;
524-
foreach my $entry (@listing) {
525-
if ( $entry =~ /EFI$/i ) {
526-
next;
527-
}
528-
push( @components, $entry );
529-
}
530-
531-
$runConf{syslinux_temp} = join( '/', $tempdir, 'syslinux.conf' );
532-
open CFG, '>', $runConf{syslinux_temp};
533-
534-
my $header = <<'EOF';
535-
UI menu.c32
536-
PROMPT 0
537-
538-
MENU TITLE Boot Menu
539-
TIMEOUT 50
540-
EOF
541-
542-
print CFG $header;
543-
544-
my $add_default = 1;
545-
while (@components) {
546-
my $entry = pop(@components);
547-
548-
my $directory = dirname($entry);
549-
550-
# Strip the mountpoint prefix out to generate a correct path based on /
551-
$directory =~ s/\Q$config{Global}{BootMountPoint}//;
552-
553-
my $kernel = basename($entry);
554-
my ( undef, $version ) = split( '-', $kernel );
555-
my $label = "ZFSBootMenu-$version";
556-
my $menu_label = "ZFSBootMenu $version";
557-
558-
if ($add_default) {
559-
print CFG "DEFAULT $label\n\n";
560-
$add_default--;
561-
}
562-
563-
my $entry_text = <<"EOF";
564-
LABEL $label
565-
MENU LABEL $menu_label
566-
KERNEL $directory/$kernel
567-
INITRD $directory/initramfs-$version.img
568-
APPEND $runConf{cmdline}
569-
570-
EOF
571-
print CFG $entry_text;
572-
573-
}
574-
close CFG;
575-
576-
make_path dirname( $config{Components}{syslinux}{Config} );
577-
safeCopy( $runConf{syslinux_temp}, $config{Components}{syslinux}{Config} ) or exit 1;
578-
}
579-
580501
if ( nonempty $config{Global}{PostHooksDir} and -d $config{Global}{PostHooksDir} ) {
581502
while ( my $hook = <$config{Global}{PostHooksDir}/*> ) {
582503
next unless -x $hook;

docs/guides/void-linux/syslinux-mbr.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ See :doc:`generate-zbm(5) </man/generate-zbm.5>` for more details.
142142
Configure syslinux
143143
~~~~~~~~~~~~~~~~~~
144144
145-
The ``generate-zbm`` image-creation utility includes now-deprecated support for managing a syslinux configuration.
146-
Because this capability is slated for removal and was not reliable in the first place, it is better to create a static
147-
syslinux configuration. The ZFSBootMenu configuration described above disables explicit image versioning, which means
145+
The ZFSBootMenu configuration described above disables explicit image versioning, which means
148146
that each invocation of ``generate-zbm`` will produce two output files at a predictable location:
149147
150148
* ``/boot/syslinux/zfsbootmenu/vmlinuz-bootmenu``
@@ -184,6 +182,9 @@ Consult the `syslinux documentation <https://wiki.syslinux.org/wiki/index.php?ti
184182
contents of the ``syslinux.cfg`` configuration file. To alter the command-line arguments passed to the ZFSBootMenu
185183
image, adjust the contents of the ``APPEND`` lines in the configuration.
186184
185+
Alternatively, the :zbm:`contrib/syslinux-update.sh` ``generate-zbm`` hook can be used to automatically recreate
186+
``syslinux.cfg``.
187+
187188
.. include:: _include/gen-initramfs.rst
188189
189190
.. include:: ../_include/cleanup.rst

docs/man/generate-zbm.5.rst

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Kernel
7070

7171
**CommandLine**
7272

73-
If you're making a unified EFI file or a syslinux configuration, this is the command line passed to the boot image.
73+
If you're making a unified EFI file, this is the command line passed to the boot image.
7474

7575
**Path**
7676

@@ -103,17 +103,6 @@ Components
103103

104104
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*.
105105

106-
Components.syslinux
107-
-------------------
108-
109-
**Enabled**
110-
111-
When *true*, syslinux configuration generation is enabled. The default value is *false*.
112-
113-
**Config**
114-
115-
The path of the syslinux configuration file to produce.
116-
117106
EFI
118107
---
119108

@@ -148,9 +137,6 @@ The following example will write separate, unversioned ZFSBootMenu kernel and in
148137
ImageDir: /boot/efi/EFI/zbm
149138
Versions: false
150139
Enabled: true
151-
syslinux:
152-
Config: /boot/syslinux/syslinux.cfg
153-
Enabled: false
154140
EFI:
155141
ImageDir: /boot/efi/EFI/zbm
156142
Versions: 2

etc/zfsbootmenu/config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ Components:
99
ImageDir: /boot/efi/EFI/zbm
1010
Versions: 3
1111
Enabled: true
12-
syslinux:
13-
Config: /boot/syslinux/syslinux.cfg
14-
Enabled: false
1512
EFI:
1613
ImageDir: /boot/efi/EFI/zbm
1714
Versions: false

etc/zfsbootmenu/release.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Global:
55
Components:
66
Versions: false
77
Enabled: true
8-
syslinux:
9-
Enabled: false
108
EFI:
119
Versions: false
1210
Enabled: true

0 commit comments

Comments
 (0)