mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
installer: Help grub to find the right device to install itself on.
This commit is contained in:
@@ -510,6 +510,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
system("/bin/sed -e 's#/harddisk#/#g' -e 's#//#/#g' < /proc/mounts > /harddisk/etc/mtab");
|
||||
|
||||
/*
|
||||
* Generate device.map to help grub finding the device to install itself on.
|
||||
*/
|
||||
FILE *f = NULL;
|
||||
if (f = fopen("/harddisk/boot/grub/device.map", "w")) {
|
||||
fprintf(f, "(hd0) %s\n", hdparams.devnode_part);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
snprintf(commandstring, STRING_SIZE,
|
||||
"/usr/sbin/chroot /harddisk /usr/sbin/grub-install --no-floppy %s", hdparams.devnode_disk);
|
||||
if (runcommandwithstatus(commandstring, ctr[TR_INSTALLING_GRUB])) {
|
||||
|
||||
Reference in New Issue
Block a user