From owner-freebsd-arm@freebsd.org Thu Jul 14 16:44:56 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37250B9960F for ; Thu, 14 Jul 2016 16:44:56 +0000 (UTC) (envelope-from karl@denninger.net) Received: from mail.denninger.net (denninger.net [70.169.168.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2D43159D for ; Thu, 14 Jul 2016 16:44:55 +0000 (UTC) (envelope-from karl@denninger.net) Received: from [192.168.1.40] (Karl-Desktop.Denninger.net [192.168.1.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.denninger.net (Postfix) with ESMTPSA id 8B292220FF0 for ; Thu, 14 Jul 2016 11:44:53 -0500 (CDT) Subject: Re: Bizarre clone attempt failures on Raspberry Pi2... To: freebsd-arm@freebsd.org References: <548783e1-9047-68f7-5f50-449db684d602@denninger.net> <5475ea53-ae22-2634-6f2a-5737d1b0e308@denninger.net> From: Karl Denninger Message-ID: <398ae56c-8893-f188-c210-cf7f19ccf433@denninger.net> Date: Thu, 14 Jul 2016 11:44:53 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5475ea53-ae22-2634-6f2a-5737d1b0e308@denninger.net> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms040705070201000600060102" X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 16:44:56 -0000 This is a cryptographically signed message in MIME format. --------------ms040705070201000600060102 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 7/13/2016 21:44, Karl Denninger wrote: > > On 7/13/2016 19:13, Paul Mather wrote: >>> On Jul 13, 2016, at 3:54 PM, Karl Denninger wrot= e: >>> >>> Oh, there is one difference: >>> >>> tunefs -p on the new device *works* (no idea why however since there'= s >>> no slice there) where it FAILS on the original: >>> >>> root@Test-MCP:/home/karl # tunefs -p /dev/mmcsd0s2 >> Shouldn't this be /dev/mmcsd0s2a? You're referencing the entire BSD s= lice in the above command, not the UFS partition upon which the rootfs li= ves. > Right. Here's the issue; it doesn't work on the original disk (as it > shouldn't) on the entire BSD slice but... >>> tunefs: /dev/mmcsd0s2: could not read superblock to fill out disk >>> >>> root@Test-MCP:/home/karl # tunefs -p /dev/da0s2 >>> tunefs: POSIX.1e ACLs: (-a) disabled >>> tunefs: NFSv4 ACLs: (-N) disabled >>> tunefs: MAC multilabel: (-l) disabled >>> tunefs: soft updates: (-n) enabled >>> tunefs: soft update journaling: (-j) disabled >>> tunefs: gjournal: (-J) disabled >>> tunefs: trim: (-t) disabled >>> tunefs: maximum blocks per file in a cylinder group: (-e) 4096 >>> tunefs: average file size: (-f) 16384 >>> tunefs: average number of files in a directory: (-s) 64 >>> tunefs: minimum percentage of free space: (-m) 8% >>> tunefs: space to hold for metadata blocks: (-k) 6408 >>> tunefs: optimization preference: (-o) time >>> tunefs: volume label: (-L) rootfs >> Cheers, >> >> Paul. > It DOES on the "clone"! > > It ALSO does on the "a" partition of the clone. > > This implies that gpart screwed up the partitioning, but THAT leaves > open how and why the original partitioning (which is defined here > https://wiki.freebsd.org/FreeBSD/arm/Raspberry%20Pi%202%20image) works > at all, since that's what I'm doing -- and yet it gives the results as > above (and no boot when I'm done.) > Ok, so what's broken here folks? This is likely to blow up soon enough on the build systems that the people who are building snapshot releases are using (once they update); I assume this is a function of some sort of change that was made somewhere upstream in the system. The format of the card has to be: 1. MBR 2. First partition is MSDOS (Type "!12") with the various boot code on it (ubldr, etc.) This is fine. 3. The second partition has to be a "BSD" format partition (old-style) 4. Inside the second partition is a "traditional" BSD labeled (bsdlabel style) partititon table. Up to #2 all goes fine on an attached SD card: # gpart show da0 =3D> 63 62552001 da0 MBR (30G) 63 102400 1 !12 (50M) 102463 62449601 - free - (30G) Now we try to create the BSD labeled piece -- I got this from the crochet disk blob creator, incidentally, along with the FreeBSD Wiki (at https://wiki.freebsd.org/FreeBSD/arm/Raspberry Pi 2 image) # gpart add -t freebsd -a 4m /dev/da0 da0s2 added # gpart create -s BSD /dev/da0s2 *gpart: geom 'da0s2': File exists* *Heh, what was that? :)* What's in here? # gpart show da0 =3D> 63 62552001 da0 MBR (30G) 63 102400 1 !12 [active] (50M) 102463 4033 - free - (2.0M) 106496 62439424 2 freebsd (30G) 62545920 6144 - free - (3.0M) Hmmmm... what do we think exists for device nodes? # ls -al /dev/da0* crw-r----- 1 root operator 0x61 Jul 13 20:28 /dev/da0 crw-r----- 1 root operator 0x64 Jul 14 15:23 /dev/da0s1 crw-r----- 1 root operator 0x66 Jul 14 15:23 /dev/da0s2 crw-r----- 1 root operator 0x67 Jul 14 15:23 /dev/da0s2a Wait a minute, I didn't create any BSD slices! WTF? # bsdlabel /dev/da0s2 # /dev/da0s2: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 62439424 0 4.2BSD 0 0 0 c: 62439424 0 unused 0 0 # "raw" part, don't edit_ _ Oh really? How'd that get in there? And by the way, that's probably why the "add" fails (no space left and the first partition already exists= ) Further, this is *also* why I can "tunefs" the base (/dev/da0s2) because there's no offset (that is, /dev/da0s2 and /dev/da0s2a both point to the same first block) and that may be why the system refuses to boot when I'm done, as it's "tasted" the first entry, found a label and thus it's "open". In fact, that gap is *exactly* what I see when I run bsdlabel on the running card: # bsdlabel /dev/mmcsd0s2 # /dev/mmcsd0s2: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 62443392 90 4.2BSD 0 0 0 c: 62443482 0 unused 0 0 # "raw" part, don't edit It looks like the issue is that the "gpart create -t freebsd" command stuck a partition table in there which causes the "create -s BSD" to fail= =2E Strategically dding /dev/zero to the card's first 100MB or so (beyond the DOS partition and into the label) and then *again* on the freebsd partition *but before calling gpart to put the slice table on* results in the add working properly. # gpart show da0 =3D> 63 62552001 da0 MBR (30G) 63 102400 1 !12 [active] (50M) 102463 4033 - free - (2.0M) 106496 62439424 2 freebsd (30G) 62545920 6144 - free - (3.0M) # gpart show da0s2 =3D> 0 62439424 da0s2 BSD (30G) 0 128 - free - (64K) 128 62439168 1 freebsd-ufs (30G) 62439296 128 - free - (64K) # tunefs -p /dev/da0s2 tunefs: /dev/da0s2: could not read superblock to fill out disk # tunefs -p /dev/da0s2a tunefs: POSIX.1e ACLs: (-a) disabled tunefs: NFSv4 ACLs: (-N) enabled tunefs: MAC multilabel: (-l) disabled tunefs: soft updates: (-n) enabled tunefs: soft update journaling: (-j) disabled tunefs: gjournal: (-J) disabled tunefs: trim: (-t) disabled tunefs: maximum blocks per file in a cylinder group: (-e) 4096 tunefs: average file size: (-f) 16384 tunefs: average number of files in a directory: (-s) 64 tunefs: minimum percentage of free space: (-m) 8% tunefs: space to hold for metadata blocks: (-k) 6408 tunefs: optimization preference: (-o) time tunefs: volume label: (-L) rootfs That looks valid and now matches the other card... but..... the new (duplicated) card still hangs in the same place..... It boots, the kernel loads, the root filesystem mounts and then the system hangs right after the ue0 MAC address displays on the console. How do you get the "why" on that since I have no way to break out of whatever it is hanging on (it ignores a ^C from a USB keyboard, although it *does* know it's there and the kernel displays attach/detach messages if you plug one in or out while it's hung) and there's no error message displayed that would otherwise help? --=20 Karl Denninger karl@denninger.net /The Market Ticker/ /[S/MIME encrypted email preferred]/ --------------ms040705070201000600060102 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHA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