grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] grub-shell: Pass -no-pad to xorriso when building floppy images
@ 2014-01-16 12:49 Colin Watson
  2014-01-16 14:05 ` Thomas Schmitt
  0 siblings, 1 reply; 12+ messages in thread
From: Colin Watson @ 2014-01-16 12:49 UTC (permalink / raw)
  To: grub-devel

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(+)

diff --git a/ChangeLog b/ChangeLog
index b445f12..c0cc45e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-16  Colin Watson  <cjwatson@ubuntu.com>
+
+	* tests/util/grub-shell.in: Pass -no-pad to xorriso when building
+	floppy images, saving about 300KiB.
+
 2014-01-08  Colin Watson  <cjwatson@ubuntu.com>
 
 	* Makefile.util.def (grub-macbless): Change mansection to 8.
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
index d9a5253..6f13591 100644
--- a/tests/util/grub-shell.in
+++ b/tests/util/grub-shell.in
@@ -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}" \
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 12:49 [PATCH] grub-shell: Pass -no-pad to xorriso when building floppy images Colin Watson
@ 2014-01-16 14:05 ` Thomas Schmitt
  2014-01-16 14:53   ` Colin Watson
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-16 14:05 UTC (permalink / raw)
  To: grub-devel

Hi,

> +    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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 14:05 ` Thomas Schmitt
@ 2014-01-16 14:53   ` Colin Watson
  2014-01-16 16:17     ` Thomas Schmitt
  2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 12+ messages in thread
From: Colin Watson @ 2014-01-16 14:53 UTC (permalink / raw)
  To: The development of GNU GRUB

On Thu, Jan 16, 2014 at 03:05:44PM +0100, Thomas Schmitt wrote:
> Hi,
> 
> > +    mkrescue_args="${mkrescue_args} -- -no-pad"
> 
> This "--" is most probably not what you want.
[...]
>   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,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 14:53   ` Colin Watson
@ 2014-01-16 16:17     ` Thomas Schmitt
  2014-01-16 16:28       ` Thomas Schmitt
  2014-01-16 18:56       ` Thomas Schmitt
  2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 2 replies; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-16 16:17 UTC (permalink / raw)
  To: grub-devel

Hi,

> >   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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 16:17     ` Thomas Schmitt
@ 2014-01-16 16:28       ` Thomas Schmitt
  2014-01-16 18:21         ` Andrey Borzenkov
  2014-01-16 18:56       ` Thomas Schmitt
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-16 16:28 UTC (permalink / raw)
  To: grub-devel

Hi,

>   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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 16:28       ` Thomas Schmitt
@ 2014-01-16 18:21         ` Andrey Borzenkov
  0 siblings, 0 replies; 12+ messages in thread
From: Andrey Borzenkov @ 2014-01-16 18:21 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: scdbackup

В Thu, 16 Jan 2014 17:28:32 +0100
"Thomas Schmitt" <scdbackup@gmx.net> пишет:

> Hi,
> 
> >   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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 16:17     ` Thomas Schmitt
  2014-01-16 16:28       ` Thomas Schmitt
@ 2014-01-16 18:56       ` Thomas Schmitt
  2014-01-16 19:13         ` Andrey Borzenkov
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-16 18:56 UTC (permalink / raw)
  To: grub-devel

Hi,

> 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 ;;
     esac
  done

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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 18:56       ` Thomas Schmitt
@ 2014-01-16 19:13         ` Andrey Borzenkov
  2014-01-16 19:43           ` Thomas Schmitt
  0 siblings, 1 reply; 12+ messages in thread
From: Andrey Borzenkov @ 2014-01-16 19:13 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: scdbackup

В Thu, 16 Jan 2014 19:56:16 +0100
"Thomas Schmitt" <scdbackup@gmx.net> пишет:

> Hi,
> 
> > 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 ;;
>      esac
>   done
> 
> 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.
> 

Ah, right, sorry.

> 
> 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 ?

Yes. It is standard behavior where everything after "--" is interpreted
as non-option. You need it to avoid unknown option error from parser.

> 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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 19:13         ` Andrey Borzenkov
@ 2014-01-16 19:43           ` Thomas Schmitt
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-16 19:43 UTC (permalink / raw)
  To: grub-devel

Hi,

> 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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-16 14:53   ` Colin Watson
  2014-01-16 16:17     ` Thomas Schmitt
@ 2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-01-22 15:36       ` Thomas Schmitt
  2014-01-25 16:27       ` Andrey Borzenkov
  1 sibling, 2 replies; 12+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-01-22 15:12 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

On 16.01.2014 15:53, Colin Watson wrote:
> On Thu, Jan 16, 2014 at 03:05:44PM +0100, Thomas Schmitt wrote:
>> Hi,
>>
>>> +    mkrescue_args="${mkrescue_args} -- -no-pad"
>>
>> This "--" is most probably not what you want.
> [...]
>>   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.
> Thanks,
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 274 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2014-01-22 15:36       ` Thomas Schmitt
  2014-01-25 16:27       ` Andrey Borzenkov
  1 sibling, 0 replies; 12+ messages in thread
From: Thomas Schmitt @ 2014-01-22 15:36 UTC (permalink / raw)
  To: grub-devel

Hi,

Vladimir Serbinenko:
> 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.


> 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 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: grub-shell: Pass -no-pad to xorriso when building floppy images
  2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
  2014-01-22 15:36       ` Thomas Schmitt
@ 2014-01-25 16:27       ` Andrey Borzenkov
  1 sibling, 0 replies; 12+ messages in thread
From: Andrey Borzenkov @ 2014-01-25 16:27 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1426 bytes --]

В Wed, 22 Jan 2014 16:12:26 +0100
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> пишет:

> On 16.01.2014 15:53, Colin Watson wrote:
> > On Thu, Jan 16, 2014 at 03:05:44PM +0100, Thomas Schmitt wrote:
> >> Hi,
> >>
> >>> +    mkrescue_args="${mkrescue_args} -- -no-pad"
> >>
> >> This "--" is most probably not what you want.
> > [...]
> >>   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.


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).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-01-25 16:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 12:49 [PATCH] grub-shell: Pass -no-pad to xorriso when building floppy images Colin Watson
2014-01-16 14:05 ` Thomas Schmitt
2014-01-16 14:53   ` Colin Watson
2014-01-16 16:17     ` Thomas Schmitt
2014-01-16 16:28       ` Thomas Schmitt
2014-01-16 18:21         ` Andrey Borzenkov
2014-01-16 18:56       ` Thomas Schmitt
2014-01-16 19:13         ` Andrey Borzenkov
2014-01-16 19:43           ` Thomas Schmitt
2014-01-22 15:12     ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-22 15:36       ` Thomas Schmitt
2014-01-25 16:27       ` Andrey Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).