------- Comment From <email address hidden> 2015-09-08 22:10 EDT-------
It seems grub2 doesn't support RAID arrays of this sort (which it handles as 'diskfilter'), at least not for writing (which is required by grub-install).
It fails here, in grub-install.c:
if (write_to_disk (ins_dev, imgfile))
grub_util_error ("%s", _("failed to copy Grub to the PReP partition"));
Here's a gdb session with a unstripped binary that I took from the package build and put in the installer's /target/usr/sbin/grub-install:
The pkg build path / binary (not stripped)
# file obj/grub-ieee1275/grub-install
obj/grub-ieee1275/grub-install: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=1b326c701ee38d75d8e8739062a79046eb5ddfad, not stripped
The gdb session:
# gdb
...
(gdb) file /usr/sbin/grub-install
Reading symbols from /usr/sbin/grub-install...done.
(gdb) b grub_disk_write
Breakpoint 1 at 0x1013660c: file ../../grub-core/lib/disk.c, line 61.
(gdb) run --force /dev/md0p1
Starting program: /usr/sbin/grub-install --force /dev/md0p1
...
Installing for powerpc-ieee1275 platform.
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
Breakpoint 1, grub_disk_write (disk=0x101e4a30, sector=0, offset=0,
size=96212, buf=0x10d99960) at ../../grub-core/lib/disk.c:61
(gdb) b transform_sector
Breakpoint 2 at 0x10134b00: transform_sector. (2 locations)
(gdb) c
Continuing.
Breakpoint 2, transform_sector (disk=0x101e4a30, sector=34)
at ../../grub-core/lib/../kern/disk_common.c:45
(gdb) s
46 in ../../grub-core/lib/../kern/disk_common.c
(gdb) s
grub_diskfilter_write (disk=0x101e4a30, sector=34, size=187,
buf=0x10d99960 "\177ELF\001\002\001")
at ../../grub-core/disk/diskfilter.c:821
(gdb) s
grub_error (n=GRUB_ERR_NOT_IMPLEMENTED_YET,
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-core/kern/err.c:41
(gdb) fin
Run till exit from #0 grub_error (n=GRUB_ERR_NOT_IMPLEMENTED_YET,
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-core/kern/err.c:41
0x0000000010159ffc in grub_diskfilter_write (disk=0x101e4a30, sector=34,
size=187, buf=0x10d99960 "\177ELF\001\002\001")
at ../../grub-core/disk/diskfilter.c:821
Value returned is $1 = GRUB_ERR_NOT_IMPLEMENTED_YET
(gdb) s
823 in ../../grub-core/disk/diskfilter.c
(gdb) s
grub_disk_write (disk=0x101e4a30, sector=34, offset=0, size=96212,
buf=0x10d99960) at ../../grub-core/lib/disk.c:135
(gdb) s
150 in ../../grub-core/lib/disk.c
(gdb) fin
Run till exit from #0 grub_disk_write (disk=0x101e4a30, sector=34, offset=0,
size=96212, buf=0x10d99960) at ../../grub-core/lib/disk.c:150
0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/grub/powerpc-ieee1275/core.elf")
at ../../util/grub-install.c:704
Value returned is $2 = GRUB_ERR_NOT_IMPLEMENTED_YET
(gdb) fin
Run till exit from #0 0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/grub/powerpc-ieee1275/core.elf")
at ../../util/grub-install.c:704
0x0000000010008684 in main (argc=3, argv=0x3ffffffffbd8)
at ../../util/grub-install.c:1824
1824 in ../../util/grub-install.c
Value returned is $3 = GRUB_ERR_NOT_IMPLEMENTED_YET
(gdb) s
1825 in ../../util/grub-install.c
(gdb) s
_ (str=0x10169f70 "failed to copy Grub to the PReP partition")
at ../../include/grub/i18n.h:56
------- Comment From <email address hidden> 2015-09-08 22:10 EDT-------
It seems grub2 doesn't support RAID arrays of this sort (which it handles as 'diskfilter'), at least not for writing (which is required by grub-install).
It fails here, in grub-install.c:
if (write_to_disk (ins_dev, imgfile))
grub_util_error ("%s", _("failed to copy Grub to the PReP partition"));
write_to_disk() fails in
err = grub_disk_write (dev->disk, 0, 0,
core_size, core_img);
grub_disk_write() fails in
if ((disk->dev->write) (disk, transform_sector (disk, sector),
n, buf) != GRUB_ERR_NONE)
goto finish;
and disk->dev->write() fails in
return grub_error (GRUB_ERR_ NOT_IMPLEMENTED _YET,
"diskfilter writes are not supported");
That is also present upstream: git.savannah. gnu.org/ cgit/grub. git/tree/ grub-core/ disk/diskfilter .c#n908
http://
That module (diskfilter.c) states in its heading:
/* diskfilter.c - module to read RAID arrays. */
So, to /read/ RAID arrays.. not /write/.
Here's a gdb session with a unstripped binary that I took from the package build and put in the installer's /target/ usr/sbin/ grub-install:
The pkg build path / binary (not stripped) ieee1275/ grub-install ieee1275/ grub-install: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[ sha1]=1b326c701 ee38d75d8e87390 62a79046eb5ddfa d, not stripped
# file obj/grub-
obj/grub-
The gdb session:
# gdb grub-install grub-install. ..done. core/lib/ disk.c, line 61. grub-install --force /dev/md0p1
...
(gdb) file /usr/sbin/
Reading symbols from /usr/sbin/
(gdb) b grub_disk_write
Breakpoint 1 at 0x1013660c: file ../../grub-
(gdb) run --force /dev/md0p1
Starting program: /usr/sbin/
...
Installing for powerpc-ieee1275 platform.
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
device node not found
Breakpoint 1, grub_disk_write (disk=0x101e4a30, sector=0, offset=0, core/lib/ disk.c: 61
size=96212, buf=0x10d99960) at ../../grub-
(gdb) b transform_sector
Breakpoint 2 at 0x10134b00: transform_sector. (2 locations)
(gdb) c
Continuing.
Breakpoint 2, transform_sector (disk=0x101e4a30, sector=34) core/lib/ ../kern/ disk_common. c:45 core/lib/ ../kern/ disk_common. c
at ../../grub-
(gdb) s
46 in ../../grub-
(gdb) s _write (disk=0x101e4a30, sector=34, size=187, 001\002\ 001") core/disk/ diskfilter. c:821
grub_diskfilter
buf=0x10d99960 "\177ELF\
at ../../grub-
(gdb) s ERR_NOT_ IMPLEMENTED_ YET, core/kern/ err.c:41
grub_error (n=GRUB_
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-
(gdb) fin ERR_NOT_ IMPLEMENTED_ YET, core/kern/ err.c:41 _write (disk=0x101e4a30, sector=34, 001\002\ 001") core/disk/ diskfilter. c:821
Run till exit from #0 grub_error (n=GRUB_
fmt=0x10194d10 "diskfilter writes are not supported")
at ../../grub-
0x0000000010159ffc in grub_diskfilter
size=187, buf=0x10d99960 "\177ELF\
at ../../grub-
Value returned is $1 = GRUB_ERR_ NOT_IMPLEMENTED _YET
(gdb) s core/disk/ diskfilter. c core/lib/ disk.c: 135 core/lib/ disk.c
823 in ../../grub-
(gdb) s
grub_disk_write (disk=0x101e4a30, sector=34, offset=0, size=96212,
buf=0x10d99960) at ../../grub-
(gdb) s
150 in ../../grub-
(gdb) fin core/lib/ disk.c: 150 grub/powerpc- ieee1275/ core.elf" ) grub-install. c:704 NOT_IMPLEMENTED _YET
Run till exit from #0 grub_disk_write (disk=0x101e4a30, sector=34, offset=0,
size=96212, buf=0x10d99960) at ../../grub-
0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/
at ../../util/
Value returned is $2 = GRUB_ERR_
(gdb) fin grub/powerpc- ieee1275/ core.elf" ) grub-install. c:704 fbd8) grub-install. c:1824 grub-install. c NOT_IMPLEMENTED _YET
Run till exit from #0 0x0000000010004c60 in write_to_disk (dev=0x10355fd0,
fn=0x101e80b0 "/boot/
at ../../util/
0x0000000010008684 in main (argc=3, argv=0x3fffffff
at ../../util/
1824 in ../../util/
Value returned is $3 = GRUB_ERR_
(gdb) s grub-install. c grub/i18n. h:56
1825 in ../../util/
(gdb) s
_ (str=0x10169f70 "failed to copy Grub to the PReP partition")
at ../../include/