Date: Fri, 24 Feb 2012 15:05:54 +0100 From: rank1seeker@gmail.com To: hackers@freebsd.org, "John Baldwin" <jhb@freebsd.org>, "Roman Divacky" <rdivacky@freebsd.org> Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) Message-ID: <20120224.140554.554.1@DOMY-PC> In-Reply-To: <201202230802.05083.jhb@freebsd.org> References: <20120217.074355.853.1@DOMY-PC> <201202230802.05083.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----=0D=0AFrom: John Baldwin = <jhb@freebsd.org>=0D=0ATo: freebsd-hackers@freebsd.org=0D=0ACc: = rank1seeker@gmail.com, Roman Divacky <rdivacky@freebsd.org>=0D=0ADate: = Thu, 23 Feb 2012 08:02:04 -0500=0D=0ASubject: Re: BUG: 9.0 stage 2 boot = (/boot/boot)=0D=0A=0D=0A> On Friday, February 17, 2012 2:43:55 am = rank1seeker@gmail.com wrote:=0D=0A> > Anyway, after upgrading to 9.0, my = USB stick, when created, started to hang =0D=0A> at stage 2 boot.=0D=0A> = > I have a custom setup, where BSD label 'a', has a content of = /boot/*=0D=0A> > So when 'a' is being hit by stage 2 boot, there is = boot.config waiting for =0D=0A> it.=0D=0A> > After it reads it and = displays it's content, it echos 'No' and hangs.=0D=0A> > =0D=0A> > I = stare at it and can't believe as boot.config's information is = correct!=0D=0A> > I hit '?' and it list all files in 'a'.=0D=0A> > Then I = simply RE-type what is displayed on screen (content of boot.config -> = =0D=0A> path to loader)=0D=0A> > And loader kicks in!=0D=0A> > =0D=0A> > = I do this a few times more and EACH time I have to RE-type correct = info!=0D=0A> > Tested on other machine, same thing.=0D=0A> > =0D=0A> > = However, this same custom layout works for HDD's, but NOT for USB = stick.=0D=0A> > =0D=0A> > I've extracted binary installs of 8.2 and 9.0 = R:=0D=0A> > MD5 (8_boot) =3D adb1e84e96bd434e51cafaaa0ef22584=0D=0A> > = MD5 (9_boot) =3D 40f3f6403ebd5e131259d1336b4b50ad=0D=0A> > =0D=0A> > = Then:=0D=0A> > # gpart bootcode -b 8_boot da0s2=0D=0A> > And sudenly that = USB stick boots, without ANY other change!=0D=0A> > Just an "old" stage 2 = boot code, from R8 was enough.=0D=0A> =0D=0A> Looks like it is thinking = that 'kname' is empty. Ah, I think Roman broke this=0D=0A> in = 219186:=0D=0A> =0D=0A> @@ -474,11 +461,7 @@ parse()=0D=0A> ? = DRV_HARD : 0) + drv;=0D=0A> dsk_meta =3D 0;=0D=0A> }=0D=0A> - = if ((i =3D ep - arg)) {=0D=0A> - if ((size_t)i >=3D = sizeof(kname))=0D=0A> - return -1;=0D=0A> - memcpy(kname, arg, i + = 1);=0D=0A> - }=0D=0A> + kname =3D arg;=0D=0A> }=0D=0A> = arg =3D p;=0D=0A> }=0D=0A> =0D=0A> Before it only set kname if it = wasn't an empty string. Now it always sets=0D=0A> kname. Try this = change:=0D=0A> =0D=0A> Index: boot2.c=0D=0A> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A> = --- boot2.c (revision 231983)=0D=0A> +++ boot2.c (working copy)=0D=0A> @@ = -457,7 +457,8 @@ parse()=0D=0A> ? DRV_HARD : 0) + drv;=0D=0A> = dsk_meta =3D 0;=0D=0A> }=0D=0A> - kname =3D arg;=0D=0A> = + if (*arg !=3D '\0')=0D=0A> + kname =3D arg;=0D=0A> }=0D=0A> = arg =3D p;=0D=0A> }=0D=0A> =0D=0A> -- =0D=0A> John Baldwin=0D=0A> = =0D=0A=0D=0A=0D=0AIt still doesn't work!=0D=0A=0D=0AAnd please, next time = attach patch in a file (unified format), so I would have a less hassle = (to avoid manuall patch application)=0D=0AThx in = advance.=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6=0D=0A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120224.140554.554.1>