diff --git a/ChangeLog b/ChangeLog index ab9415191..aababc845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +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. + +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. + Suggested by: Thomas Schmitt. + +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. + + * 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 + 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/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/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/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) 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 diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index 61b0c94f7..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 @@ -173,7 +178,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} } @@ -269,7 +274,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}" -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} 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 <