From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Cc: Will Woods <will.woods@hp.com>
Subject: Re: aboot 0.9b
Date: Wed, 13 Nov 2002 16:54:54 -0700 [thread overview]
Message-ID: <20021113165454.A6733@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <200211131610.02464.will.woods@hp.com>; from will.woods@hp.com on Wed, Nov 13, 2002 at 04:10:02PM -0500
On Wed, Nov 13, 2002 at 04:10:02PM -0500, Will Woods wrote:
> There is a prerelease tarball of aboot 0.9b available here:
>
> http://aboot.sourceforge.net/tarballs/aboot-0.9bpre.tar.bz2
>
I do not see really much difference, with an exception of -fno-builtins
added flag, with what I was using in recent times. Anyway, it compiles
without fuss with my gcc-2.96-108.7.2.
Two comments though.
Helge Kreutzmann did quite a bit of updates to various aboot releated
manpages and annouced that on this list. Here is annoucement:
http://www.lib.uaa.alaska.edu/axp-list/archive/2002-09/0019.html
and here is the last version of updates:
http://www.itp.uni-hannover.de/%7Ekreutzm/data/aboot_manpages_20020904.tar.bz2
It seems that some of her work was included but why not all? Or this is
an older version of her stuff? Updates to aboot.8 and aboot.conf.8, in
particular, are missing.
The other thing is in a category of "convenient to have". This is
an extension which allows to load initrd from an ATAPI CD even if
booting from another device - like floppy. Not only this is much
faster but also allows for a bigger images then what you can fit
on a floppy. :-) It is used like that:
..... initrd=hdc:/image/ramdisk.img
Extending that to other devices, like SCSI CDs, would be possible but
not very "practical". Look at the code to see why. Probably covers
most often occuring nowadays cases. Partitions of IDE hard disks are a
bonus. :-) If somebody has ideas how to cleanly expand that this would
be nice. The patch is below (used "for real" for quite a while). It is
for 0.9a but it applies cleanly to the current code. This file did not
change at all.
Michal
diff -ur aboot-0.9a.orig/disk.c aboot-0.9a/disk.c
--- aboot-0.9a.orig/disk.c Tue Oct 9 14:45:57 2001
+++ aboot-0.9a/disk.c Tue Apr 16 17:38:14 2002
@@ -724,10 +724,19 @@
}
}
+#define BUFLEN 256
+
+/*
+ * Added code for loading initrd from ATAPI CD-ROM
+ * basically from H.M.Seo but with bug fixes. -- -mj
+ */
static long
load (long dev)
{
char *fname;
+ char envval[BUFLEN] = "";
+ char temp[BUFLEN] = "";
+ int i, partition = 0;
#ifdef DEBUG
printf("load(%lx)\n", dev);
@@ -758,10 +767,71 @@
if (initrd_file[0] == 0)
return 0;
- /* work around a bug in the ext2 code */
- bfs = mount_fs(dev, boot_part);
+ bfs = 0;
+ for ( i = 0; i < strlen(initrd_file); i++ )
+ {
+ if ( initrd_file[i] == ':' )
+ {
+ if ( strncmp(initrd_file, "hda", 3) == 0 )
+ strcpy(envval, "IDE 0 16 0 0 0 0 0");
+ else if ( strncmp(initrd_file, "hdb", 3) == 0 )
+ strcpy(envval, "IDE 0 16 0 1 1 0 0");
+ else if ( strncmp(initrd_file, "hdc", 3) == 0 )
+ strcpy(envval, "IDE 0 16 1 0 0 0 0");
+ else if ( strncmp(initrd_file, "hdd", 3) == 0 )
+ strcpy(envval, "IDE 0 16 1 1 1 0 0");
+ else {
+ printf("Not supported device for initrd \n");
+ break;
+ }
+
+ if ( i == 3 )
+ partition = 1;
+ else if ( i == 4 )
+ partition = (int)(initrd_file[3]) - '0';
+ else {
+ printf("aboot: initrd partition %s error, "
+ "only \"single digit\" partitions supported\n",
+ initrd_file);
+ return -1;
+ }
+
+ if ( partition >= 10 ) {
+ printf("aboot: initrd partition %d error \n",
+ partition);
+ return -1;
+ }
+
+ strcpy(temp, initrd_file);
+ /* shift it down and make sure it is terminated */
+ strncpy(initrd_file, &temp[i + 1], BUFLEN - 1 - i);
+ initrd_file[BUFLEN - 1 - i] = '\0';
+
+ printf("aboot: envval = %s, partition = %d, "
+ "initrd_file = %s \n",
+ envval, partition, initrd_file);
+ dev = cons_open(envval);
+ if (dev < 0) {
+ printf("aboot: unable to open initrd "
+ "device `%s': %lx\n", envval, dev);
+ return -1;
+ }
+ dev &= 0xffffffff;
+ get_disklabel(dev);
+ bfs = mount_fs(dev, partition);
+ break;
+ }
+ }
+ /* We try to open this if there was no ':' in initrd specification */
+ if ( 0 == bfs && 0 == partition) {
+ partition = boot_part;
+ /* work around a bug in the ext2 code */
+ bfs = mount_fs(dev, partition);
+ }
+
+
if (!bfs) {
- printf("aboot: mount of partition %d failed\n", boot_part);
+ printf("aboot: mount of partition %d failed\n", partition);
return -1;
}
if (read_initrd() < 0) {
next prev parent reply other threads:[~2002-11-13 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-13 21:10 aboot 0.9b Will Woods
2002-11-13 23:54 ` Michal Jaegermann [this message]
2002-11-14 4:40 ` Alan Young
2002-11-14 5:53 ` Michal Jaegermann
2002-11-14 7:57 ` Helge Kreutzmann
2002-11-14 16:57 ` Michal Jaegermann
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox