unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Simon South <simon@simonsouth.net>
To: Vagrant Cascadian <vagrant@debian.org>
Cc: help-guix@gnu.org
Subject: Re: Building installation image for ROCK64
Date: Sun, 26 Apr 2020 10:31:32 -0400	[thread overview]
Message-ID: <87o8reb9ob.fsf@simonsouth.net> (raw)
In-Reply-To: <877dyl7mn0.fsf@yucca> (Vagrant Cascadian's message of "Sat, 11 Apr 2020 14:12:03 -0700")

Vagrant,

Thanks to help from you, Pierre Langlois and a few others on IRC I've
had Guix System running on my ROCK64 for a while now. I thought I'd
follow up with the configuration I used and some notes in case it's
helpful to someone else down the road:

I started with an existing GNU/Linux distribution (Armbian Bionic,
though almost any should work fine) installed on my ROCK64's internal
eMMC module, to which I added Guix using the installer script linked
from chapter 2 of the Guix manual.

From there, log in to the ROCK64 as the superuser. Using fdisk, prepare
a microSD card (/dev/mmcblk0) with a GPT partition table and a single
partition beginning at sector 2,048. Format the partition
(/dev/mmcblk0p1) as ext4, then mount it at /mnt.

Create /mnt/etc and write a configuration file like the one below
(perhaps changing the timezone and locale and adding a user account) to
/mnt/etc/config.scm.

Then, making sure the Guix build daemon is running, have Guix populate
the microSD card with

  guix system init /mnt/etc/config.scm /mnt

Once this completes the card will contain a bootable Guix System
image. Power off the ROCK64, place a jumper over the pins behind the
power LED to disable the eMMC clock, and power on the machine again.  It
should boot from the card into Guix System.

From there, the OS can be installed to the eMMC module through a
complicated dance: Using another computer connected to the ROCK64 via
its serial interface, hit Enter during startup to reach the U-Boot
prompt, then carefully (!) remove the jumper from the ROCK64 to
re-enable its eMMC module and enter "boot" to finish booting into
Guix. Edit /etc/config.scm to replace "/dev/mmcblk0" with "/dev/mmcblk1"
(the eMMC module), then repeat the steps above (making the same
substitution) to prepare the module and install a fresh copy of the OS.

The configuration file below is fairly minimal but adds a DHCP client
and OpenSSH server to the base services so the ROCK64 can be accessed
easily once it's connected to a network.

Importantly, it also adds an NTP service to set the date and time at
startup. The ROCK64 has no RTC battery and defaults to 1 January 2016 as
the date at each boot, which causes "guix pull" to fail with an
SSL-certificate error until the clock is set properly. (Note OpenNTPD
itself ocassionally fails to set the clock and it may be necessary to
run "sudo herd restart ntpd" manually after booting.)

Thanks again to you and everyone else who helped me reach this point.

----------

(use-modules (gnu)
	     (gnu bootloader u-boot)
	     (gnu system nss))
(use-package-modules certs linux ntp)
(use-service-modules networking ssh)

(operating-system
 (host-name "rock64")
 (timezone "America/Toronto")
 (locale "en_CA.utf8")

 (bootloader (bootloader-configuration
	      (bootloader u-boot-rock64-rk3328-bootloader)
	      (target "/dev/mmcblk0")))

 (initrd-modules '())

 (kernel linux-libre-arm64-generic)
 (kernel-arguments '("console=ttyS2,1500000"))

 (file-systems
  (cons* (file-system
	  (mount-point "/")
	  (device "/dev/mmcblk0p1")
	  (type "ext4"))
	 %base-file-systems))

 (packages (append (list nss-certs) %base-packages))
 
 (services (append (list (service dhcp-client-service-type)
			 (service openntpd-service-type
			  (openntpd-configuration
			   (allow-large-adjustment? #t)))
			 (service openssh-service-type))
			 %base-services)))

-- 
Simon South
simon@simonsouth.net


  parent reply	other threads:[~2020-04-26 14:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 19:48 Simon South
2020-04-11 21:12 ` Vagrant Cascadian
2020-04-12 16:19   ` Simon South
2020-04-26 14:31   ` Simon South [this message]
2020-04-26 17:09     ` Vagrant Cascadian
2020-04-27 13:19       ` Simon South
2020-04-27 17:22         ` Vagrant Cascadian
2020-04-12 10:18 ` Pierre Langlois
2020-04-12 10:27   ` Pierre Langlois
2020-04-12 16:25   ` Simon South

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8reb9ob.fsf@simonsouth.net \
    --to=simon@simonsouth.net \
    --cc=help-guix@gnu.org \
    --cc=vagrant@debian.org \
    --subject='Re: Building installation image for ROCK64' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).