From owner-freebsd-embedded@FreeBSD.ORG Sun Nov 24 21:13:07 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 494B94F3 for ; Sun, 24 Nov 2013 21:13:07 +0000 (UTC) Received: from olymp.kibab.com (olymp6.kibab.com [IPv6:2a01:4f8:160:84c1::2]) by mx1.freebsd.org (Postfix) with ESMTP id 11C6C25F4 for ; Sun, 24 Nov 2013 21:13:07 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.5.2 olymp.kibab.com 5C2F43F447 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kibab.com; s=default; t=1385327585; bh=yGyu4EoN6KpjHK186uHdP45GuuSKsEwMFcueNZaHtgM=; h=Date:From:To:Subject; b=g4AO1JC56kicLoZ+35CVMQnunnPsn0v6dDnh+FobQ4JetXbcystW6lndhK8w8Nn5Y lZQLctIOM7rKUkup+LJM6Mjk9PKti4VoHgVCZmjsdogu/L5GCz2JThVDleh4F25Kkk l6LniT+hWcdv34Mi/VNGsAcsQA/2so8q8LvABsDU= Message-ID: <52926BE0.8050003@kibab.com> Date: Sun, 24 Nov 2013 22:13:04 +0100 From: Ilya Bakulin MIME-Version: 1.0 To: "freebsd-embedded@freebsd.org" Subject: NanoBSD update scripts are broken when using disk labels Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2013 21:13:07 -0000 Hi list, I'm trying to build a NanoBSD image for the small Soekris net5501 board. Everything went well, including flashing on the CF card and then booting from the first partition. However after generating an update image I couln't flash it, update scripts don't work. After looking in the /root/updatep2 script I realized that it cannot work when NANO_LABEL parameter is set when building the NanoBSD image. I use NANO_LABEL="FBSDFLT", so after booting the system it has the following configuration: # uname -a FreeBSD fbsd-gs 11.0-CURRENT FreeBSD 11.0-CURRENT #0 af4d383(fbsd-gs)-dirty: Sun Nov 24 19:03:58 CET 2013 root@olymp.kibab.com:/stor0/jails/buildhost.kibab.com/usr/home/kibab/repos/freebsd-git/gs0/obj/i386.i386/stor0/jails/buildhost.kibab.com/usr/home/kibab/repos/freebsd-git/freebsd/sys/GS0 i386 ("dirty" is because I haven't committed GS0 kernel configuration file, the repository is clean) # cat /etc/nanobsd.conf NANO_DRIVE=ufs/FBSDFLT # glabel status Name Status Components ufs/FBSDFLTs3 N/A ada0s3 ufs/FBSDFLTs4 N/A ada0s4 ufs/FBSDFLTs1a N/A ada0s1a ufs/FBSDFLTs2a N/A ada0s2a # ls -1 /dev/ufs FBSDFLTs1a FBSDFLTs2a FBSDFLTs3 FBSDFLTs4 ... and here is the actual problem. The system doesn't create a separate entry for FBSDFLTs1 and FBSDFLTs2. The update scripts expect such entries to exist: # cat /root/updatep2 [... BSD license ...] . /etc/nanobsd.conf if mount | grep ${NANO_DRIVE}s2 > /dev/null ; then echo "You are running partition 2 already" echo "you probably want to use 'updatep1' instead" exit 1 fi # Blow away old system. dd if=/dev/zero of=/dev/${NANO_DRIVE}s2 bs=1m count=1 > /dev/null 2>&1 # Copy in new system dd of=/dev/${NANO_DRIVE}s2 obs=64k ---------------------------- So, it tries to `dd` to /dev/ufs/FBSDFLTs1 which doesn't exist. I haven't found a good way to resolve ufs/FBSDFLTs1a to ada0s1 (actually ada0s1 is the parent of ufs/FBSDFLTs1a). Maybe someone has a good solution for this? -- Ilya