From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id EC83341976 for ; Wed, 13 Nov 2002 18:54:54 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gADNssn12973 for axp-list@listman.redhat.com; Wed, 13 Nov 2002 18:54:54 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gADNssD12969 for ; Wed, 13 Nov 2002 18:54:54 -0500 Received: from ellpspace.math.ualberta.ca (ellpspace.math.ualberta.ca [129.128.207.67]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gADNVdw04324 for ; Wed, 13 Nov 2002 18:31:39 -0500 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.11.6/8.11.6) id gADNssj06790; Wed, 13 Nov 2002 16:54:54 -0700 Date: Wed, 13 Nov 2002 16:54:54 -0700 From: Michal Jaegermann To: axp-list@redhat.com Cc: Will Woods Subject: Re: aboot 0.9b Message-ID: <20021113165454.A6733@ellpspace.math.ualberta.ca> References: <200211131610.02464.will.woods@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200211131610.02464.will.woods@hp.com>; from will.woods@hp.com on Wed, Nov 13, 2002 at 04:10:02PM -0500 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: 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) {