From owner-freebsd-hackers@FreeBSD.ORG Sat May 15 12:01:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF8581065670 for ; Sat, 15 May 2010 12:01:40 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6E91C8FC1D for ; Sat, 15 May 2010 12:01:40 +0000 (UTC) Received: by fxm17 with SMTP id 17so2647202fxm.13 for ; Sat, 15 May 2010 05:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=XMYslNQZmwJTpnAF9mM7E0GyAVF8Y9nCg6YKZVQ0k7U=; b=gk2husYp4FO4420WNgp0CBpF4JZjS0MjI9Bv4CVp1TY3WPXMyJQkUGGkoRkj4zjDjF GcLWSp5gSSjvRmQEGGQe47xzpeiSPzWKCowZfVvnzgaQrEKu4K4pFgYY+AlSxtXtQfAq +nG988SWEmx/t0Dmncqn8wEfuo31YgQLdLXO8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NYEkIQHleTFaA/tvhwtiFUqGaAEIq7h/FXY4cQE5mwUep+9q7UKYib0bM1AA5H3JhP GTxFJKY4hZYp5CgJ+8rw+1FRjQxdf6S8hXHve0hn4/KmcvlXYoG9BGYGquoXqX8KOAVn 7+DSSF4RyGy/MTylU7RjCQGCmyzMom4dprjK0= MIME-Version: 1.0 Received: by 10.223.53.91 with SMTP id l27mr3130633fag.0.1273924899151; Sat, 15 May 2010 05:01:39 -0700 (PDT) Received: by 10.223.118.10 with HTTP; Sat, 15 May 2010 05:01:39 -0700 (PDT) In-Reply-To: <4BEDCB32.8070206@buffalo.edu> References: <20100513.205343.421.1@DEV> <201005132211.o4DMB4sG018935@fire.js.berklix.net> <4BEDCB32.8070206@buffalo.edu> Date: Sat, 15 May 2010 14:01:39 +0200 Message-ID: From: none none To: Ken Smith Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, "Julian H. Stacey" Subject: Re: Custom USB layout & sysinstall (Starting FIXIT) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2010 12:01:41 -0000 On Sat, May 15, 2010 at 12:14 AM, Ken Smith wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 5/14/10 1:16 PM, none none wrote: >> I've read it, all. >> What he is proposing, is about building our own image flavor. (make-mems= tick.sh) >> Exactly, that act, is an issue here, as it confuses sysinstall's USB det= ection. > > This part of what you say confuses me. =A0I use make-memstick.sh to build > the .img files people are downloading and using to do installs with. > So if you are using it correctly any machine that can use the .img > files I build and we distribute should be able to use what you > produce. Ah, I was unclear. When I've put "make-memstick.sh", in bracket, I was referring to similarity of steps. Not to the usage, of actual make-memstick.sh script. There are 2 types of customizations: A) Content (All in UFS) B) Layout (MBR, slices, boot code, bsdlabel,...) make-memstick.sh script is limited only to customization of A), so I am not using it. And shell command which I utilize are far more complex. I do A) and B) customizations, where B) is a culprit, that confuses sysinst= all. Focus on this: Official FreeBSD memstick.img once 'dd'-ed appears as da0a My edition appears as da0s2a ( because of me doing B) ) Once I turn on my machine, at boot time I select USB as a boot device. Then: BIOS -> MBR of da0 -> slice 2 -> boot loader -> sysinstall Now, while in sysinstall, I decide to go in Fixit mode. When I select a USB device, I get an error msg: "No USB devices found!" Other parts of sysinstall, DO list ad4 (my HDD) and da0 (my USB stick) correctly. >> There are 2 remedies: >> =A0 =A0 1) After loader prompt, INSTEAD of starting sysinstall (as I don= 't >> need it at all), immediately START Fixit >> =A0 =A0 2) Edit /usr/src/usr.sbin/sysinstall/devices.c, at the code line= s, >> posted below and compile sysinstall, so it could recognize USB device, >> on non default USB img layout. >> >> I favor FIRST solution 1). > > There are issues with us doing (1) in a widespread way because there > are hooks in sysinstall that check to see if it is running as init > and it makes lots of decisions based on that. =A0Booting off the install > media results in sysinstall running as init, while if you run it later > (post-install) it's not running as init. So then 2) /usr/src/usr.sbin/sysinstall/devices.c: Code: /* * Find all devices that match the criteria, allowing "wildcarding" as well * by allowing NULL or ANY values to match all. The array returned is static * and may be used until the next invocation of deviceFind(). */ Device ** deviceFind(char *name, DeviceType class) { static Device *found[DEV_MAX]; int i, j; j =3D 0; for (i =3D 0; i < numDevs; i++) { if ((!name || !strcmp(Devices[i]->name, name)) && (class =3D=3D DEVICE_TYPE_ANY || class =3D=3D Devices[i]->typ= e)) found[j++] =3D Devices[i]; } found[j] =3D NULL; return j ? found : NULL; }