Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
grub
grub-0.97-devicemap.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File grub-0.97-devicemap.diff of Package grub
Index: grub-0.97/grub/main.c =================================================================== --- grub-0.97.orig/grub/main.c +++ grub-0.97/grub/main.c @@ -44,7 +44,7 @@ int use_curses = 0; int verbose = 0; int read_only = 0; int floppy_disks = 1; -char *device_map_file = 0; +char *device_map_file = "/boot/grub/device.map"; static int default_boot_drive; static int default_install_partition; static char *default_config_file; Index: grub-0.97/lib/device.c =================================================================== --- grub-0.97.orig/lib/device.c +++ grub-0.97/lib/device.c @@ -515,6 +515,7 @@ read_device_map (FILE *fp, char **map, c probing devices. */ char buf[1024]; /* XXX */ int line_number = 0; + int retval = 0; /* default to failure */ while (fgets (buf, sizeof (buf), fp)) { @@ -541,14 +542,14 @@ read_device_map (FILE *fp, char **map, c if (*ptr != '(') { show_error (line_number, "No open parenthesis found"); - return 0; + continue; } ptr++; if ((*ptr != 'f' && *ptr != 'h') || *(ptr + 1) != 'd') { show_error (line_number, "Bad drive name"); - return 0; + continue; } if (*ptr == 'f') @@ -559,7 +560,7 @@ read_device_map (FILE *fp, char **map, c if (drive < 0) { show_error (line_number, "Bad device number"); - return 0; + continue; } else if (drive > 127) { @@ -575,7 +576,7 @@ read_device_map (FILE *fp, char **map, c if (*ptr != ')') { show_error (line_number, "No close parenthesis found"); - return 0; + continue; } ptr++; @@ -586,7 +587,7 @@ read_device_map (FILE *fp, char **map, c if (! *ptr) { show_error (line_number, "No filename found"); - return 0; + continue; } /* Terminate the filename. */ @@ -604,9 +605,11 @@ read_device_map (FILE *fp, char **map, c map[drive] = strdup (ptr); assert (map[drive]); + + retval = 1; /* at least 1 drive configured successfully */ } - return 1; + return retval; } /* Initialize the device map MAP. *MAP will be allocated from the heap @@ -845,7 +848,7 @@ write_to_partition (char **map, int driv int sector, int size, const char *buf) { char dev[PATH_MAX]; /* XXX */ - int fd; + int fd, len, pnum; if ((partition & 0x00FF00) != 0x00FF00) { @@ -863,7 +866,16 @@ write_to_partition (char **map, int driv if (strcmp (dev + strlen(dev) - 5, "/disc") == 0) strcpy (dev + strlen(dev) - 5, "/part"); } - sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1); + + len = strlen(dev); + pnum = ((partition >> 16) & 0xFF); + if (isdigit(dev[len-1])) + { + /* It is obviously some RAID disk: "/dev/<dsk>/c0d0" . "p1" */ + sprintf (dev + len, "p%d", pnum + 1); + } + else + sprintf (dev + len, "%d", pnum + 1); /* Open the partition. */ fd = open (dev, O_RDWR); Index: grub-0.97/util/grub-md5-crypt.in =================================================================== --- grub-0.97.orig/util/grub-md5-crypt.in +++ grub-0.97/util/grub-md5-crypt.in @@ -88,7 +88,7 @@ if test "x$password" != "x$password2"; t fi # Run the grub shell. -$grub_shell --batch --device-map=/dev/null <<EOF \ +$grub_shell --batch <<EOF \ | grep "^Encrypted: " | sed 's/^Encrypted: //' md5crypt $password
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor