From owner-freebsd-arm@freebsd.org Sun Feb 5 21:22:58 2017 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 43111CD2B4E for ; Sun, 5 Feb 2017 21:22:58 +0000 (UTC) (envelope-from karl@denninger.net) Received: from mail.denninger.net (denninger.net [70.169.168.7]) by mx1.freebsd.org (Postfix) with ESMTP id DC703D97 for ; Sun, 5 Feb 2017 21:22:57 +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 143B0627B6 for ; Sun, 5 Feb 2017 15:22:50 -0600 (CST) Subject: Re: NanoBSD config script for RPI2 To: "freebsd-arm@freebsd.org" References: <69c5a012-c1e7-c887-cd3b-ffcf78d8175e@denninger.net> <506d5c30-93f7-048e-2cde-d76bfaf76a8f@denninger.net> <1892E365-966E-4DFA-8DE0-9BAD584754A1@dsl-only.net> <41e02f9b-7884-1eec-b4e0-a32c962642b9@denninger.net> From: Karl Denninger Message-ID: Date: Sun, 5 Feb 2017 15:22:28 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <41e02f9b-7884-1eec-b4e0-a32c962642b9@denninger.net> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-512; boundary="------------ms080504040601000007000701" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2017 21:22:58 -0000 This is a cryptographically signed message in MIME format. --------------ms080504040601000007000701 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2/5/2017 10:53, Karl Denninger wrote: > On 2/4/2017 15:02, Mark Millard wrote: >> On 2017-Feb-4, at 10:56 AM, Karl Denninger > > wrote: >> >>> On 2/4/2017 10:38, Warner Losh wrote: >>>> On Sat, Feb 4, 2017 at 5:55 AM, Karl Denninger >>> denninger.net > wrote: >>>>> It fails here during image create.... >>>>> >>>>> Populating `/pics/CrossBuild/embedded/rpi2/_.s2' >>>>> Image `/pics/CrossBuild/embedded/rpi2/_.s2' complete >>>>> + [ -n s1 ] >>>>> + eval 's1=3Dfat16b' >>>>> + s1=3Dfat16b >>>>> + out=3D/pics/CrossBuild/embedded/images/_.disk.image.HD-MCP >>>>> + mkimg -a 3 -s mbr -p 'fat16b:=3D/pics/CrossBuild/embedded/rpi2/_.= s1' -p >>>>> 'freebsd >>>>> :=3D/pics/CrossBuild/embedded/rpi2/_.s2' -p >>>>> 'freebsd:=3D/pics/CrossBuild/embedded/rp >>>>> i2/_.s3' -o /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP >>>>> mkimg: invalid option -- a >>>>> mkimg: error: unknown option >>>>> >>>>> usage: mkimg >>>>> options: >>>>> --formats - list image formats >>>>> --schemes - list partition schemes >>>>> --version - show version information >>>>> >>>>> -b - file containing boot code >>>>> -c - capacity (in bytes) of the disk >>>>> -f >>>>> -o - file to write image into >>>>> -p >>>>> -s >>>>> -v - increase verbosity >>>>> -y - [developers] enable unit test >>>>> -H - number of heads to simulate >>>>> -P - physical sector size >>>>> -S - logical sector size >>>>> -T - number of tracks to simulate >>>>> >>>>> formats: >>>>> qcow - QEMU Copy-On-Write, version 1 >>>>> qcow2 - QEMU Copy-On-Write, version 2 >>>>> raw - Raw Disk >>>>> vhd - Virtual Hard Disk >>>>> vhdf - Fixed Virtual Hard Disk >>>>> vmdk - Virtual Machine Disk >>>>> >>>>> schemes: >>>>> apm - Apple Partition Map >>>>> bsd - BSD disk label >>>>> ebr - Extended Boot Record >>>>> gpt - GUID Partition Table >>>>> mbr - Master Boot Record >>>>> pc98 - PC-9800 disk partitions >>>>> vtoc8 - SMI VTOC8 disk labels >>>>> >>>>> Is the "-a" flag attempting to set the active partition? It appear= s >>>>> there's no option to do that in mkimg... >>>> Install a newer mkimg: >>>> >>>> Revision 307550 - (view) (download) (annotate) - [select for diffs] >> https://svnweb.freebsd.org/base/?pathrev=3D312669 shows that >> -r3125699 is from head. >> >> Looking around: stable/11 has not been updated for its mkimg. only >> head has -a added at this point. >> >>>> Modified Tue Oct 18 05:43:12 2016 UTC (3 months, 2 weeks ago) by imp= >>>> File length: 3730 byte(s) >>>> Diff to previous 307544 >>>> >>>> Add a new flag to mkimg (-a num) to specify the active partition for= >>>> those partitioning schemes that have this concept. Implement it as a= n >>>> override for mbr's setting 0x80 in the flags for the first partition= >>>> when we have boot code. >>>> >>>> Differential Revision: https://reviews.freebsd.org/D4403 >>>> >>>> Though maybe I should try to add it to the bootstrap tools so I can >>>> use a new one after the build. >>>> >>>> Warner >>>> >>> root@NewFS:/disk/karl # uname -v >>> FreeBSD 11.0-STABLE #15 r312669M: Mon Jan 23 14:01:03 CST 2017 =20 >> https://svnweb.freebsd.org/base/?pathrev=3D312669 shows that >> -r3125699 is from head, not from stable/11 . >> >> If you have a mix of head and stable/11 materials with mkimg from >> stable/11 then -a will not be present for mkimg. >> >>> karl@NewFS.denninger.net >>> :/usr/obj/usr/src/sys/KSD-SMP >>> root@NewFS:/disk/karl # which mkimg >>> /usr/bin/mkimg >>> root@NewFS:/disk/karl # pkg install mkimg >>> Updating FreeBSD repository catalogue... >>> FreeBSD repository is up-to-date. >>> All repositories are up-to-date. >>> pkg: No packages available to install matching 'mkimg' have been foun= d >>> in the repositories >>> root@NewFS:/disk/karl # >>> >>> So.... it's part of base and there is no obvious package (a check for= >>> ports in */*mkimg* fails too); my system is current as of Jan 23.... >>> >>> (As an aside I think if I remove the -a it may work on the Pi, since = the >>> Pi will try to boot the first partition which happens to be DOS -- I >>> think. I'll try it.) >>> >>> --=20 >>> Karl Denninger >>> karl@denninger.net >> denninger.net > >>> /The Market Ticker/ >>> /[S/MIME encrypted email preferred]/ >> >> =3D=3D=3D >> Mark Millard >> markmi at dsl-only.net >> > Manually setting the third partition to active does work to boot, but > the default partition settings for root and cfg are also wrong; you nee= d > these overrides or the mount of root fails on startup: > > # > # Partition layout for the Pi2 is: > # 1 =3D FAT16 boot (MSDOS) containing bootcode, ubldr, etc. > # 2 =3D CFG > # 3 =3D Root (must be separately marked active so ubldr can find it) > # 4 =3D Altroot > # > NANO_SLICE_CFG=3Ds2 > NANO_SLICE_ROOT=3Ds3 > NANO_SLICE_ALTROOT=3Ds4 > NANO_ROOT=3Ds3a > NANO_ALTROOT=3Ds4a > > I'm working on some other issues but this allows the unit to boot up an= d > start. You do need to mark the partition active manually but there's a= > workaround for the need to do that manually -- mount the image after > it's built in "common" and set the active flag using gpart: > > mdi=3D`mdconfig -f _.disk.image......` > gpart set -a active -i 3 $mdi > mdconfig -d -u $mdi > > Which works if used in place of the "-a...." argument to the mkimg > command. Perhaps this should be changed in the "common" script and mad= e > the general case, at least for 11-STABLE and before, since it should > work with pretty-much any version of FreeBSD and obviates the need for > the updated mkimg. As things stand right now a checkout of 11-STABLE > has a common script that relies on an updated mkimg that isn't present > in the system and thus will//not work. > > This is what I changed in common: > > case ${NANO_LAYOUT} in > std-embedded) > # mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p > ${s1}:=3D${NANO_LOG}/_.s1 \ > mkimg ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p > ${s1}:=3D${NANO_LOG}/_.s1 \ > -p ${s2}:=3D${NANO_LOG}/_.s2 \ > -p ${s3}:=3D${NANO_LOG}/_.s3 \ > -o ${out} > mdi=3D`mdconfig -f ${out}` > gpart show $mdi > gpart set -a active -i 3 $mdi > gpart show $mdi > mdconfig -d -u $mdi > ;; > > The two "shows" are (obviously) not necessary but result in log output > that shows the active flag successfully set. > > Partial output from _.di incorporating this change: > > Populating `/pics/CrossBuild/embedded/rpi2/_.s2' > Image `/pics/CrossBuild/embedded/rpi2/_.s2' complete > + [ -n s1 ] > + eval 's1=3Dfat16b' > + s1=3Dfat16b > + out=3D/pics/CrossBuild/embedded/images/_.disk.image.HD-MCP > + mkimg -s mbr -p 'fat16b:=3D/pics/CrossBuild/embedded/rpi2/_.s1' -p > 'freebsd:=3D/pics/CrossBuild/embedded/rpi2/_.s2' -p > 'freebsd:=3D/pics/CrossBuild/embedded/rpi2/_.s3' -o > /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP > + mdconfig -f /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP > + mdi=3Dmd0 > + gpart show md0 > =3D> 1 429840 md0 MBR (210M) > 1 65536 1 fat16 (32M) > 65537 65536 2 freebsd (32M) > 131073 298768 3 freebsd (146M) > > + gpart set -a active -i 3 md0 > active set on md0s3 > + gpart show md0 > =3D> 1 429840 md0 MBR (210M) > 1 65536 1 fat16 (32M) > 65537 65536 2 freebsd (32M) > 131073 298768 3 freebsd [active] (146M) > > + mdconfig -d -u md0 > + rm -f /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP.xz > + echo 'NANO RM -f /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP= =2Exz' > NANO RM -f /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP.xz > + uname -r > + command rm -x -f /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP= =2Exz > + xz -9 --keep /pics/CrossBuild/embedded/images/_.disk.image.HD-MCP > > > Onward I go... now I need to figure out how to get packages to work in = a > cross-compiled world, which might be a bit of a bigger problem since th= e > existing way it's done chroot's into the installed world, which of > course means that the "pkg" command is for the wrong architecture..... The above works -- almost. The system boots on first start, gets an IP address, sets time and such and then hangs here: =2E.... Mounting local filesystems:. ELF ldconfig path: /lib /usr/lib /usr/lib/compat Soft Float compatibility ldconfig path: Setting hostname: nanobsd-HD-MCP. Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,AT= TACH,CACHED Feeding entropy: eval: cannot create /boot/entropy: Read-only file system= smsc0: chip 0xec00, rev. 0002 ue0: link state changed to DOWN ue0: link state changed to UP Starting Network: lo0 ue0. lo0: flags=3D8049 metric 0 mtu 16384 options=3D600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 ue0: flags=3D8843 metric 0 mtu 15= 00 options=3D80009 ether b8:27:eb:be:e6:f8 media: Ethernet autoselect (100baseTX ) status: active nd6 options=3D29 Starting devd. Starting dhclient. DHCPDISCOVER on ue0 to 255.255.255.255 port 67 interval 7 DHCPOFFER from 192.168.1.200 DHCPREQUEST on ue0 to 255.255.255.255 port 67 DHCPACK from 192.168.1.200 bound to 192.168.1.216 -- renewal in 21600 seconds. add host 127.0.0.1: gateway lo0 fib 0: route already in table add host ::1: gateway lo0 fib 0: route already in table add net fe80::: gateway ::1 add net ff02::: gateway ::1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 Generating host.conf. Creating and/or trimming log files. Starting syslogd. Setting date via ntp. 5 Feb 21:03:24 ntpdate[464]: step time server 74.104.167.114 offset 301.729232 sec Clearing /tmp (X related). Updating motd:. Mounting late filesystems:. Configuring vt: blanktime. Starting cron. It does have the console requested on the serial interface, but I never get a login prompt. It doesn't appear to be hanging on the actual cron startup (I can't ^C out of it which would otherwise be the case.)=20 Networking is (obviously) running as it does get the time and I can ping it. This implies that I have no getty running, but "onifconsole" IS specified in the /etc/ttys file. This could get to be a bit fun trying to figure out why it's freezing during the startup and before an actual login prompt is produced -- or whether the "onifconsole" is being ignored in /etc/ttys (looks likely, but how to check?) Even more-interesting is that a (or other characters) typed at it while it's hung *does* echo..... Do I need "console=3Dcomconsole" in /boot/loader.conf? I would think setting the option in the nanobsd config file would generate that, but it does not appear to -- and it also doesn't appear to be necessary, because I do get all the boot messages on the serial console side. --=20 Karl Denninger karl@denninger.net /The Market Ticker/ /[S/MIME encrypted email preferred]/ --------------ms080504040601000007000701 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgMFADCABgkqhkiG9w0BBwEAAKCC BlwwggZYMIIEQKADAgECAgE9MA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzEQMA4G A1UECBMHRmxvcmlkYTESMBAGA1UEBxMJTmljZXZpbGxlMRkwFwYDVQQKExBDdWRhIFN5c3Rl bXMgTExDMRwwGgYDVQQDExNDdWRhIFN5c3RlbXMgTExDIENBMSIwIAYJKoZIhvcNAQkBFhND dWRhIFN5c3RlbXMgTExDIENBMB4XDTE2MTIxODE5NDUzNVoXDTIxMTIxNzE5NDUzNVowVzEL MAkGA1UEBhMCVVMxEDAOBgNVBAgTB0Zsb3JpZGExGTAXBgNVBAoTEEN1ZGEgU3lzdGVtcyBM TEMxGzAZBgNVBAMUEmthcmxAZGVubmluZ2VyLm5ldDCCAiIwDQYJKoZIhvcNAQEBBQADggIP ADCCAgoCggIBAM2N5maxs7NkoY9g5NMxFWll0TYiO7gXrGZTo3q25ZJgNdPMwrntLz/5ewE9 07TEbwJ3ah/Ep9BfZm7JF9vTtE1HkgKtXNKi0pawNGm1Yn26Dz5AbUr1byby6dFtDJr14E07 trzDCtRRvTkOVSBj6PQPal0fAnDtkIYQBVcuMkXkuMCtyfE95pjm8g4K9l7lAcKii3T1/3rE hCc1o2nBnb7EN1/XwBeCDGB+I2SN/ftZDbKQqGAF5q9dUn+iXU7Z/CVSfUWmhVh6cVZA4Ftv TglUqj410OuPx+cUQch3h1kFgsuhQR63HiJc3HbRJllHsV0rihvL1CjeARQkhnA6uY9NLFST p5I/P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