From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 8 11:21:06 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 311D6623 for ; Sun, 8 Dec 2013 11:21:06 +0000 (UTC) Received: from olymp.kibab.com (olymp6.kibab.com [IPv6:2a01:4f8:160:84c1::2]) by mx1.freebsd.org (Postfix) with ESMTP id E63D71CD0 for ; Sun, 8 Dec 2013 11:21:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 olymp.kibab.com EA4893F622 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kibab.com; s=default; t=1386501664; bh=m0AMcnLwt0Yt3qdwKz1UrB5egnsbFhZcX1YuS6bo05o=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=FQVTwD1jphGcSUWMgw4hJJjdVViSICUZpyLhvOJHPcTcGlYg49/A6Q3jhyQWk7aVm y9YIRAPXJpHMYid72lfyva772Z9AQzZFSAQUhkGi1PljYNWSieYS2zNwkXNUKxCcoT 5gkjQykNpp3VpuvqS3iyaAEvNTjBQsix72AgbWhQ= Message-ID: <52A4561F.8090900@kibab.com> Date: Sun, 08 Dec 2013 12:21:03 +0100 From: Ilya Bakulin MIME-Version: 1.0 To: Nick Hibma Subject: Re: NanoBSD update scripts are broken when using disk labels References: <52926BE0.8050003@kibab.com> <4615AB4C-9DA5-4475-BFB6-68964B4CFC0A@van-laarhoven.org> <330D2CBB-9A54-487D-B780-1936E8F58B74@van-laarhoven.org> In-Reply-To: <330D2CBB-9A54-487D-B780-1936E8F58B74@van-laarhoven.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 11:21:06 -0000 On 28.11.13, 11:00, Nick Hibma wrote: > On 28 Nov 2013, at 09:49, Nick Hibma wrote: > >> On 24 Nov 2013, at 22:13, Ilya Bakulin wrote: >> >>> After looking in the /root/updatep2 script I realized that it cannot >>> work when NANO_LABEL parameter >>> is set when building the NanoBSD image. >> >> The problem is that you need the device, not the UFS label to update the active partition. Attached the fixed updatep1 and updatep2 scripts. I’ve fixed exactly this problem yesterday to make booting from a USB thumb drive, and embedded CF card using the same image work. >> >> If you could test them, I’d be more than happy to commit them. > > The dev= line was incorrect in the scripts I provided. Try the attached files instead. Hi Nick, sorry for keeping silence. I was going to try your scripts when I have found another bug... But I suspect that you have made some modifications to nanobsd.sh as well. You check if the variable NANO_LABEL has some value after sourcing /etc/nanobsd.conf, but FreeBSD-standard nanobsd.sh doesn't write NANO_LABEL in the config file. Additionally, there is a problem that after dd'ing the image manually onto the correct partition, you won't have the required disk label on it. See: # glabel status -s ufs/FBSDFLTs3 N/A ada0s3 ufs/FBSDFLTs1a N/A ada0s1a ufsid/52a44002fa6458ff N/A ada0s2a The last entry is automatically generated UFSID label, because the _.disk.image that is generated from NanoBSD build doesn't have any label on it -- it is also logical, because the build system doesn't know which partition you will be upgrading. -- Ilya