From nobody Wed Nov 09 03:48:11 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 4N6WCc4Dj5z4YftJ for ; Wed, 9 Nov 2022 03:48:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-23.consmr.mail.gq1.yahoo.com (sonic303-23.consmr.mail.gq1.yahoo.com [98.137.64.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4N6WCb3XsCz4FsJ for ; Wed, 9 Nov 2022 03:48:27 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=oWg7D9iE; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.204 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667965705; bh=jjLGUO2VyiVyS35XverdXNTwj310LoDg0yeKEn2kwc4=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=oWg7D9iE7NRG+Hqm+po5dwjbYDgM0WeNSA0EjeikoHQRI3vV4Sgwas2W6sOTI4OLDYM819c0jiRgvL8Tdku6qON/0MLYa+1U5rDugH1UcV8oap0qJaQMsDTHo9i/a3vqYesWJ8ABBIGpHVC7geKKl5OMpqhDjBh/CUKd3MEgqHMBr48nE1gQMxK8fKNBoxS1imywtUssRx3cmp+MNKdn/wlU/khdKjr172l/dw7sG0PZb+G/H8CHhRq5nFq7K0rjAK7XZGfBKseVFMgE1GXycsnjblykoN9HpsBVLwH08aZhO7NStGPLCYNsdBw4+su/0LS4+c3AoAwCJdkmDUFUEg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667965705; bh=6Lffr1UbMNoR4UMMjO+iZ1+MUWsB4gUNE9tno3VCHz/=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=kNYth7arLRuc7wnD9BEqyNMjI8jtOnXdUZfJZL4f0hIMxYTquMr2VpZS8FN0D87Z0HQHPab82Yed7MsXiVi5YvZHUCuLoVtes/HAOQii82ayRQ3CFFK8PvA09tF74jnE9BfTWVkuS8KJh0WYQF3qbxKiVJuaepBRXk1NsCxMn3pinvRldDfHMVOT0AO5UaTTJnClGZSv3uXIh6UeXjc76q44+MKxG9f5qzQzAx/nQNuptZpYdL1LmjrWER8s4VClyrTyjoOwfUgBkf8p91KCqMYH7Aq0kogB/5k73evSqbFaw6EVWsNECF/hDG2qlHylhy7Qd1tt72MYr0lS13qYjg== X-YMail-OSG: REU_R0UVM1n_H5vlMU.GAzTMai7GqVY5UrrE0gglKdJiUZr6Ait31GIQOax5JAx 9HUqhVA1zCxe2WtsmhvQ7ca.ZRWimrcL0vU_xG50hrR0ZwfZ.HxpwK10idp45_X8YzMVQIjhk8tw .fnw5RRPnkG0JQUI2ezK7E1saSSICpKEiGxpIScg.yW7s1YJXSVrEtg2mrpuMhTFVwdAcwmPaUGP xEpmU_05LQuDwboAOkoSjBXTaDyLfm9pb1LqEPSkV87FKmstHxbc99Jr4_3veOr3_G.qUMh4tcq3 zV7iQXDx3Ci6fqdyrP1NvKHsYRj1WR4WQrl1B2YstRajBso4k2dz_.9kYrghGm9lp5TwPFyGa7ln 1.8TVg9Z73vi7Qx8IKLfG42oRLw2JbtZHGul7di5Xpscp7ZYOXgQIi1Hgk7iv7GxwAY7Im08iyWW 2vI0GhugBdjxGx4OkBntSwcIZaihsZWK6.zxjVd601gScV70TXFhc8oDyRq8pHWlJcRh7iOVmylc Cen4xCDxAbcDsab2mJJumLm0lBUuxbVwo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aI0w7sArSLODrBfTed6JT26Ybr7DOpPFbmG0QJvv 29ttxyh7kZ_DB_GROzZjndwuCtatxCfKlE.kQzh83s_PwiAMJfo5ARq67dBTYyDpZvmSGf1bZYFF wzstfgtRk9p0R7_0IoMaJutWjtZy.phJlRgpKi4Zalwx8QDuTTbWHtPFWfjM8DzLde4gA5OpxbQo KeHQ5ZdRZOIeczv7auQg.XqdXSd8ZpPbHGdsuXa.lPR6HDsS9LkoOEIsKLVfBGcwAqtFi2e4mKpX 8r8pabxDlAMC5kJZVan59VVs9DSuFnrRYq7mlZIrh5EhQKKZ3nKWCVRHZCFhlVTnSC62irG7gBYJ 1XvnlZ21cTKZ3QvxJ2odI9ECvdUVR.vJ1cB7nwrfFi3MGgL.qIykxPQtp07IgcWmrhw5GdyvdvKU _an0i67ice.LjqP6fgraupFNkPCmSpbfPXBbjFo7_ALeyfOLSsSqa7KxNTmOY0P3VcgDXiKV8Enm XSbAk4BbI_IoINlN5j8IFQ19rjEdrlWGOsPJ_EcWihMPOVGr5uySSaTp05agY03NDYFrh.PfVuvO DvONGfmgdQjaGQB0SBCfiAswtOCzRuze9Qx1Y7dVsTfS2svsZ5zt3OyLdfxteQdsJgRWr1NVCnDQ Knd5RBZNxfVFrf5.d4ZEiWYHraLxzDCmaOk6EHhU0GEU4JPpYY_AdNno88qJAIlFuC8tTiXQ.Cq0 bHP6YsZchnQgUCg-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Wed, 9 Nov 2022 03:48:25 +0000 Received: by hermes--production-gq1-579bc4bddd-kbwws (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 80af72f89e5b652ed5ac6a937921449f; Wed, 09 Nov 2022 03:48:21 +0000 (UTC) From: Mark Millard 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 16.0 \(3731.200.110.1.12\)) Subject: An example of installing the 13.1-RELEASE image for aarch64 RPI* but with a swap partition: steps to follow Message-Id: <0DEAD006-BF16-4D5F-B6D1-3B0F1A4D6D0A@yahoo.com> Date: Tue, 8 Nov 2022 19:48:11 -0800 Cc: Mike Karels To: bob prohaska , freebsd-arm X-Mailer: Apple Mail (2.3731.200.110.1.12) References: <0DEAD006-BF16-4D5F-B6D1-3B0F1A4D6D0A.ref@yahoo.com> X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.204:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.204:from] X-Rspamd-Queue-Id: 4N6WCb3XsCz4FsJ X-ThisMailContainsUnwantedMimeParts: N Note: Some details below are MBR specific (matching the original image) Note: I have included frequent "gpart show" or "gpart show -p" commands = and output. To get started I put the image on a 32 GiByte microsd card: # dd if=3DFreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img of=3D/dev/da4 bs=3D1m= conv=3Dfsync,sync status=3Dprogress After it finished . . . Boot to the microsd card, stopping in the loader to boot in a way that stops before the growfs but allows adjusting things: Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel] in 9 seconds... =20 Type '?' for a list of commands, 'help' for more detailed help. OK boot -s . . . Enter full pathname of shell or RETURN for /bin/sh: root@:/ # gpart show=20 =3D> 63 62333889 mmcsd0 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 1 fat32lba [active] (50M) 104391 6187041 2 freebsd (3.0G) 6291432 56042520 - free - (27G) =3D> 0 6187041 mmcsd0s2 BSD (3.0G) 0 57 - free - (29K) 57 6186880 1 freebsd-ufs (2.9G) 6186937 104 - free - (52K) =3D> 63 62333889 diskid/DISK-D8900C35 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 1 fat32lba [active] (50M) 104391 6187041 2 freebsd (3.0G) 6291432 56042520 - free - (27G) =3D> 0 6187041 diskid/DISK-D8900C35s2 BSD (3.0G) 0 57 - free - (29K) 57 6186880 1 freebsd-ufs (2.9G) 6186937 104 - free - (52K) # ls -Tld /dev/ufs/* crw-r----- 1 root operator 0x5e Nov 4 04:48:18 2022 /dev/ufs/rootfs root@:/ # gpart resize -i2 /dev/mmcsd0 GEOM_PART: mmcsd0s2 was automatically resized. Use `gpart commit mmcsd0s2` to save changes or `gpart undo mmcsd0s2` = to revert them. mmcsd0s2 resized root@:/ # gpart commit mmcsd0s2 root@:/ # gpart show =3D> 63 62333889 mmcsd0 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 1 fat32lba [active] (50M) 104391 62228537 2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 mmcsd0s2 BSD (30G) 0 57 - free - (29K) 57 6186880 1 freebsd-ufs (2.9G) 6186937 56041600 - free - (27G) =3D> 63 62333889 diskid/DISK-D8900C35 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 1 fat32lba [active] (50M) 104391 62228537 2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 diskid/DISK-D8900C35s2 BSD (30G) 0 57 - free - (29K) 57 6186880 1 freebsd-ufs (2.9G) 6186937 56041600 - free - (27G) root@:/ # # Ballpark: 3.0G + 27G - 3.5G =3D=3D 26.5G =3D=3D 26.5*1024*M = =3D=3D 27136M root@:/ # gpart resize -i1 -s27136M /dev/mmcsd0s2 mmcsd0s2a resized root@:/ # # gpart show -p =3D> 63 62333889 mmcsd0 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 mmcsd0s1 fat32lba [active] (50M) 104391 62228537 mmcsd0s2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 mmcsd0s2 BSD (30G) 0 57 - free - (29K) 57 55574528 mmcsd0s2a freebsd-ufs (27G) 55574585 6653952 - free - (3.2G) =3D> 63 62333889 diskid/DISK-D8900C35 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 diskid/DISK-D8900C35s1 fat32lba [active] (50M) 104391 62228537 diskid/DISK-D8900C35s2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 diskid/DISK-D8900C35s2 BSD (30G) 0 57 - free - (29K) 57 55574528 diskid/DISK-D8900C35s2a freebsd-ufs (27G) 55574585 6653952 - free - (3.2G) root@:/ # gpart add -tfreebsd-swap /dev/mmcsd0s2 mmcsd0s2b added root@:/ # gpart show -p =3D> 63 62333889 mmcsd0 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 mmcsd0s1 fat32lba [active] (50M) 104391 62228537 mmcsd0s2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 mmcsd0s2 BSD (30G) 0 57 - free - (29K) 57 55574528 mmcsd0s2a freebsd-ufs (27G) 55574585 2048 - free - (1.0M) 55576633 6651904 mmcsd0s2b freebsd-swap (3.2G) =3D> 63 62333889 diskid/DISK-D8900C35 MBR (30G) 63 2016 - free - (1.0M) 2079 102312 diskid/DISK-D8900C35s1 fat32lba [active] (50M) 104391 62228537 diskid/DISK-D8900C35s2 freebsd (30G) 62332928 1024 - free - (512K) =3D> 0 62228537 diskid/DISK-D8900C35s2 BSD (30G) 0 57 - free - (29K) 57 55574528 diskid/DISK-D8900C35s2a freebsd-ufs (27G) 55574585 2048 - free - (1.0M) 55576633 6651904 diskid/DISK-D8900C35s2b freebsd-swap (3.2G) root@:/ # exit Setting hostuuid: . . . Setting hostid: . . . Fast boot: skipping disk checks. Growing root partition to fill device mmcsd0s2 resized mmcsd0s2a resized gpart: arg0 'ufs/rootfs': Invalid argument super-block backups (for fsck_ffs -b #) at: . . . root@generic:~ # df -m Filesystem 1M-blocks Used Avail Capacity Mounted on /dev/ufs/rootfs 26273 2834 21336 12% / devfs 0 0 0 100% /dev /dev/msdosfs/MSDOSBOOT 49 24 25 49% /boot/msdos tmpfs 7663 0 7663 0% /tmp root@generic:~ # ls -Tld /dev/ufs/* crw-r----- 1 root operator 0x5e Nov 4 05:08:54 2022 /dev/ufs/rootfs root@generic:~ # echo "/dev/mmcsd0s2b none swap sw 0 = 0" >> /etc/fstab root@generic:~ # swapon -a swapon: adding /dev/mmcsd0s2b as swap device root@generic:~ # swapinfo Device 1K-blocks Used Avail Capacity /dev/mmcsd0s2b 3325952 0 3325952 0% root@generic:~ # more /etc/fstab # Custom /etc/fstab for FreeBSD embedded images /dev/ufs/rootfs / ufs rw 1 = 1 /dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 = 0 tmpfs /tmp tmpfs rw,mode=3D1777 0 = 0 /dev/mmcsd0s2b none swap sw 0 = 0 I've not done anything above to use a label instead of the hard coded /dev/mmcsd0s2b reference. So this would not boot nicely via a USB reader instead of the microsd card slot being used: different device name. So . . . root@generic:~ # glabel label -v swapspace /dev/mmcsd0s2b Metadata value stored on /dev/mmcsd0s2b. Done. root@generic:~ # vi /etc/fstab root@generic:~ # more /etc/fstab # Custom /etc/fstab for FreeBSD embedded images /dev/ufs/rootfs / ufs rw 1 = 1 /dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 = 0 tmpfs /tmp tmpfs rw,mode=3D1777 0 = 0 /dev/label/swapspace none swap sw 0 = 0 root@generic:~ # shutdown -r now . . . root@generic:~ # swapinfo Device 1K-blocks Used Avail Capacity /dev/label/swapspace 3325948 0 3325948 0% =3D=3D=3D Mark Millard marklmi at yahoo.com