Hi, last night I started to compile GRUB (because the Solaris bootloader isn't very beautiful and lilo does contain to many references to #include <linux/...>) under Solaris 9 /x86. I had success, but I had to do some things, to get there:
First: I can't compile with the native Sun Compiler (because the GRUB code too heavily relies on GNU CC, GNU MAKE, GNU AS and GNU LD). On the Solaris Companion CD, these tools are distributed, and will install under /opt/sfw. But: all the gnu tools do get a "g" in front (which is no problem for gcc and shouldn't be a problem for "gas", but as Linux most of the times does NOT use the "g" (as in "as", which normally, as distributed by the FSF, is standard "gas", and it because a problem with "objcopy" which is installed as "gobjcopy" under Solaris (Solaris does not have an "objcopy", so I do not understand that policy on the Software Companion CD... ;-(), I had to rename some of the "standard solaris tools", to be able to use the gnu tools. Who is the maintainer of the configure part of GRUB? Perhaps you can enhance that part? mv /opt/sfw/bin/gobjcopy /opt/sfw/bin/objcopy mv /usr/ccs/bin/ld /usr/ccs/bin/ld_old mv /opt/sfw/bin/gld /opt/sfw/bin/ld mv /usr/ccs/bin/as /usr/ccs/bin/as_old mv /opt/sfw/bin/gas /opt/sfw/bin/as mv /usr/ccs/bin/make /usr/ccs/bin/make_old mv /opt/sfw/bin/gmake /opt/sfw/bin/make mv /opt/SUNWspro/bin/cc /opt/SUNWspro/bin/cc_old mv /opt/sfw/bin/gcc /opt/sfw/bin/cc Then, as GRUB is partly linked dynamic (with shared libs!), I needed to add the LDFLAGS (because the ncurses lib is under /opt/sfw/lib, as Solaris does not have a ncurses lib, only curses, perhaps I could have used that...) So, here is my call to configure: LDFLAGS='-L/opt/sfw/lib -R/opt/sfw/lib' ./configure --enable-ext2fs --enable-fat --enable-ffs --enable-minix --enable-reiserfs --enable-vstafs --enable-jfs --enable-xfs --enable--gunzip --enable-md5-password --enable-packet-retransmission Then I had to patch file grub/asmstub.c because Solaris is SVR4, and therefore does not have the call cfmakeraw() A small search on google gave me: ============================================================================== *** grub/asmstub.c.orig Tue Dec 3 00:20:45 2002 --- grub/asmstub.c Wed Apr 2 22:42:23 2003 *************** *** 1131,1137 **** --- 1131,1145 ---- goto fail; /* Raw mode. */ + #if 0 cfmakeraw (&termios); + #else + termios.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); + termios.c_oflag &= ~OPOST; + termios.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); + termios.c_cflag &= ~(CSIZE|PARENB); + termios.c_cflag |= CS8; + #endif /* Set the speed. */ termios_speed = get_termios_speed (speed); ============================================================================== BTW: "__svr4__" and "sun" are defined... ;-) Now, I can compile, and start grub. Tonight I will try to see, whether I can really install that on the MBR and get something to boot... (I assume, bsd ufs might work, but I doubt that..., because of the slices in FDISK partitions...) Then, there are problems with the way, Solaris does handle disks (IDE, SCSI, Floppies) (I should have said: There are problems with the assumptions that GRUB makes on the setting up of disk devices... ;-)). Solaris uses:: /dev/rdiskette0 /dev/dsk/c0d0p0 (fdisk partition) /dev/dsk/c0d0s0 (solaris partition in the FDISK Partition with Solaris flag (IDE)) /dev/dsk/c0t0d0s0 (solaris partition in the FDISK Partition with Solaris flag (SCSI)) cntr 0, target 0 disk 0 slice 0 All the numbers are free! (but most start at 0, except the t0, which is the SCSI id!) t*d0 is used most of the times, as I haven't seen any LUNS on disk (wrong, big boxes, like EMC Symmetrix, IBm Shark will have something different like 0 here!). I've thoroughly scanned the handling in grub, and was amused to see an awful lot of assumptions, that are not documented: ONLY 8 IDE disks ONLY 16 SCSI disk (all at the same controller!) That's not the way, we should program things like that... ;-) Stay tuned... BTW: Anybody out there, who has grub in use "running from Solaris"? Not running from Linux to boot Solaris... (Yet, there is no Linux on that box... It's only Windows XP (because that came preinstalled) and Solaris9/x86 12/02 Matthias -- *********************************************************************** Matthias Pfützner Project Engineer - Community-Leader High End Server & High Availability Sun Professional Services Sun Microsystems GmbH Ampèrestraße 6 Tel: (++49 6103) 752-394 (x65394) 63225 Langen Fax: (++49 6103) 752-167 Germany mailto:[EMAIL PROTECTED] *********************************************************************** _______________________________________________ Bug-grub mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-grub