grub-shell: Pass -no-pad to xorriso when building floppy images
PATCH 1/1 grub-shell: Pass -no-pad to xorriso when building floppy images
The floppy images built by grub-shell are currently just over the floppy limit, and the Debian patch set plus the 915resolution extra bring this up to the point where GRUB tries to actually read past the floppy limit, breaking fddboot_test. Passing -no-pad buys us 300KiB, which should keep us going for a while.
* tests/util/grub-shell.in: Pass -no-pad to xorriso when building floppy images, saving 300KiB.
--- ChangeLog | 5 +++++ tests/util/grub-shell.in | 4 ++++ 2 files changed, 9 insertions(+)
ChangeLog +5 -0
@@ -1,3 +1,8 @@ +2014-01-16 Colin Watson <[email protected]> + + * tests/util/grub-shell.in: Pass -no-pad to xorriso when building + floppy images, saving about 300KiB. + 2014-01-08 Colin Watson <[email protected]> * Makefile.util.def (grub-macbless): Change mansection to 8.
tests/util/grub-shell.in +4 -0
@@ -346,6 +346,10 @@ if test -z "$debug"; then qemuopts="${qemuopts} -nographic -monitor file:/dev/null" fi +if [ x$boot = xfd ]; then + mkrescue_args="${mkrescue_args} -- -no-pad" +fi + if [ x$boot != xnet ] && [ x$boot != xemu ]; then pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \ --rom-directory="${rom_directory}" \
Signature · 1 line
1.8.5.2
Hi,
Quoted 1 line
+ mkrescue_args="${mkrescue_args} -- -no-pad"
This "--" is most probably not what you want.
man grub-mkrescue says (and xorriso indeed does it):
"Option -- switches to native xorriso command mode."
But -no-pad is not a native xorriso command.
$ xorriso -as mkisofs -- -no-pad
throws
xorriso : FAILURE : Not a known command: '-no-pad'
Better do it without the double-dash so that it gets interpreted by the mkisofs emulation which knows it as option:
mkrescue_args="${mkrescue_args} -no-pad"Have a nice day :)
Thomas
Quoted 5 lines · Thomas Schmitt
Hi,
Quoted 1 line
+ mkrescue_args="${mkrescue_args} -- -no-pad"
This "--" is most probably not what you want.
[...]
Quoted 1 line
mkrescue_args="${mkrescue_args} -no-pad"This doesn't work for me:
+ pkgdatadir=. ./grub-mkrescue --output=/tmp/tmp.NiHozwqHYv --override-directory=./grub-core --rom-directory=/tmp/tmp.Z4Kx63yul8 --themes-directory=../../themes --compress=xz --fonts= --locales= --themes= -no-pad /boot/grub/grub.cfg=/tmp/tmp.pEYe6QbufK /boot/grub/testcase.cfg=/tmp/tmp.8OxC8koxHb ./grub-mkrescue: invalid option -- 'n'
Try 'grub-mkrescue --help' or 'grub-mkrescue --usage' for more information.
Thanks,
Signature · 1 line
Colin Watson [[email protected]]
Hi,
Quoted 4 lines
Quoted 1 line
mkrescue_args="${mkrescue_args} -no-pad"This doesn't work for me:
./grub-mkrescue: invalid option -- 'n'
So the documentation seems not to match the implementation.
http://git.savannah.gnu.org/cgit/grub.git/tree/docs/grub.texi
"All arguments not explicitly listed as @command{grub-mkrescue} options are
passed on directly to @command{xorriso} in @command{mkisofs} emulation mode. Options passed to @command{xorriso} will normally be interpreted as @command{mkisofs} options; if the option @samp{--} is used, then anything after that will be interpreted as native @command{xorriso} options."
But you seem to experience that "--" ends grub-mkrescue options and begins xorriso -as mkisofs options.
Is this ./grub-mkrescue the binary of the new C program ?
http://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkrescue.c
I am riddling over /grub-core/gnulib/argp-parse.c now, where
i see
/* The meta-argument used to prevent any further arguments being interpreted
as options. */
#define QUOTE "--"
Do i get it right that xorriso's default list delimiter and the reserved argument QUOTE collide ?
The xorriso delimiter is user adjustable before the -as mkisofs command. E.g.:
xorriso -list_delimiter +xorriso-native+ \
-as mkisofs ...The instruction towards the user of grub-mkrescue for entering the native command mode would then be to use argument
+xorriso-native+
and to choose a more convenient delimiter by the first native command
list_delimiter -- ...actually.intended.native.commands...
This way the intended native commands can use the normal delimiter as descibed in the man page of xorriso.
Have a nice day :)
Thomas
Hi,
Quoted 1 line
xorriso -list_delimiter +xorriso-native+
It comes to me that it would be easier to document that the first "--" brings you out of grub-mkrescue option interpretation and that the second "--" brings you into xorriso native command mode.
I.e. no change in grub-mkrescue, no -list_delimiter +xorriso-native+.
... if my perception of what's going on is correct at all.
Have a nice day :)
Thomas
В Thu, 16 Jan 2014 17:28:32 +0100
"Thomas Schmitt" <[email protected]> пишет:
Quoted 8 lines
Hi,
Quoted 1 line
xorriso -list_delimiter +xorriso-native+
It comes to me that it would be easier to document that the first "--" brings you out of grub-mkrescue option interpretation and that the second "--" brings you into xorriso native command mode.
There is no second "--". grub-mkrescue --help tries to say, that everything after "--" is simply passed on to xorriso. What is confusing, is "or any of the mkisofs options" in previous sentence which implies that "--" is not needed.
Hi,
Quoted 4 lines
There is no second "--". grub-mkrescue --help tries to say, that everything after "--" is simply passed on to xorriso. What is confusing, is "or any of the mkisofs options" in previous sentence which implies that "--" is not needed.
It used to work the way which is still in the docs.
See
http://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkrescue.in?id=2.00
Its arguments are interpreted by
while test $# -gt 0
do
...
case "$option" in
...
*)
source="${source} ${option} $@"; break ;;
esacdone
I.e the unrecognized arguments are added to the list of source files which is later submitted to the xorriso -as mkisofs emulation:
# build iso image
"${xorriso}" -as mkisofs ... ${source}Among the xorriso arguments, the "--" has the effect that xorriso will leave mkisofs emulation and interpret the following arguments as its native commands and their parameters.
But the new C code obviously thinks too much when seeing single-dash arguments, which it should handle as xorriso arguments. And it eats "--". At least if it is the first non-mkrescue argument.
So:
What argument interpretation behavior is grub-mkrescue 2.02 supposed to show ?
The one that is currently documented and matches grub-mkrescue.in of 2.00 ?
Or the one that is result of using grub-core/gnulib/argp-parse.c ? The latter would need to be explored and documented, then.
Have a nice day :)
Thomas
В Thu, 16 Jan 2014 19:56:16 +0100
"Thomas Schmitt" <[email protected]> пишет:
Quoted 28 lines
Hi,
Quoted 4 lines
There is no second "--". grub-mkrescue --help tries to say, that everything after "--" is simply passed on to xorriso. What is confusing, is "or any of the mkisofs options" in previous sentence which implies that "--" is not needed.
It used to work the way which is still in the docs.
See
http://git.savannah.gnu.org/cgit/grub.git/tree/util/grub-mkrescue.in?id=2.00Its arguments are interpreted by
while test $# -gt 0
do... case "$option" in ... *) source="${source} ${option} $@"; break ;; esacdone
I.e the unrecognized arguments are added to the list of source files which is later submitted to the xorriso -as mkisofs emulation:
Quoted 7 lines
# build iso image "${xorriso}" -as mkisofs ... ${source}Among the xorriso arguments, the "--" has the effect that xorriso will leave mkisofs emulation and interpret the following arguments as its native commands and their parameters.
Ah, right, sorry.
Quoted 8 lines
But the new C code obviously thinks too much when seeing single-dash arguments, which it should handle as xorriso arguments. And it eats "--". At least if it is the first non-mkrescue argument.
So:
Quoted 7 lines
What argument interpretation behavior is grub-mkrescue 2.02 supposed to show ?
The one that is currently documented and matches grub-mkrescue.in of 2.00 ?
Or the one that is result of using
grub-core/gnulib/argp-parse.c?
Yes. It is standard behavior where everything after "--" is interpreted as non-option. You need it to avoid unknown option error from parser.
Quoted 2 lines
The latter would need to be explored and documented, then.
I think it is enough to say that everything after first "--" is passed onto xorriso. The fact that second "--" will enter native xorriso is documented in xorriso manual; anyone who would like to make use of this feature probably knows it.
Hi,
Quoted 4 lines
I think it is enough to say that everything after first "--" is passed onto xorriso. The fact that second "--" will enter native xorriso is documented in xorriso manual; anyone who would like to make use of this feature probably knows it.
This becomes quite confusing by the fact that even before the first "--" the non-dashed arguments are interpreted as options of xorriso's mkisofs emulation.
(I understand this from the interaction via ARGP_KEY_ARG
between util/grub-mkrescue.c and grub-core/gnulib/argp-parse.c)
I would prefer to see a short mentioning that "--" has a special meaning for the mkisofs emulation too, and that the first "--" will not reach xorriso.
But again: Is this substantial change of user interface intentional ?
It makes the first "--" mandatory if any of xorriso's dashed arguments shall be used. This demand is new and surprising.
Have a nice day :)
Thomas
Quoted 6 lines · Colin Watson
Quoted 5 lines · Thomas Schmitt
Hi,
Quoted 1 line
+ mkrescue_args="${mkrescue_args} -- -no-pad"
This "--" is most probably not what you want.
Quoted 9 lines
[...]
Quoted 1 line
mkrescue_args="${mkrescue_args} -no-pad"This doesn't work for me:
+ pkgdatadir=. ./grub-mkrescue --output=/tmp/tmp.NiHozwqHYv --override-directory=./grub-core --rom-directory=/tmp/tmp.Z4Kx63yul8 --themes-directory=../../themes --compress=xz --fonts= --locales= --themes= -no-pad /boot/grub/grub.cfg=/tmp/tmp.pEYe6QbufK /boot/grub/testcase.cfg=/tmp/tmp.8OxC8koxHb ./grub-mkrescue: invalid option -- 'n'
Try 'grub-mkrescue --help' or 'grub-mkrescue --usage' for more information.
Hm, that's annoying that xorrisofs has single-dash long parameters. Perhaps we shouldn't use argp for parsing arguments in mkrescue but own, simpler code.
Quoted 2 lines
Thanks,
Hi,
Vladimir Serbinenko:
Quoted 1 line
Hm, that's annoying that xorrisofs has single-dash long parameters.
Inherited from mkisofs for the emulation.
(xorriso native commands are recognized with as many dashes
as you want.)
I could make it tolerate double-dash if this is desired.
Quoted 2 lines
Perhaps we shouldn't use argp for parsing arguments in mkrescue but own, simpler code.
My main question is whether you want the user interface of grub-mkrescue to change between GRUB2 versions 2.00 and 2.02.
If so, then let's make a plan for a new user documentation and determine what xorrisofs needs to learn in order to implement its share of that documentation.
If the user interface shall not change, then i propose to implement the semantics of the arguments loop of grub-mkrescue.in inside grub-mkrescue.c.
Have a nice day :)
Thomas
В Wed, 22 Jan 2014 16:12:26 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:
Quoted 12 lines · Colin Watson
Quoted 11 lines · Thomas Schmitt
Quoted 5 lines
Hi,
Quoted 1 line
+ mkrescue_args="${mkrescue_args} -- -no-pad"
This "--" is most probably not what you want.
[...]
Quoted 1 line
mkrescue_args="${mkrescue_args} -no-pad"This doesn't work for me:
Quoted 7 lines
Quoted 4 lines
+ pkgdatadir=. ./grub-mkrescue --output=/tmp/tmp.NiHozwqHYv --override-directory=./grub-core --rom-directory=/tmp/tmp.Z4Kx63yul8 --themes-directory=../../themes --compress=xz --fonts= --locales= --themes= -no-pad /boot/grub/grub.cfg=/tmp/tmp.pEYe6QbufK /boot/grub/testcase.cfg=/tmp/tmp.8OxC8koxHb ./grub-mkrescue: invalid option -- 'n'
Try 'grub-mkrescue --help' or 'grub-mkrescue --usage' for more information.Hm, that's annoying that xorrisofs has single-dash long parameters. Perhaps we shouldn't use argp for parsing arguments in mkrescue but own, simpler code.
TBO I do not think it is worth it. Intermixing native and xorrisofs options is probably not a good idea anyway from usability point of view. Passing non-option arguments still works as before; and for options it is custom to use "--" to disambiguate non-option arguments starting with dash (and xorrisofs options are non-option argument for grub-mkrescue).