From nobody Sat Aug 31 23:13:45 2024 X-Original-To: riscv@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 4Wx9nD4jTqz5TSFh for ; Sat, 31 Aug 2024 23:13:52 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from mail.oetec.com (mail.oetec.com [108.160.241.186]) (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 ECDSA (P-256) client-digest SHA256) (Client CN "mail.oetec.com", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wx9nC52Xlz41Mx; Sat, 31 Aug 2024 23:13:51 +0000 (UTC) (envelope-from dclarke@blastwave.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=blastwave.org header.s=default header.b=MS7Iw+TT; dmarc=pass (policy=quarantine) header.from=blastwave.org; spf=pass (mx1.freebsd.org: domain of dclarke@blastwave.org designates 108.160.241.186 as permitted sender) smtp.mailfrom=dclarke@blastwave.org Received: from [172.16.35.3] (pool-99-253-118-250.cpe.net.cable.rogers.com [99.253.118.250]) (authenticated bits=0) by mail.oetec.com (8.17.1/8.17.1) with ESMTPSA id 47VNDkrl031247 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT); Sat, 31 Aug 2024 19:13:47 -0400 (EDT) (envelope-from dclarke@blastwave.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=blastwave.org; s=default; t=1725146028; bh=t+/eQ5tkqJFk1B3lAUAao359whbTfLsgduzT1MjBc5s=; h=Date:From:Subject:To:References:In-Reply-To; b=MS7Iw+TTnNxypnQRs3pxs6psh6QM2tMb7XT0Bd58prxj4aPaTVDCpxvLEv2p8s6X2 AuGFSeCBwoBVqH06niNqWL2yyX4d9Is1rIKureK93lDbClJhitHdkcFVf9vwTx0FyD pXNUQOEMkYIJR25IV2uEoF7meqFnasE/ncocGStv1ntYbApa28GuzIRV/St9WN9hrB xsUYBeTS9vfC/hBS9K/bGrDIOlqWAOKKhKph3XwRuj+jJO8dfmg3cxT2E8R/NsBQyA GnSKuLjvye+FtQoUDtcBvKn5wftS3XR4HG4zatAuZiSn18caSmeXTro1LuAvUTRmn1 mUN9IGPs3ZI3w== Message-ID: Date: Sat, 31 Aug 2024 19:13:45 -0400 List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Dennis Clarke Subject: Re: Question about the docs at https://wiki.freebsd.org/riscv/ports To: Mitchell Horne , riscv@FreeBSD.org References: <761a4270-8afe-4f50-b32a-3706b4f8ae5e@freebsd.org> Content-Language: en-CA Organization: GENUNIX In-Reply-To: <761a4270-8afe-4f50-b32a-3706b4f8ae5e@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-oetec-MailScanner-Information: Please contact the ISP for more information X-oetec-MailScanner-ID: 47VNDkrl031247 X-oetec-MailScanner: Found to be clean X-oetec-MailScanner-From: dclarke@blastwave.org X-Spam-Status: No X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.38 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.69)[-0.688]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[blastwave.org,quarantine]; RCVD_IN_DNSWL_MED(-0.20)[108.160.241.186:from]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[blastwave.org:s=default]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:812, ipnet:108.160.240.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; HAS_ORG_HEADER(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[riscv@FreeBSD.org]; DKIM_TRACE(0.00)[blastwave.org:+] X-Rspamd-Queue-Id: 4Wx9nC52Xlz41Mx On 8/30/24 11:43, Mitchell Horne wrote: > > > On 8/29/24 14:43, Dennis Clarke wrote: >> >> Dear RISC-V user types : >> >>      I have a package server that does daily builds for amd64 with jails >> setup for 13.3 and 14.1 and of course CURRENT. This works really well >> and generally gets the job done for all of KDE5 and LXDE and XFCE plus >> some database tools and other tidbits. Roughly 3 or 4 hours for 1800 >> packages and that serves me well. >> >>      Regarding the docs for riscv64 package builds at : >> >>          https://wiki.freebsd.org/riscv/ports >> >>      I see that it says we need qemu-user-static built and installed and >> then I *may* be able to setup a riscv64 jail?  My plan is to try and get >> a 14.1 jail as well as a CURRENT jail from the sources I have built the >> host with. However qemu is just horribly slow. So terrible that I may >> have to wait a week to get that jail built. So therefore : >> > > I think you misunderstand the use of QEMU here. The jail is not being > built inside QEMU. The instructions are for cross-compiling riscv64 > packages on an amd64 host. So, a riscv64 jail will be built and > installed on the host, including a cross-compiler. QEMU is used in a > limited way here, to emulate execution of riscv64 binaries on the host. > It is slower than native package building, but faster than full-system > emulation. > Thank you for the reply. I was able to make some progress in the last few days. However it has been no fun. Really. There was no way at all I could have done much of anything without the fantastic help of Jessica Clarke who gave detailed instructions to get around the land mines in the SiFive UnMatched land. Flashing the darn firmware was a real treat. We needed to use a memory based md0 device and then dd that thing onto the flash. That took hours to find out. I managed to install 15.0-CURRENT onto the SiFive Unmatched and it seems to work. More or less. There are no packages available and so I went ahead with a build in /usr/ports to get "pkg". I have a reasonably beefy AMD64 pkg build server but the mystery is that bizarre qemu_user_static package. It seems to be utterly borked and broken : triton# poudriere jail -c -a riscv.riscv64 -x -j 150rv64 -J 16 \ -D -f t1/poudriere/jails/150rv64 -m git+ssh \ -v main -U 'ssh://anongit@git.FreeBSD.org/src.git' [00:00:00] Cross-building ports for riscv.riscv64 on amd64 requires QEMU [00:00:00] Creating 150rv64 fs at /poudriere/jails/150rv64... done [00:00:00] Checking out the sources with git+ssh...triton# triton# Right ... so what does this thing want from me ? triton# grep 'qemu' /etc/rc.conf qemu_user_static_enable="YES" triton# triton# service qemu_user_static start 'arm' is not unique in activator list usage: binmiscctl command [args...] Add a new binary image activator (requires 'root' privilege): binmiscctl add --interpreter \ --magic [--mask ] \ --size [--offset ] \ [--set-enabled] \ [--pre-open] . . . about a 100 lines of the same stuff over and over and over ... . . Add a new binary image activator (requires 'root' privilege): binmiscctl add --interpreter \ --magic [--mask ] \ --size [--offset ] \ [--set-enabled] \ [--pre-open] Remove a binary image activator (requires 'root' privilege): binmiscctl remove Disable a binary image activator (requires 'root' privilege): binmiscctl disable Enable a binary image activator (requires 'root' privilege): binmiscctl enable Lookup a binary image activator: binmiscctl lookup List all the binary image activators: binmiscctl list triton# So whatever that QEMU static thing is .... well I have no clue. > These instructions are untouched and untested for a while. They are > still generally applicable, but there may be stumbling blocks, I am not > sure. > Based on my experience thus far I will need to write some detailed docs about this process. > > Not completely, but the riscv ports experience is still pretty > incomplete and a distance from "just works". So, it depends on how you > value spending your time. > Thus far it all feels like a prototype on the edge of "working" with a pile of little problems in all directions. From firmware upwards. Even the documentation from SiFive is sketchy. Complete with dip switch settings that are upside down or entirely undocumented. I am so very thankful for Jessica Clarke as there was just no way any user would have a clue how to deal with this board. I even resorted to using my old fluke multimeter just to figure out what those dip switch settings *really* are. At the moment I am trying to build git natively. If that works then I may be able to clone out the sources and try a buildworld etc. However my first attempt at that failed with weird messages about some binary being unrecognizable. An old bug to be sure. > > I have never tried native poudriere builds on the Unmatched, but I > believe some users have with some success. It will (of course) be slow > compared to commodity amd64 hardware. Running package builds also > stresses the system, and may expose software or hardware instability. > > So, you can try this, but you will be walking an unmarked path, so to > speak. It is fair to expect some minor "horror", but it is possible to > build packages. Yes, some minor scary bits. Minor. No open flame or smoke. Yet. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken