From ee62c427e51eb267ccc0e69823c1bb05ca75e2d6 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 12 Jun 2010 12:02:38 +0100 Subject: [PATCH 1/7] * util/grub-mkrescue.in (make_image): Remove sh module, which has been merged back into normal. --- ChangeLog | 5 +++++ util/grub-mkrescue.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab9415191..1def7af01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-06-12 Colin Watson + + * util/grub-mkrescue.in (make_image): Remove sh module, which has + been merged back into normal. + 2010-06-11 Colin Watson * include/grub/efi/uga_draw.h (GRUB_EFI_UGA_GLT_MAX): Rename to ... diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 61b0c94f7..ee269d692 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -173,7 +173,7 @@ EOF tar -C ${memdisk_dir} -cf ${memdisk_img} boot rm -rf ${memdisk_dir} $grub_mkimage -O ${platform} -d "${source_directory}" -m "${memdisk_img}" -o "$3" --prefix='(memdisk)/boot/grub' \ - search iso9660 configfile normal sh memdisk tar $4 + search iso9660 configfile normal memdisk tar $4 rm -rf ${memdisk_img} } From 57711df6adc0162ec00688faa809258ac0c0e91c Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 12 Jun 2010 13:20:21 +0200 Subject: [PATCH 2/7] custom.cfg support. * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 41_custom. * util/grub.d/41_custom.in: New file. --- ChangeLog | 7 +++++++ conf/common.rmk | 2 +- util/grub.d/41_custom.in | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 util/grub.d/41_custom.in diff --git a/ChangeLog b/ChangeLog index 1def7af01..f148d3204 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-12 Vladimir Serbinenko + + custom.cfg support. + + * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 41_custom. + * util/grub.d/41_custom.in: New file. + 2010-06-12 Colin Watson * util/grub-mkrescue.in (make_image): Remove sh module, which has diff --git a/conf/common.rmk b/conf/common.rmk index 3b9d1e5ce..bf73c2d59 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -201,7 +201,7 @@ CLEANFILES += grub-gettext_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 30_os-prober 40_custom +grub-mkconfig_SCRIPTS = 00_header 30_os-prober 40_custom 41_custom ifneq (, $(host_kernel)) grub-mkconfig_SCRIPTS += 10_$(host_kernel) endif diff --git a/util/grub.d/41_custom.in b/util/grub.d/41_custom.in new file mode 100644 index 000000000..64d691c55 --- /dev/null +++ b/util/grub.d/41_custom.in @@ -0,0 +1,7 @@ +#!/bin/sh +cat < Date: Sat, 12 Jun 2010 13:44:01 +0200 Subject: [PATCH 3/7] * util/grub-mkrescue.in: Add --sort-weight arguments to xorriso. Suggested by: Thomas Schmitt. --- ChangeLog | 5 +++++ util/grub-mkrescue.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f148d3204..9c8b21bd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-06-12 Vladimir Serbinenko + + * util/grub-mkrescue.in: Add --sort-weight arguments to xorriso. + Suggested by: Thomas Schmitt. + 2010-06-12 Vladimir Serbinenko custom.cfg support. diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index ee269d692..1c8bd8e67 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -269,7 +269,7 @@ if [ -e "${iso9660_dir}/boot/coreboot.elf" ] && [ -d "${rom_directory}" ]; then fi # build iso image -xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} ${source} +xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${source} rm -rf ${iso9660_dir} rm -f ${embed_img} From 25c56d29284144dfab0f01d843caede2a0315525 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 12 Jun 2010 13:47:08 +0200 Subject: [PATCH 4/7] * util/grub-mkrescue.in: Use -graft-points instead of -pathspecs. Suggested by: Thomas Schmitt. --- ChangeLog | 5 +++++ util/grub-mkrescue.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9c8b21bd3..798af2e7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-06-12 Vladimir Serbinenko + + * util/grub-mkrescue.in: Use -graft-points instead of -pathspecs. + Suggested by: Thomas Schmitt. + 2010-06-12 Vladimir Serbinenko * util/grub-mkrescue.in: Add --sort-weight arguments to xorriso. diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 1c8bd8e67..4d05893ba 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -269,7 +269,7 @@ if [ -e "${iso9660_dir}/boot/coreboot.elf" ] && [ -d "${rom_directory}" ]; then fi # build iso image -xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${source} +xorriso -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${source} rm -rf ${iso9660_dir} rm -f ${embed_img} From a60859731830306a20f2932fd352015bc83e870e Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 12 Jun 2010 13:54:35 +0200 Subject: [PATCH 5/7] * util/grub-mkrescue.in: Support --xorriso argument. --- ChangeLog | 4 ++++ util/grub-mkrescue.in | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 798af2e7f..a6a06053f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-06-12 Thomas Schmitt + + * util/grub-mkrescue.in: Support --xorriso argument. + 2010-06-12 Vladimir Serbinenko * util/grub-mkrescue.in: Use -graft-points instead of -pathspecs. diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 4d05893ba..90c031882 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -42,6 +42,8 @@ rom_directory= override_dir= grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +xorriso=xorriso + # Usage: usage # Print the usage. usage () { @@ -54,6 +56,7 @@ 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=FILE use FILE as xorriso [optional] --grub-mkimage=FILE use FILE as grub-mkimage $self generates a bootable rescue image with specified source files or directories. @@ -85,6 +88,8 @@ for option in "$@"; do ;; --grub-mkimage=*) grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + --xorriso=*) + xorriso=`echo "${option}/" | sed 's/--xorriso=//'` ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -269,7 +274,7 @@ if [ -e "${iso9660_dir}/boot/coreboot.elf" ] && [ -d "${rom_directory}" ]; then fi # build iso image -xorriso -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${source} +"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${source} rm -rf ${iso9660_dir} rm -f ${embed_img} From 1c8f0f8d11bb69b18501793f8c29c62644c0460c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mart=C3=ADn?= Date: Sat, 12 Jun 2010 14:50:07 +0200 Subject: [PATCH 6/7] * include/grub/types.h: Check for GRUB_CPU_SIZEOF_LONG when appropriate. --- ChangeLog | 4 ++++ include/grub/types.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6a06053f..8f85c127a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-06-12 Javier Martín + + * include/grub/types.h: Check for GRUB_CPU_SIZEOF_LONG when appropriate. + 2010-06-12 Thomas Schmitt * util/grub-mkrescue.in: Support --xorriso argument. diff --git a/include/grub/types.h b/include/grub/types.h index 6e9461f1d..a9e8adfd6 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -60,7 +60,7 @@ typedef signed char grub_int8_t; typedef short grub_int16_t; typedef int grub_int32_t; -#if GRUB_CPU_SIZEOF_VOID_P == 8 +#if GRUB_CPU_SIZEOF_LONG == 8 typedef long grub_int64_t; #else typedef long long grub_int64_t; @@ -69,7 +69,7 @@ typedef long long grub_int64_t; typedef unsigned char grub_uint8_t; typedef unsigned short grub_uint16_t; typedef unsigned grub_uint32_t; -#if GRUB_CPU_SIZEOF_VOID_P == 8 +#if GRUB_CPU_SIZEOF_LONG == 8 typedef unsigned long grub_uint64_t; #else typedef unsigned long long grub_uint64_t; @@ -98,7 +98,7 @@ typedef grub_uint32_t grub_size_t; typedef grub_int32_t grub_ssize_t; #endif -#if GRUB_CPU_SIZEOF_VOID_P == 8 +#if GRUB_CPU_SIZEOF_LONG == 8 # define GRUB_ULONG_MAX 18446744073709551615UL # define GRUB_LONG_MAX 9223372036854775807L # define GRUB_LONG_MIN (-9223372036854775807L - 1) From 7beac90c5f2a1b8af2e17b7922e0cdf7968046b1 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 12 Jun 2010 14:33:09 +0100 Subject: [PATCH 7/7] Avoid false positives in fs.lst, partmap.lst, and video.lst due to prototype declarations. * genmk.rb (PModule::rule): Define GRUB_LST_GENERATOR when generating fs, partmap, and video lists. * include/grub/fs.h (grub_fs_register): Omit prototype if GRUB_LST_GENERATOR is defined. * include/grub/partition.h (grub_partition_map_register): Likewise. * include/grub/video.h (grub_video_register): Likewise. --- ChangeLog | 12 ++++++++++++ genmk.rb | 6 +++--- include/grub/fs.h | 2 ++ include/grub/partition.h | 2 ++ include/grub/video.h | 2 ++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f85c127a..aababc845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-06-12 Colin Watson + + Avoid false positives in fs.lst, partmap.lst, and video.lst due to + prototype declarations. + + * genmk.rb (PModule::rule): Define GRUB_LST_GENERATOR when + generating fs, partmap, and video lists. + * include/grub/fs.h (grub_fs_register): Omit prototype if + GRUB_LST_GENERATOR is defined. + * include/grub/partition.h (grub_partition_map_register): Likewise. + * include/grub/video.h (grub_video_register): Likewise. + 2010-06-12 Javier Martín * include/grub/types.h: Check for GRUB_CPU_SIZEOF_LONG when appropriate. diff --git a/genmk.rb b/genmk.rb index e62dbd4f6..01b969ecf 100644 --- a/genmk.rb +++ b/genmk.rb @@ -228,7 +228,7 @@ VIDEOFILES += #{video} #{fs}: #{src} $(#{src}_DEPENDENCIES) genfslist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} -DGRUB_LST_GENERATOR $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) #{parttool}: #{src} $(#{src}_DEPENDENCIES) genparttoollist.sh @@ -238,7 +238,7 @@ VIDEOFILES += #{video} #{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} -DGRUB_LST_GENERATOR $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) #{handler}: #{src} $(#{src}_DEPENDENCIES) genhandlerlist.sh @@ -253,7 +253,7 @@ VIDEOFILES += #{video} #{video}: #{src} $(#{src}_DEPENDENCIES) genvideolist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} -DGRUB_LST_GENERATOR $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genvideolist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) " diff --git a/include/grub/fs.h b/include/grub/fs.h index 3368eb553..994eb8080 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -91,11 +91,13 @@ typedef int (*grub_fs_autoload_hook_t) (void); extern grub_fs_autoload_hook_t EXPORT_VAR(grub_fs_autoload_hook); extern grub_fs_t EXPORT_VAR (grub_fs_list); +#ifndef GRUB_LST_GENERATOR static inline void grub_fs_register (grub_fs_t fs) { grub_list_push (GRUB_AS_LIST_P (&grub_fs_list), GRUB_AS_LIST (fs)); } +#endif static inline void grub_fs_unregister (grub_fs_t fs) diff --git a/include/grub/partition.h b/include/grub/partition.h index 722c7b3e0..a23e94e07 100644 --- a/include/grub/partition.h +++ b/include/grub/partition.h @@ -77,12 +77,14 @@ char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partition); extern grub_partition_map_t EXPORT_VAR(grub_partition_map_list); +#ifndef GRUB_LST_GENERATOR static inline void grub_partition_map_register (grub_partition_map_t partmap) { grub_list_push (GRUB_AS_LIST_P (&grub_partition_map_list), GRUB_AS_LIST (partmap)); } +#endif static inline void grub_partition_map_unregister (grub_partition_map_t partmap) diff --git a/include/grub/video.h b/include/grub/video.h index 0a8fe1efe..faf2973ef 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -264,6 +264,7 @@ typedef struct grub_video_adapter *grub_video_adapter_t; extern grub_video_adapter_t EXPORT_VAR(grub_video_adapter_list); +#ifndef GRUB_LST_GENERATOR /* Register video driver. */ static inline void grub_video_register (grub_video_adapter_t adapter) @@ -271,6 +272,7 @@ grub_video_register (grub_video_adapter_t adapter) grub_list_push (GRUB_AS_LIST_P (&grub_video_adapter_list), GRUB_AS_LIST (adapter)); } +#endif /* Unregister video driver. */ static inline void