From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Langlois Subject: Re: Building installation image for ROCK64 Date: Sun, 12 Apr 2020 12:18:10 +0200 Message-ID: <877dylaty5.fsf@gmx.com> References: <87sgh9iz1v.fsf@simonsouth.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44304) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNZgs-0005ae-VG for help-guix@gnu.org; Sun, 12 Apr 2020 06:18:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNZgr-0006qc-Sn for help-guix@gnu.org; Sun, 12 Apr 2020 06:18:14 -0400 Received: from mout.gmx.net ([212.227.17.20]:46879) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jNZgr-0006pb-KR for help-guix@gnu.org; Sun, 12 Apr 2020 06:18:13 -0400 Received: from e119807-lin ([77.136.141.45]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mnaof-1iyNsM0rBd-00jVvw for ; Sun, 12 Apr 2020 12:18:11 +0200 In-reply-to: <87sgh9iz1v.fsf@simonsouth.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Hi Simon, Simon South writes: > Has anyone successfully built an installation image for a PINE64 ROCK64 > ARM SBC? I managed to setup a ROCKPRO64 a few months ago (rk3399 chipset instead of rk3328), maybe I can help :-). > > There's a definition for it in gnu/system/install.scm, but building the > image with > > guix system disk-image --system=3Daarch64-linux \ > -e "(@ (gnu system install) rock64-installation-os)" You probably noticed this takes a *long* time to run, making it quite tedious to test changes (I believe this is being worked on though). In the meanwhile, what you can do instead is setup the SD card manually, say using fdisk & mkfs.ext4, and then use the 'guix system init' command to install guix on it: $ mount /dev/mmcblk0 /mnt $ guix system init my-config.scm /mnt That's considerably faster and should take care of installing guix and the bootloader in the right place. > > and writing it to a microSD card fails to boot completely as the root > filesystem can't be mounted: > > GC Warning: pthread_getattr_np or pthread_attr_getstack failed for mai= n thread > GC Warning: Couldn't read /proc/stat > Welcome, this is GNU's early boot Guile. > Use '--repl' for an initrd REPL. > > loading kernel modules... > waiting for partition '416bf41b-f6b1-2062-6e00-1979416bf41b' to appear= ... > waiting for partition '416bf41b-f6b1-2062-6e00-1979416bf41b' to appear= ... > (...) > waiting for partition '416bf41b-f6b1-2062-6e00-1979416bf41b' to appear= ... > ERROR: In procedure scm-error: > failed to resolve partition "416bf41b-f6b1-2062-6e00-1979416bf41b" > > (I've checked and the GUID above does match the root partition.) I > understand this often means a necessary kernel module is missing from > initrd, but rebuilding the image using the definition below (mostly > copied from install.scm) that explicitly includes the Rockchip MMC > driver produces the same non-functioning result. > > Do you know the magic incantation necessary to produce a bootable image > for the ROCK64? > > Alternatively, how might I proceed in diagnosing the issue here? > > (use-modules (gnu system install) > (gnu system linux-initrd) > (gnu bootloader) > (gnu bootloader u-boot) > (gnu packages linux)) > > (operating-system > (inherit installation-os) > (bootloader (bootloader-configuration > (bootloader u-boot-rock64-rk3328-bootloader) > (target "/dev/mmcblk0"))) > (kernel linux-libre) > (kernel-arguments > (cons "console=3DttyS2" > (operating-system-user-kernel-arguments installation-os))) To help debug this, you might want to remove the "quiet" argument so you see some output from the kernel, I think it's added by default in installation-os. Just setting (kernel-arguments '("consolte=3DttyS2")) should do. > (initrd-modules (append '("dw_mmc" "dw_mmc-rockchip") %base-initrd-mo= dules))) As Vagrant pointed out, you're probably missing some more modules. On the rockpro64 I have the following: (initrd-modules (cons* "dw_mmc-rockchip" "phy-rockchip-emmc" "sdhci-of-arasan" ;; I believe this one is for rk3399 only, ;; so won't help you. %base-initrd-modules)) It was quite some back-and-forth to figure out what was needed. What I did was to boot a different distro, I think it was Arch at the time, and look at the dmesg output to see what drivers were loading that I didn't see with guix. Hope this helps! Thanks, Pierre