From nobody Sun Jul 10 21:34:45 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 63F4C1CFE537 for ; Sun, 10 Jul 2022 21:34:52 +0000 (UTC) (envelope-from freebsd-rj@cyclaero.com) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.smtp.rzone.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lh0fL71Jsz44Y7 for ; Sun, 10 Jul 2022 21:34:50 +0000 (UTC) (envelope-from freebsd-rj@cyclaero.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1657488889; s=strato-dkim-0002; d=cyclaero.com; h=Message-Id:In-Reply-To:To:References:Date:Subject:From:Cc:Date:From: Subject:Sender; bh=8u5opbHUh8/PQhNls3npLA/7U43Xg0eXgtl9YzmG0CY=; b=VFj2OaErbOMuOD/sX5tqlabI0eXcrmjoFPGF/z0K32c9kLh50bpTrzwLHdA9w/WURi BpkWGskU99/qgq1yUbMcaN/pReUCTQBZBNROP0G1mdYq5Ke8+eyLlb/ItlK7E9qVhftN PDiwVTInHeUI/zZIXJojFs4TPkYSpDQedijmWaiPheFLuqGb1OOdsvDj6UAEYshgTPLI KMprYOfiJn8Is+gOM0deX9FTNtK1DWLeHruU0dk7iEK/gsleDGLn6D3bLjfC4Nt0iQNK qe0CFEdlcMviUBujvXKqKPICHzkQ6tbBXVhRo9gyCP3ndRtqF6Y1O2H54YdljMfBmOXM NhpQ== X-RZG-AUTH: ":O2kGeEG7b/pS1F2rRHW2isrKl4DV03XBEi+I6ZuztdvN9wS3wFGySS4Lw+ldTBio08NTPnK5bNCibgxfnBg=" X-RZG-CLASS-ID: mo00 Received: from mail.obsigna.com by smtp.strato.de (RZmta 47.46.1 AUTH) with ESMTPSA id kcd9d5y6ALYnd2O (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sun, 10 Jul 2022 23:34:49 +0200 (CEST) Received: from rolf-mini.obsigna.com (unknown [177.95.254.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.obsigna.com (Postfix) with ESMTPSA id CE3B36393C for ; Sun, 10 Jul 2022 23:34:48 +0200 (CEST) From: "Dr. Rolf Jansen" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: Partition layout of ARM SD card images Date: Sun, 10 Jul 2022 18:34:45 -0300 References: <1F42EED0-B39F-4E33-986A-FB70A3AA4362@cyclaero.com> To: freebsd-arm In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.104.15) X-Rspamd-Queue-Id: 4Lh0fL71Jsz44Y7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cyclaero.com header.s=strato-dkim-0002 header.b=VFj2OaEr; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-rj@cyclaero.com designates 85.215.255.20 as permitted sender) smtp.mailfrom=freebsd-rj@cyclaero.com X-Spamd-Result: default: False [-2.00 / 15.00]; FROM_NAME_HAS_TITLE(1.00)[dr]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:85.215.255.0/24]; R_DKIM_ALLOW(-0.20)[cyclaero.com:s=strato-dkim-0002]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_NONE(0.00)[85.215.255.20:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm]; ASN(0.00)[asn:6724, ipnet:85.215.255.0/24, country:DE]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[cyclaero.com:+]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[cyclaero.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > Am 10.07.2022 um 17:48 schrieb Mark Millard : >=20 > On 2022-Jul-10, at 12:26, Dr. Rolf Jansen = wrote: >=20 >> For example let's have a llok on the partition layout of, = FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img (the others are similar): >>=20 >> # mdconfig -a -u 0 -t vnode -f = diskimg/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img >> # gpart show md0 md0s2 >>=20 >> =3D> 63 6291393 md0 MBR (3.0G) >> 63 2016 - free - (1.0M) >> 2079 102312 1 fat32lba [active] (50M) >> 104391 6187041 2 freebsd (3.0G) >> 6291432 24 - free - (12K) >>=20 >> =3D> 0 6187041 md0s2 BSD (3.0G) >> 0 57 - free - (29K) >> 57 6186880 1 freebsd-ufs (2.9G) >> 6186937 104 - free - (52K) >>=20 >> The start of the fat32 boot slice s1 (containing the u-boot) stuff is = neither aligned to 1M nor to 4k, it starts on an odd base. The start of = the BSD payload slice s2 and its size are odd as well. The padding of 57 = blocks within s2 lets the UFS partition start on a globally even base, = namely 104391+57 =3D 104448, which as a matter of fact is 4k aligned = (104448*512/4096 =3D 13056) and 1M aligned as well (104448*512/1024/1024 = =3D 51), however all this keeps looking strange. >>=20 >> Are there reasons for this partition layout besides making it look = more interesting? If yes, some insights would be good. >=20 > The layout details are more specific to the aarch64 RPi* context > than to general aarch64 SD card images. For example, the Rock64 > image is different: >=20 > # mdconfig -a -u 0 -t vnode -f = FreeBSD-14.0-CURRENT-arm64-aarch64-ROCK64-20220708-a0b956f5ac5-256605.img > # gpart show md0 > =3D> 40 6291376 md0 GPT (3.0G) > 40 32728 - free - (16M) > 32768 102400 1 efi (50M) > 135168 6156160 2 freebsd-ufs (2.9G) > 6291328 88 - free - (44K) This is a GPT table, while the others are still MBR. Images which come = with u-boot must have a different layout.=