All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Migrations to xorriso
@ 2010-05-19 12:01 Thomas Schmitt
  2010-05-19 12:13 ` Colin Watson
  2010-05-19 21:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 16+ messages in thread
From: Thomas Schmitt @ 2010-05-19 12:01 UTC (permalink / raw)
  To: grub-devel

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

Hi,

would the following changes be acceptable for
grub-mkrescue ?

- Option  --xorriso=PROGFILE  allows to use a
  particular binary as xorriso program.
  This will avoid the need to install xorriso.
  One can just unpack and build it in some
  directory and use .../xorriso/xorriso
  as binary.

- Option --diet saves about 400 kB of image
  size without losing much benefit.

I attach an untested patch to illustrate the
intended changes.
If ok in principle, then i would do
beautifications and make some tests.

Nevertheless, a GRUB expert should make own
tests afterwards. So maybe Vladimir wants 
to take it just as proposal for an own 
more qualified change.


Have a nice day :)

Thomas

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

[-- Attachment #2: grub-mkrescue.in.ts.patch --]
[-- Type: text/x-patch, Size: 1777 bytes --]

--- grub-mkrescue.in	2010-05-18 10:02:06.000000000 +0200
+++ grub-mkrescue.in.ts	2010-05-19 13:53:18.000000000 +0200
@@ -38,6 +38,9 @@ efi32_dir=${libdir}/$(echo ${PACKAGE_TAR
 efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
 rom_directory=
 
+xorriso=xorriso
+diet=no
+
 # Usage: usage
 # Print the usage.
 usage () {
@@ -50,6 +53,8 @@ Make GRUB rescue image.
   --output=FILE           save output in FILE [required]
   --modules=MODULES       pre-load specified modules MODULES
   --rom-directory=DIR     save rom images in DIR [optional]
+  --xorriso=PROGFILE      use PROGFILE as xorriso program [optional]
+  --diet                  apply size reducing measures [optional]
 
 $0 generates a bootable rescue image with specified source files or directories.
 
@@ -78,6 +83,10 @@ for option in "$@"; do
 	PATH=${override_dir}:$PATH
 	export PATH
 	;;
+    --xorriso=*)
+	xorriso=`echo "${option}/" | sed 's/--xorriso=//'` ;;
+    --diet)
+	diet=yes ;;
     -*)
 	echo "Unrecognized option \`$option'" 1>&2
 	usage
@@ -254,7 +263,14 @@ if [ -e "${iso9660_dir}/boot/coreboot.el
 fi
 
 # build iso image
-xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} ${source}
+if [ "${diet}" = yes ]; then
+    if [ -e "${output_image}" ]; then
+        rm "${output_image}" || exit 1
+    fi
+    "${xorriso}" -report_about HINT -as mkisofs -graft-points -no-pad ${grub_mkisofs_arguments} --protective-msdos-label -r ${iso9660_dir} ${source} | cat >"${output_image}"
+else
+    "${xorriso}" -report_about HINT -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o "${output_image}" -r ${iso9660_dir} ${source}
+fi
 rm -rf ${iso9660_dir}
 
 rm -f ${embed_img}

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: Migrations to xorriso
@ 2010-05-20  9:30 Thomas Schmitt
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Schmitt @ 2010-05-20  9:30 UTC (permalink / raw)
  To: grub-devel

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

Hi,

attached is an updated patch to summarize my
current proposal for grub-mkrescue. 

My reply to mails of Vladimir and Seth seems
still stuck in eggs.gnu.org. (At least that
was the culprit last time.)

The current proposal follows Vladimir's idea:
> I'm thinking to allow passing arbitrary options to xorriso by just
> putting it on command line.

It would give the user control over option
-no-pad (saves 300 kB) and allow to switch from
mkisofs emulation to the native xorriso command
set.
 

-----------------------------------------------
New ponderings:
-----------------------------------------------

The following statement in the proposed help text
is due to the way how extra arguments are handled
via variable $source:

"Be aware that source paths must be single words.
 Quotation marks will not work."

If grub-mkrescue options would be prescribed to
precede any source paths or xorriso options, then
we could use a while loop, shift and "$@",
rather than a for loop and ${source}.

while test -n "$1"; do
    case "$1" in
    ...
    --modules=*)
        modules=`echo "$1" | sed 's/--modules=//'`
        shift
        ;;
    ...
    *)
        break ;;
    esac
done
...
${xorriso} ... "$@"


This would be safe for nearly all filenames.
(Newlines are still not allowed then.)

Question is whether support for apple-ish file
names is worth a change in the rules for
grub-mkrescue.


Have a nice day :)

Thomas

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

[-- Attachment #2: grub-mkrescue.in.ts2.patch --]
[-- Type: text/x-patch, Size: 1923 bytes --]

--- grub-mkrescue.in	2010-05-18 10:02:06.000000000 +0200
+++ grub-mkrescue.in.ts2	2010-05-20 09:34:56.000000000 +0200
@@ -38,6 +38,8 @@ efi32_dir=${libdir}/$(echo ${PACKAGE_TAR
 efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
 rom_directory=
 
+xorriso=xorriso
+
 # Usage: usage
 # Print the usage.
 usage () {
@@ -50,10 +52,15 @@ Make GRUB rescue image.
   --output=FILE           save output in FILE [required]
   --modules=MODULES       pre-load specified modules MODULES
   --rom-directory=DIR     save rom images in DIR [optional]
+  --xorriso=PROGFILE      use PROGFILE as xorriso program [optional]
 
-$0 generates a bootable rescue image with specified source files or directories.
+$0 generates a bootable rescue image with specified source files, source
+directories, or mkisofs options listed by: xorriso -as mkisofs -help
+Option -- switches to native xorriso command mode.
+Be aware that source paths must be single words. Quotation marks will not work.
 
 Report bugs to <bug-grub@gnu.org>.
+Mail xorriso support requests to <bug-xorriso@gnu.org>.
 EOF
 }
 
@@ -78,11 +85,8 @@ for option in "$@"; do
 	PATH=${override_dir}:$PATH
 	export PATH
 	;;
-    -*)
-	echo "Unrecognized option \`$option'" 1>&2
-	usage
-	exit 1
-	;;
+    --xorriso=*)
+	xorriso=`echo "${option}/" | sed 's/--xorriso=//'` ;;
     *)
 	source="${source} ${option}" ;;
     esac
@@ -254,7 +258,12 @@ if [ -e "${iso9660_dir}/boot/coreboot.el
 fi
 
 # build iso image
-xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} ${source}
+"${xorriso}" -report_about HINT -as mkisofs -graft-points \
+             ${grub_mkisofs_arguments} --protective-msdos-label -r \
+             --sort-weight 0 / --sort-weight 1 /boot \
+             -o "${output_image}" \
+             ${iso9660_dir} ${source}
+
 rm -rf ${iso9660_dir}
 
 rm -f ${embed_img}

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Migrations to xorriso
@ 2010-05-17 21:33 Vladimir 'φ-coder/phcoder' Serbinenko
  2010-05-18  8:49 ` Thomas Schmitt
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-05-17 21:33 UTC (permalink / raw)
  To: The development of GRUB 2

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

Hello, all. I would like to announce that as discussed before
grub-mkisofs was removed and we switched to xorriso.
In the same time grub-mkrescue is able to handle efi, coreboot and qemu.
In the later 2 cases you need to use a coreboot.elf/qemu.img as coreboot
payload/qemu rom. It can be found either on iso filesystem or in a
directory supplied by --rom-directory option

@Thomas: grub-mkisofs was partially translated. Could you look into
reusing translation strings for xorriso?

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



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

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

end of thread, other threads:[~2010-05-20 10:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 12:01 Migrations to xorriso Thomas Schmitt
2010-05-19 12:13 ` Colin Watson
2010-05-19 13:23   ` Thomas Schmitt
2010-05-19 21:02     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-19 18:40   ` Isaac Dupree
2010-05-19 19:34     ` Thomas Schmitt
2010-05-19 21:10       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-19 21:35         ` Seth Goldberg
2010-05-19 21:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2010-05-20  9:30 Thomas Schmitt
2010-05-17 21:33 Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-18  8:49 ` Thomas Schmitt
2010-05-18 12:50 ` Thomas Schmitt
2010-05-19 19:45 ` Thomas Schmitt
2010-05-19 21:23   ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-20  6:31     ` Thomas Schmitt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.