From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 24 14:05:58 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FE44106568B for ; Fri, 24 Feb 2012 14:05:58 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9118FC1C for ; Fri, 24 Feb 2012 14:05:56 +0000 (UTC) Received: by eaan10 with SMTP id n10so1050673eaa.13 for ; Fri, 24 Feb 2012 06:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:content-type :content-transfer-encoding:in-reply-to:references:x-mailer; bh=9fOowzpFrd1R+muoyquGGut4tMQzMNkhhStgdlIcRvo=; b=L7gSUIiZe646iunhgfEDEdtdmlCSLL3ZubifEMZwG5bmtwMzE7I7N/WDWrBmQlgdOW RrHQKSuMcGaSkClJc/6018jrhH63EJ0b8hbZrIc61tWOJiN6XlqAxbZsvCFh2dJShq2S ZYcULxPY8oMi7iTlEQcs7Qe154n3+x/2tMPUs= Received: by 10.14.100.142 with SMTP id z14mr1214485eef.58.1330092356058; Fri, 24 Feb 2012 06:05:56 -0800 (PST) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id n17sm18537374eei.3.2012.02.24.06.05.52 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 06:05:54 -0800 (PST) Message-ID: <20120224.140554.554.1@DOMY-PC> From: rank1seeker@gmail.com To: hackers@freebsd.org, "John Baldwin" , "Roman Divacky" Date: Fri, 24 Feb 2012 15:05:54 +0100 Content-Type: text/plain; charset="Windows-1250" Content-Transfer-Encoding: quoted-printable In-Reply-To: <201202230802.05083.jhb@freebsd.org> References: <20120217.074355.853.1@DOMY-PC> <201202230802.05083.jhb@freebsd.org> X-Mailer: POP Peeper (3.8.1.0) Cc: Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) 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: Fri, 24 Feb 2012 14:05:58 -0000 ----- Original Message -----=0D=0AFrom: John Baldwin = =0D=0ATo: freebsd-hackers@freebsd.org=0D=0ACc: = rank1seeker@gmail.com, Roman Divacky =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