From 9890706ed36aa6bfca8ad283fbe4dac12ecd692b Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Sun, 31 Jan 2016 15:39:20 +0100 Subject: 6593 want LBA48 support in grub Reviewed by: Josef 'Jeff' Sipek Reviewed by: Dan McDonald Reviewed by: Toomas Soome Approved by: Robert Mustacchi --- usr/src/cmd/boot/installgrub/installgrub.c | 11 +++++++++-- usr/src/cmd/boot/installgrub/installgrub.h | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'usr/src/cmd/boot') diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c index b01bcbd922..9611bc8a62 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.c +++ b/usr/src/cmd/boot/installgrub/installgrub.c @@ -21,8 +21,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 Toomas Soome + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1426,7 +1426,14 @@ prepare_stage2(ig_data_t *install, char *updt_str) i += 2; } } else { - /* Solaris VTOC */ + /* Solaris VTOC & EFI */ + if (device->start_sector > + UINT32_MAX - STAGE2_BLKOFF(device->type)) { + fprintf(stderr, gettext("Error: partition start sector " + "must be less than %lld\n"), + (uint64_t)UINT32_MAX - STAGE2_BLKOFF(device->type)); + return (BC_ERROR); + } stage2->first_sector = device->start_sector + STAGE2_BLKOFF(device->type); BOOT_DEBUG("stage2 first sector: %d\n", stage2->first_sector); diff --git a/usr/src/cmd/boot/installgrub/installgrub.h b/usr/src/cmd/boot/installgrub/installgrub.h index cf3f4f5a92..1608cb6398 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.h +++ b/usr/src/cmd/boot/installgrub/installgrub.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #ifndef _INSTALLGRUB_H @@ -43,7 +43,7 @@ typedef struct _device_data { int disk_fd; int slice; int partition; - uint32_t start_sector; + uint64_t start_sector; char boot_sector[SECTOR_SIZE]; } ig_device_t; -- cgit v1.2.3