Implement include keyword in isolinux.cfg.

master
Colin Watson 16 years ago
parent 950e298736
commit b9c38a7bd5

1
debian/changelog vendored

@ -2,6 +2,7 @@ gfxboot-theme-ubuntu (0.6.1) UNRELEASED; urgency=low
* Remove support for deprecated gfxboot-foreground, gfxboot-background,
and gfxboot-access-options keywords in isolinux.cfg.
* Implement include keyword in isolinux.cfg.
-- Colin Watson <cjwatson@ubuntu.com> Wed, 18 Jun 2008 11:48:25 +0100

@ -7,15 +7,36 @@
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% ( str2 str1 -- str )
/menuconfig.append {
over length over length add string /menuconfig.append.tmp exch def
"%s%s" menuconfig.append.tmp sprintf
menuconfig.append.tmp
} def
% Read a configuration file. If file_name is .undef, look in some standard
% places.
% ( file_name -- file_contents )
/menuconfig.find {
[
"/syslinux.cfg"
"/syslinux/syslinux.cfg"
"/isolinux.cfg"
"/isolinux/isolinux.cfg"
"/boot/isolinux/isolinux.cfg"
] {
dup filesize .undef ne { findfile return } if
/menuconfig.find.tmp exch def
menuconfig.find.tmp {
[
menuconfig.find.tmp "/" menuconfig.append
menuconfig.find.tmp "/syslinux/" menuconfig.append
menuconfig.find.tmp "/isolinux/" menuconfig.append
menuconfig.find.tmp "/boot/isolinux/" menuconfig.append
]
} {
[
"/syslinux.cfg"
"/syslinux/syslinux.cfg"
"/isolinux.cfg"
"/isolinux/isolinux.cfg"
"/boot/isolinux/isolinux.cfg"
]
} ifelse
{
dup filesize .undef ne { findfile cvs return } if
pop
} forall
.undef
@ -81,42 +102,12 @@
} forall
} def
% ( menu_entries_array menu_args_array -- menu_humans_array menu_entries_array menu_args_array )
% The returned menu_args_array (kernel parameters), menu_entries_array
% (identifiers), and menu_humans_array (human-readable names) will have any
% hidden entries removed.
/menuconfig.init {
dup length array /menuconfig.args exch def
over length array /menuconfig.entries exch def
over length array /menuconfig.humans exch def
% copy input arrays; initialise menuconfig.humans
/menuconfig.idx 0 def
{
menuconfig.args menuconfig.idx rot put
/menuconfig.idx inc
} forall
/menuconfig.idx 0 def
{
dup menuconfig.entries menuconfig.idx rot put
menuconfig.humans menuconfig.idx rot put
/menuconfig.idx inc
} forall
% we only understand syslinux configuration
syslinux not {
menuconfig.humans menuconfig.entries menuconfig.args return
} if
% ( file_name -- )
/menuconfig.parse {
% load configuration file; return if not found
menuconfig.find dup .undef eq {
menuconfig.humans menuconfig.entries menuconfig.args return
} if
/menuconfig.file exch cvs def
/menuconfig.curlabel .undef def
menuconfig.find dup .undef eq { pop return } if
menuconfig.file {
dup {
% skip over any NULs we've left behind; exit if there's really no more
% memory left to go
{
@ -133,6 +124,9 @@
} for
skipspace getword tolower
dup "include" eq {
over skipspace getword dup menuconfig.parse
} if
dup "label" eq {
over skipspace strdup /menuconfig.curlabel exch def
} if
@ -147,7 +141,39 @@
% skip to end of line
dup length add
} loop pop
menuconfig.file free
free
} def
% ( menu_entries_array menu_args_array -- menu_humans_array menu_entries_array menu_args_array )
% The returned menu_args_array (kernel parameters), menu_entries_array
% (identifiers), and menu_humans_array (human-readable names) will have any
% hidden entries removed.
/menuconfig.init {
dup length array /menuconfig.args exch def
over length array /menuconfig.entries exch def
over length array /menuconfig.humans exch def
% copy input arrays; initialise menuconfig.humans
/menuconfig.idx 0 def
{
menuconfig.args menuconfig.idx rot put
/menuconfig.idx inc
} forall
/menuconfig.idx 0 def
{
dup menuconfig.entries menuconfig.idx rot put
menuconfig.humans menuconfig.idx rot put
/menuconfig.idx inc
} forall
% we only understand syslinux configuration
syslinux not {
menuconfig.humans menuconfig.entries menuconfig.args return
} if
/menuconfig.curlabel .undef def
.undef menuconfig.parse
menuconfig.humans menuconfig.entries menuconfig.args
} def

Loading…
Cancel
Save