diff --git a/ChangeLog b/ChangeLog index 1ded89247..a24c9e451 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,43 @@ +2010-10-26 Vladimir Serbinenko + + * util/grub-setup.c (setup): Refuse to do a cross-disk embeddingless + install rather than creating a broken install. + +2010-10-26 Vladimir Serbinenko + + * util/grub-setup.c (argp): Remove misleading example of installing to + a partition. + +2010-10-26 Vladimir Serbinenko + + * util/grub-setup.c (setup): Clarify the error message. + +2010-10-26 Vladimir Serbinenko + + * include/grub/types.h (grub_target_off_t): Removed no longer used type. + +2010-10-23 Vladimir Serbinenko + + * grub-core/kern/emu/misc.c + (grub_make_system_path_relative_to_its_root) + [HAVE_LIBZFS && HAVE_LIBNVPAIR]: Fix mountpoint return on ZFS. + +2010-10-23 Vladimir Serbinenko + + * grub-core/kern/emu/misc.c + (grub_make_system_path_relative_to_its_root): Revert r2882. + +2010-10-22 Vladimir Serbinenko + + * grub-core/lib/relocator.c (grub_relocator_subchunk): Remove now + useless field head. All users updated. + (free_subchunk): Correct handling of IN_REGION subchunk. + +2010-10-22 Colin Watson + + * docs/grub.texi (Installing GRUB using grub-install): Proofread. + (Supported kernels): Likewise. + 2010-10-18 Grégoire Sutre Make mktemp invocations portable. diff --git a/docs/grub.texi b/docs/grub.texi index 751dd9dc2..b37a5bfac 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -559,11 +559,12 @@ always. Therefore, GRUB provides you with a map file called the @dfn{device map}, which you must fix if it is wrong. @xref{Device map}, for more details. -On BIOS platforms GRUB has to use a so called embedding zone. On msdos -partition tables it's the space between MBR and first partition (called -MBR gap), on GPT partition it uses a BIOS Boot Partition (a partition -having type 21686148-6449-6e6f-744e656564454649). If you use GRUB on -BIOS be sure to supply at least 31 KiB of embedding zone (512KiB or more +On BIOS platforms GRUB has to use a so-called embedding zone. On msdos +partition tables, this is the space between the MBR and the first partition +(called the MBR gap or the boot track), while on GPT partition tables it +uses a BIOS Boot Partition (a partition with GUID +21686148-6449-6e6f-744e656564454649). If you use GRUB on a BIOS system, make +sure that the embedding zone is at least 31 KiB (512KiB or more recommended). If you still do want to install GRUB under a UNIX-like OS (such @@ -617,9 +618,9 @@ installation. The format is defined in @ref{Device map}. Please be quite careful. If the output is wrong, it is unlikely that your computer will be able to boot with no problem. -Some BIOSes have a bug of exposing first partition of USB pendrive as a floppy -instead of exposing pendrive as a hard disk (they call it ``USB-FDD'' boot) -In such cases you need to install as following: +Some BIOSes have a bug of exposing the first partition of a USB drive as a +floppy instead of exposing the USB drive as a hard disk (they call it +``USB-FDD'' boot). In such cases, you need to install like this: @example # @kbd{losetup /dev/loop0 /dev/sdb1} @@ -3295,7 +3296,7 @@ commands. @node Supported kernels @chapter Supported boot targets -X86 support is summarised in following table. ``Yes'' means that kernel works on the given platform, ``crashes'' means an early kernel crash which we hove will be fixed by concerned kernel developpers. ``no'' means GRUB doesn't load given kernel on a given platform. ``headless'' means that the kernel works but lacks console drivers (you can still use serial or network console). In case of ``no'' and ``crashes'' the reason is given in footnote. +X86 support is summarised in the following table. ``Yes'' means that the kernel works on the given platform, ``crashes'' means an early kernel crash which we hope will be fixed by concerned kernel developers. ``no'' means GRUB doesn't load the given kernel on a given platform. ``headless'' means that the kernel works but lacks console drivers (you can still use serial or network console). In case of ``no'' and ``crashes'' the reason is given in footnote. @multitable @columnfractions .50 .22 .22 @item @tab BIOS @tab Coreboot @item BIOS chainloading @tab yes @tab no (1) diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index cfc143bf9..c8b95443b 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -406,7 +406,25 @@ grub_make_system_path_relative_to_its_root (const char *path) /* buf is another filesystem; we found it. */ if (st.st_dev != num) - break; + { + /* offset == 0 means path given is the mount point. + This works around special-casing of "/" in Un*x. This function never + prints trailing slashes (so that its output can be appended a slash + unconditionally). Each slash in is considered a preceding slash, and + therefore the root directory is an empty string. */ + if (offset == 0) + { + free (buf); + free (buf2); +#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) + if (poolfs) + return xasprintf ("/%s/@", poolfs); +#endif + return xstrdup (""); + } + else + break; + } offset = p - buf; /* offset == 1 means root directory. */ @@ -434,10 +452,7 @@ grub_make_system_path_relative_to_its_root (const char *path) } #endif - /* This works around special-casing of "/" in Un*x. This function never - prints trailing slashes (so that its output can be appended a slash - unconditionally). Each slash in it is considered a preceding slash, - and therefore the root directory is an empty string. */ + /* Remove trailing slashes, return empty string if root directory. */ len = strlen (buf3); while (len > 0 && buf3[len - 1] == '/') { diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c index b1412e73a..90f6802d7 100644 --- a/grub-core/lib/relocator.c +++ b/grub-core/lib/relocator.c @@ -40,7 +40,6 @@ struct grub_relocator_subchunk #endif } type; grub_mm_region_t reg; - grub_mm_header_t head; grub_phys_addr_t start; grub_size_t size; grub_size_t pre_size; @@ -355,11 +354,11 @@ free_subchunk (const struct grub_relocator_subchunk *subchu) } case CHUNK_TYPE_IN_REGION: { - grub_mm_header_t h = (grub_mm_header_t) ALIGN_DOWN ((grub_addr_t) subchu->head, + grub_mm_header_t h = (grub_mm_header_t) ALIGN_DOWN ((grub_addr_t) subchu->start, GRUB_MM_ALIGN); h->size = ((subchu->start + subchu->size + GRUB_MM_ALIGN - 1) / GRUB_MM_ALIGN) - - (subchu->start / GRUB_MM_ALIGN); + - (subchu->start / GRUB_MM_ALIGN) - 1; h->next = h; h->magic = GRUB_MM_ALLOC_MAGIC; grub_free (h + 1); @@ -971,7 +970,6 @@ malloc_in_range (struct grub_relocator *rel, || typepre == CHUNK_TYPE_IN_REGION) { curschu->reg = events[last_start].reg; - curschu->head = events[last_start].head; curschu->pre_size = alloc_start - events[j - 1].pos; } if (!oom && (typepre == CHUNK_TYPE_REGION_START diff --git a/include/grub/types.h b/include/grub/types.h index 221fef3c0..e57666a10 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -84,12 +84,10 @@ typedef unsigned long long grub_uint64_t; /* Misc types. */ #if GRUB_TARGET_SIZEOF_VOID_P == 8 typedef grub_uint64_t grub_target_addr_t; -typedef grub_uint64_t grub_target_off_t; typedef grub_uint64_t grub_target_size_t; typedef grub_int64_t grub_target_ssize_t; #else typedef grub_uint32_t grub_target_addr_t; -typedef grub_uint32_t grub_target_off_t; typedef grub_uint32_t grub_target_size_t; typedef grub_int32_t grub_target_ssize_t; #endif diff --git a/util/grub-setup.c b/util/grub-setup.c index 8ab33590b..fa95f94aa 100644 --- a/util/grub-setup.c +++ b/util/grub-setup.c @@ -385,7 +385,7 @@ setup (const char *dir, if (! dest_partmap) { - grub_util_warn (_("Attempting to install GRUB to a partitionless disk. This is a BAD idea.")); + grub_util_warn (_("Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.")); goto unable_to_embed; } if (multiple_partmaps || fs) @@ -482,6 +482,12 @@ unable_to_embed: grub_util_error (_("embedding is not possible, but this is required when " "the root device is on a RAID array or LVM volume")); +#ifdef GRUB_MACHINE_PCBIOS + if (dest_dev->disk->id != root_dev->disk->id) + grub_util_error (_("embedding is not possible, but this is required for " + "cross-disk install")); +#endif + grub_util_warn (_("Embedding is not possible. GRUB can only be installed in this " "setup by using blocklists. However, blocklists are UNRELIABLE and " "their use is discouraged.")); @@ -822,7 +828,7 @@ Set up images to boot from DEVICE.\n\ \n\ You should not normally run this program directly. Use grub-install instead.") "\v"N_("\ -DEVICE must be an OS device (e.g. /dev/sda1)."), +DEVICE must be an OS device (e.g. /dev/sda)."), NULL, help_filter, NULL };