From 2e1aefd1b4539a3d6cf03dbfa515eabf4de09f59 Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Tue, 26 Jul 2016 14:42:39 -0700 Subject: 7223 grub "setup" built-in broken by 6593 Reviewed by: Richard Lowe Reviewed by: Toomas Soome Reviewed by: Robert Mustacchi Approved by: Richard Lowe --- usr/src/grub/grub-0.97/stage2/builtins.c | 14 +++++++------- usr/src/grub/grub-0.97/stage2/filesys.h | 14 +++++++------- usr/src/grub/grub-0.97/stage2/fsys_ffs.c | 2 +- usr/src/grub/grub-0.97/stage2/fsys_jfs.c | 2 +- usr/src/grub/grub-0.97/stage2/fsys_reiserfs.c | 2 +- usr/src/grub/grub-0.97/stage2/fsys_ufs.c | 2 +- usr/src/grub/grub-0.97/stage2/fsys_ufs2.c | 2 +- usr/src/grub/grub-0.97/stage2/fsys_zfs.c | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/usr/src/grub/grub-0.97/stage2/builtins.c b/usr/src/grub/grub-0.97/stage2/builtins.c index 77800ff4b1..1c5d15ef2b 100644 --- a/usr/src/grub/grub-0.97/stage2/builtins.c +++ b/usr/src/grub/grub-0.97/stage2/builtins.c @@ -182,15 +182,15 @@ blocklist_func (char *arg, int flags) else { if (last_length == SECTOR_SIZE) - grub_printf ("%s%lld+%d", num_entries ? "," : "", + grub_printf ("%s%llu+%d", num_entries ? "," : "", start_sector - part_start, num_sectors); else if (num_sectors > 1) - grub_printf ("%s%lld+%d,%lld[0-%d]", num_entries ? "," : "", + grub_printf ("%s%llu+%d,%lld[0-%d]", num_entries ? "," : "", start_sector - part_start, num_sectors-1, start_sector + num_sectors-1 - part_start, last_length); else - grub_printf ("%s%;lld[0-%d]", num_entries ? "," : "", + grub_printf ("%s%llu[0-%d]", num_entries ? "," : "", start_sector - part_start, last_length); num_entries++; num_sectors = 0; @@ -236,7 +236,7 @@ blocklist_func (char *arg, int flags) /* The last entry may not be printed yet. Don't check if it is a * full sector, since it doesn't matter if we read too much. */ if (num_sectors > 0) - grub_printf ("%s%lld+%d", num_entries ? "," : "", + grub_printf ("%s%llu+%d", num_entries ? "," : "", start_sector - part_start, num_sectors); grub_printf ("\n"); @@ -1397,7 +1397,7 @@ embed_func (char *arg, int flags) char *device; char *stage1_5_buffer = (char *) RAW_ADDR (0x100000); int len, size; - int sector; + unsigned long long sector; stage1_5 = arg; device = skip_to (0, stage1_5); @@ -1480,7 +1480,7 @@ embed_func (char *arg, int flags) else { /* Embed it in the bootloader block in the filesystem. */ - int start_sector; + unsigned long long start_sector; /* Open the partition. */ if (! open_device ()) @@ -1505,7 +1505,7 @@ embed_func (char *arg, int flags) return 1; grub_printf (" %d sectors are embedded.\n", size); - grub_sprintf (embed_info, "%d+%d", sector - part_start, size); + grub_sprintf (embed_info, "%llu+%d", sector - part_start, size); return 0; } diff --git a/usr/src/grub/grub-0.97/stage2/filesys.h b/usr/src/grub/grub-0.97/stage2/filesys.h index 94c23bf5de..2cf07188d8 100644 --- a/usr/src/grub/grub-0.97/stage2/filesys.h +++ b/usr/src/grub/grub-0.97/stage2/filesys.h @@ -25,7 +25,7 @@ int ffs_mount (void); int ffs_read (char *buf, int len); int ffs_dir (char *dirname); -int ffs_embed (int *start_sector, int needed_sectors); +int ffs_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_FFS_NUM 0 #endif @@ -35,7 +35,7 @@ int ffs_embed (int *start_sector, int needed_sectors); int ufs_mount (void); int ufs_read (char *buf, int len); int ufs_dir (char *dirname); -int ufs_embed (int *start_sector, int needed_sectors); +int ufs_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_UFS_NUM 0 #endif @@ -45,7 +45,7 @@ int ufs_embed (int *start_sector, int needed_sectors); int ufs2_mount (void); int ufs2_read (char *buf, int len); int ufs2_dir (char *dirname); -int ufs2_embed (int *start_sector, int needed_sectors); +int ufs2_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_UFS2_NUM 0 #endif @@ -55,7 +55,7 @@ int ufs2_embed (int *start_sector, int needed_sectors); int zfs_mount (void); int zfs_read (char *buf, int len); int zfs_open (char *dirname); -int zfs_embed (int *start_sector, int needed_sectors); +int zfs_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_ZFS_NUM 0 #endif @@ -92,7 +92,7 @@ int minix_dir (char *dirname); int reiserfs_mount (void); int reiserfs_read (char *buf, int len); int reiserfs_dir (char *dirname); -int reiserfs_embed (int *start_sector, int needed_sectors); +int reiserfs_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_REISERFS_NUM 0 #endif @@ -111,7 +111,7 @@ int vstafs_dir (char *dirname); int jfs_mount (void); int jfs_read (char *buf, int len); int jfs_dir (char *dirname); -int jfs_embed (int *start_sector, int needed_sectors); +int jfs_embed (unsigned long long *start_sector, int needed_sectors); #else #define FSYS_JFS_NUM 0 #endif @@ -173,7 +173,7 @@ struct fsys_entry int (*read_func) (char *buf, int len); int (*dir_func) (char *dirname); void (*close_func) (void); - int (*embed_func) (int *start_sector, int needed_sectors); + int (*embed_func) (unsigned long long *start_sector, int needed_sectors); }; #ifdef STAGE1_5 diff --git a/usr/src/grub/grub-0.97/stage2/fsys_ffs.c b/usr/src/grub/grub-0.97/stage2/fsys_ffs.c index 2af53334f9..dd8cc71992 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_ffs.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_ffs.c @@ -290,7 +290,7 @@ loop: } int -ffs_embed (int *start_sector, int needed_sectors) +ffs_embed (unsigned long long *start_sector, int needed_sectors) { /* XXX: I don't know if this is really correct. Someone who is familiar with BSD should check for this. */ diff --git a/usr/src/grub/grub-0.97/stage2/fsys_jfs.c b/usr/src/grub/grub-0.97/stage2/fsys_jfs.c index 307f83633c..1b90fa1cd7 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_jfs.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_jfs.c @@ -384,7 +384,7 @@ jfs_dir (char *dirname) } int -jfs_embed (int *start_sector, int needed_sectors) +jfs_embed (unsigned long long *start_sector, int needed_sectors) { struct jfs_superblock super; diff --git a/usr/src/grub/grub-0.97/stage2/fsys_reiserfs.c b/usr/src/grub/grub-0.97/stage2/fsys_reiserfs.c index d07ab2f675..cd98b0ed27 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_reiserfs.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_reiserfs.c @@ -1213,7 +1213,7 @@ reiserfs_dir (char *dirname) } int -reiserfs_embed (int *start_sector, int needed_sectors) +reiserfs_embed (unsigned long long *start_sector, int needed_sectors) { struct reiserfs_super_block super; int num_sectors; diff --git a/usr/src/grub/grub-0.97/stage2/fsys_ufs.c b/usr/src/grub/grub-0.97/stage2/fsys_ufs.c index 88db5f392c..c77506cf0a 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_ufs.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_ufs.c @@ -136,7 +136,7 @@ ufs_read(char *buf, int len) } int -ufs_embed (int *start_sector, int needed_sectors) +ufs_embed (unsigned long long *start_sector, int needed_sectors) { if (needed_sectors > 14) return 0; diff --git a/usr/src/grub/grub-0.97/stage2/fsys_ufs2.c b/usr/src/grub/grub-0.97/stage2/fsys_ufs2.c index 698aca4e55..cb765b971e 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_ufs2.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_ufs2.c @@ -311,7 +311,7 @@ loop: } int -ufs2_embed (int *start_sector, int needed_sectors) +ufs2_embed (unsigned long long *start_sector, int needed_sectors) { /* XXX: I don't know if this is really correct. Someone who is familiar with BSD should check for this. */ diff --git a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c index 5c3cf6c786..ead5947ab5 100644 --- a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c +++ b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c @@ -1888,7 +1888,7 @@ zfs_read(char *buf, int len) * No-Op */ int -zfs_embed(int *start_sector, int needed_sectors) +zfs_embed(unsigned long long *start_sector, int needed_sectors) { return (1); } -- cgit v1.2.3