help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building installation image for ROCK64


From: Simon South
Subject: Re: Building installation image for ROCK64
Date: Sun, 26 Apr 2020 10:31:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]