From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6CprNg+UIWDKGQAA0tVLHw (envelope-from ) for ; Mon, 08 Feb 2021 19:42:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aMVKMg+UIWDfRwAA1q6Kng (envelope-from ) for ; Mon, 08 Feb 2021 19:42:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D45CA940415 for ; Mon, 8 Feb 2021 19:42:02 +0000 (UTC) Received: from localhost ([::1]:49684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9CQ5-0001Fa-1W for larch@yhetil.org; Mon, 08 Feb 2021 14:42:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8yR0-0003rU-Cl for help-guix@gnu.org; Sun, 07 Feb 2021 23:46:02 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8yQx-0003rV-Q5 for help-guix@gnu.org; Sun, 07 Feb 2021 23:46:02 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 10BF29F6 for ; Sun, 7 Feb 2021 23:45:56 -0500 (EST) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Sun, 07 Feb 2021 23:45:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=6GFAzYgqQew9ASpl2qPSaMo2YkNjEeUv8GBfRI5JJXU=; b=bh6/26ve /VTOOLxCzNjHF8SX5Mm/FPvP9N2DaBV3O6lDHJ+flwVTUVGBTt8OfXC3P0nx2GAj GQfrauSUK77w9ap+4VGCk/psswyhkOsq0D8jzOS08MatCbzwfVj0znc8jmlIjjse d+7IplgEhs7zoG+HHdcuCan318Koxy4tWia7r2AwFjo3i40YNrlgOhBBdxDjRbKl 9RBVOq5t2V8Auns32PnwEsA2y/8zeR0A2MXCf6BzK9yIkM2XuTPALrArnnc5zKMU elf7cS4oZP6jLqCWDR3Wzbth33b0yvyHl+uoI1yTvxs5pQCtz9Ty0NI5kwfvkyNp n+xlkg0YEWA0ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=6GFAzYgqQew9ASpl2qPSaMo2YkNjE eUv8GBfRI5JJXU=; b=H0OCSnKNNNuHEs0jMuIas/9M/N6jSbCnLJvXyhWoKfDK9 BBxN1PEnw+s8pCvLaInat871k9hXkva61mLLWxGXwT/FzYN0qyK+fV92SImTdIIy uN+z1k8XQNpuUHo27fslND+NnvvGlOZT5AEQqq2B8kFxDKI+ZuYU8W6SEQfsFwIN 8OHJRI4ywcJcpq+R0WOV9p9RLT1y69ZcsTwfpVbabsXKqwN3vUFbgr2LowcOFyws jegof6OsYpYgBWJ7kxueAsRuYZM+dCS+p5OMsGZQWfxftBtAYafI4Yh4VFkftwJL 1BVfeZC14OUKkV+8WYgREuqlNJGwuqRiYqswmrGcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdflohhnrghthhgrnhcuofgrrhhsuggvnhdfuceojhhmrghrshgu vghnsehfrghsthhmrghilhdrfhhmqeenucggtffrrghtthgvrhhnpeeludetvdegtdeiud dugeelueethffgveetleeltdelieffvedufeejgeeutdegtdenucffohhmrghinhepuhgs uhhnthhurdgtohhmpdgsrghlvghnrgdrihhopdhgnhhurdhorhhgnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhmrghrshguvghnsehfrghs thhmrghilhdrfhhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6BBF315A005E; Sun, 7 Feb 2021 23:45:55 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-93-gef6c4048e6-fm-20210128.002-gef6c4048 Mime-Version: 1.0 Message-Id: <6d5f1eb3-54e6-4570-822b-e94f444a4235@www.fastmail.com> Date: Sun, 07 Feb 2021 22:44:08 -0600 From: "Jonathan Marsden" To: help-guix@gnu.org Subject: Status of Guix System on Raspberry Pi? Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.20; envelope-from=jmarsden@fastmail.fm; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 08 Feb 2021 14:38:08 -0500 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.fm header.s=fm2 header.b="bh6/26ve"; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=H0OCSnKN; dmarc=pass (policy=none) header.from=fastmail.fm; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: D45CA940415 X-Spam-Score: -1.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: O00+0Rnpom/j Goal: I am trying to see how close things are to being able to install and run Guix System on a Raspberry Pi (specifically a 4GB Pi 4). Background: Back in 2017 on the help-guix mailing list this was discussed, and the answer then was basically "no but it should become possible in the future". It is 2021. Have things changed? I can't find any recent success stories, asking in r/guix on Reddit did not result in anything definitive, nor did asking on IRC. Time to try it! (TL;DR : I didn't succeed 100%, so now I am looking for help and advice with troubleshooting and improving this process!) Method: Aiming for an aarch64-linux system, it seemed best to start from a "64bit" ARM8 aarch64 "foreign" Linux and see whether Guix (package manager) would run in that environment. Then, creating a operating system definition in a .scm file and using guix system image 'should' generate an appropriate image that could be copied to a microSD card or a USB stick from which to boot a Raspberry Pi. Process: A. Install "foreign" aarch64 OS I needed a stable known-working 64bit Linux for the Pi4 as a base "foreign" OS. I chose Ubuntu Server 20.04 LTS. Specifically, the image file ubuntu-20.10-preinstalled-server-arm64+raspi.img.xz downloaded from https://cdimage.ubuntu.com/releases/20.10/release/ubuntu-20.10/ I was unable to find an equivalent Debian image to use. I used Balena Etcher from https://www.balena.io/etcher to (extract and) copy this image to a new 64GB microSD card. I booted the Pi4 from this card. I logged in (ubuntu/ubuntu) and edited the /etc/netplan/50-cloud-init.yaml file to suit my home wifi network and rebooted it. I updated the "foreign" OS: sudo apt-get update && sudo apt-get upgrade, and then rebooted once more. B. Install Guix (package manager) Using the steps in the Guix Reference Manual at https://guix.gnu.org/manual/en/guix.html I installed Guix. sudo -i cd /tmp wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh chmod +x guix-install.sh ./guix-install.sh wget 'https://sv.gnu.org/people/viewgpg.php?user_id=15145' -qO - | sudo -i gpg --import - ./guix-install.sh The manual doesn't mention the extra step to grab the PGP key, and it should be updated, but other than that, this worked as it should. Per the manual, I added glibc-utf8-locales using guix: guix install glibc-utf8-locales export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale" echo 'export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"' >>/root/.bashrc C. Create a Guix System image for a Raspberry Pi 4 Using the examples in the Guix Reference Manual and a sample posted by another Reddit user, I created a file base2.scm which (hoepfully!) declares a simple Guix System for the Pi4. This is enclosed at the end of this email, it has only 33 non-comment non-blank source lines. I wanted to log what happened, so instead of just doing guix pull guix package -u guix system image bare2.scm I did: time -p script -c "guix pull && guix package -u && guix system image bare2.scm" guix-system-image-$(date +%F-%H%M%S).log Results: Over 20 hours later (!), this failed: build of /gnu/store/64g3sgsbz7pkyrdmsar0a9x7rjh2qnl9-disk-image.drv failed View build log at '/var/log/guix/drvs/64/g3sgsbz7pkyrdmsar0a9x7rjh2qnl9-disk-image.drv.bz2'. guix system: error: build of `/gnu/store/64g3sgsbz7pkyrdmsar0a9x7rjh2qnl9-disk-image.drv' failed Investigating: cp -p /var/log/guix/drvs/64/g3sgsbz7pkyrdmsar0a9x7rjh2qnl9-disk-image.drv.bz2 . bunzip2 *drv.bz2 I see: /gnu/store/m38272iq1p0fq5rrvylx46cqambvv0cs-genimage.cfg:14: no sub-section title/index for 'config' INFO: cmd: "mkdir -p "/tmp/guix-build-disk-image.drv-0/tmp"" (stderr): INFO: cmd: "rm -rf "/tmp/guix-build-disk-image.drv-0/tmp"/*" (stderr): INFO: cmd: "mkdir -p "/tmp/guix-build-disk-image.drv-0/tmp"" (stderr): INFO: cmd: "cp -a "/tmp/guix-build-disk-image.drv-0/root" "/tmp/guix-build-disk-image.drv-0/tmp/root"" (stderr): INFO: cmd: "find '/tmp/guix-build-disk-image.drv-0/tmp/root' -depth -type d -printf '%P\0' | xargs -0 -I {} touch -r '/tmp/guix-build-disk-image.drv-0/root/{}' '/tmp/guix-build-disk-image.drv-0/tmp/root/{}'" (stderr): INFO: cmd: "mkdir -p "/tmp/guix-build-disk-image.drv-0/images"" (stderr): INFO: hdimage(image): adding partition 'GNU-ESP' (in MBR) from '/gnu/store/rizvjsgw89i1rvcqa78wcgq89qy36jma-partition.img' ... INFO: hdimage(image): adding partition 'Guix_image' (in MBR) from '/gnu/store/rqi121qpvnzp683ahf86mxxr5n4ans4i-partition.img' ... INFO: hdimage(image): writing MBR Backtrace: 2 (primitive-load "/gnu/store/mi91lnghvz6jsiqcfr01fv5ns8q?") In ice-9/eval.scm: 619:8 1 (_ #(# ("/gn?" ?) ?)) In ice-9/boot-9.scm: 1991:7 0 (error _ . _) ice-9/boot-9.scm:1991:7: In procedure error: Failed to install U-Boot environment variable `PATH' set to `/gnu/store/pq7pspmz99y6jsdvl4rgfisq782b4hzn-genimage-11/bin:/gnu/store/sspkzm2dkw920068nvgr7nwv6b98zkxv-coreutils-8.32/bin:/gnu/store/jybfpdxpmm3jm2lajx8z661699276ifp-findutils-4.7.0/bin:/gnu/store/l4nwpbn90f47xyv0b9y9jngrdfpfh4bv-qemu-minimal-5.1.0/bin' I can pastebin the typescript log (or parts of it), if that would be useful. Tentative Conclusions: Leaving aside that the Pi4 has proprietary boot firmware, since I can't change that, I seem to be "nearly" at the point of having an image to copy and test. I suspect that "no sub-section title/index for 'config'" means that I need to specify some further configuration info in the .scm file so this image generation knows what to do. Searching online for that error message did not yield any relevant results at all. Next Steps: How can I proceed from here? Is anyone else in the Guix community attempting to get Guix system onto a Raspberry Pi4? Can someone with a lot more U-Boot and SBC porting experience than I have provide some insight and suggestions? ---- ;; This is an operating system configuration template ;; for a "bare bones" Guix system, with no X11 display server, on Raspberry Pi 4. (use-modules (gnu) (gnu packages bootloaders) (gnu bootloader u-boot)) (use-service-modules networking ssh) (use-package-modules ssh) (define u-boot-rpi (make-u-boot-package "rpi_4" "aarch64-linux-gnu")) (define u-boot-rpi-bootloader (bootloader (inherit u-boot-bootloader) (package u-boot-rpi))) (operating-system (host-name "jmguixbare") (timezone "America/Chicago") (locale "en_US.utf8") ;; Boot using U-Boot for Raspberry Pi (bootloader (bootloader-configuration (bootloader u-boot-rpi-bootloader) (target "/dev/mmcblk0"))) (file-systems (cons (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) %base-file-systems)) ;; This is where user accounts are specified. The "root" ;; account is implicit, and is initially created with the ;; empty password. (users (cons (user-account (name "pi") (comment "Raspberry Pi") (group "users") ;; Adding the account to the "wheel" group ;; makes it a sudoer. Adding it to "audio" ;; and "video" allows the user to play sound ;; and access the webcam. (supplementary-groups '("wheel" "audio" "video" "lp" "netdev" "input" "cdrom"))) %base-user-accounts)) ) -- Jonathan Marsden jmarsden@fastmail.fm