unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: guix-devel <guix-devel@gnu.org>
Subject: Re: Distributing Guix System Pinebook Pro images
Date: Mon, 30 Aug 2021 11:52:24 +0200	[thread overview]
Message-ID: <877dg3b6p3.fsf@gnu.org> (raw)
In-Reply-To: <87o89gvcps.fsf@gnu.org> (Mathieu Othacehe's message of "Sun, 29 Aug 2021 11:09:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]


Hello,

I managed to build a Guix System image with the Sway WM for the Pinebook
Pro. The image is quite large (~6GiB) but it is bootable and works fine.

Here are the steps I followed:

* I built a cross-compiled barebones Pinebook Pro image as described in
  my previous email.

* I used that image to turn the Pinebook Pro into an offload machine.

* From my main x86_64 machine, I ran the following command:

--8<---------------cut here---------------start------------->8---
guix system image ~/tmp/pinebook.scm -s aarch64-linux
--8<---------------cut here---------------end--------------->8---

The pinebook.scm file is attached.

* I flashed the image and booted from it, exactly like for the
  cross-compiled image.

This is an interesting first step as generating desktop images for ARM
devices is really convenient.

Using the ARM machine as an offload machine to build a native ARM image
from an Intel machine is less convenient though. I would really like to
be able to build this same image using cross-compilation. The recent
series sent by Maxime are making this goal more realistic.

Thanks,

Mathieu


[-- Attachment #2: sway.jpeg --]
[-- Type: image/jpeg, Size: 119083 bytes --]

[-- Attachment #3: pinebook.scm --]
[-- Type: application/octet-stream, Size: 5190 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu system images pinebook-pro)
  #:use-module (gnu bootloader)
  #:use-module (gnu bootloader u-boot)
  #:use-module (gnu image)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages wm)
  #:use-module (gnu packages xorg)
  #:use-module (gnu services)
  #:use-module (gnu services avahi)
  #:use-module (gnu services base)
  #:use-module (gnu services desktop)
  #:use-module (gnu services networking)
  #:use-module (gnu services sddm)
  #:use-module (gnu services ssh)
  #:use-module (gnu services xorg)
  #:use-module (gnu system)
  #:use-module (gnu system file-systems)
  #:use-module (gnu system image)
  #:use-module (gnu system shadow)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (nongnu packages linux)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:export (pinebook-pro-desktop-os
            pinebook-pro-image-type
            pinebook-pro-desktop-raw-image))

(define pinebook-pro-desktop-os
  (operating-system
    (host-name "viso")
    (timezone "Europe/Paris")
    (locale "en_US.utf8")
    (bootloader (bootloader-configuration
                 (bootloader u-boot-pinebook-pro-rk3399-bootloader)
                 (target "/dev/vda")))
    (initrd-modules '())
    (kernel linux-libre-arm64-generic)
    (users (cons* (user-account
                   (name "mathieu")
                   (comment "Mathieu")
                   (group "users")
                   (home-directory "/home/mathieu")
                   (supplementary-groups
                    '("wheel" "netdev" "audio" "video")))
                  %base-user-accounts))
    (file-systems (cons (file-system
                          (device (file-system-label "my-root"))
                          (mount-point "/")
                          (type "ext4"))
                        %base-file-systems))
    (packages (cons* sway xterm nss-certs
                     %base-packages))
    (services (cons* (service agetty-service-type
                              (agetty-configuration
                               (extra-options '("-L")) ; no carrier detect
                               (baud-rate "1500000")
                               (term "vt100")
                               (tty "ttyS2")))
                     (service openssh-service-type
                              (openssh-configuration
                               (permit-root-login 'without-password)
                               (authorized-keys
                                `(("mathieu"
                                   ,(local-file
                                     "/home/mathieu/.ssh/id_rsa.pub"))))))
                     (service dhcp-client-service-type)
                     (sddm-service
                      (sddm-configuration
                       (display-server "wayland")))
                     (modify-services
                         (remove
                          (lambda (service)
                            (member (service-kind service)
                                    (list ntp-service-type
                                          avahi-service-type
                                          bluetooth-service
                                          network-manager-service-type
                                          gdm-service-type)))
                          %desktop-services)
                         (guix-service-type
                          config =>
                          (guix-configuration
                           (inherit config)
                           (authorized-keys
                            (append (list
                                     (local-file "/home/mathieu/.config/guix/keys/meije.scm"))
                                    %default-authorized-guix-keys)))) )))))

(define pinebook-pro-image-type
  (image-type
   (name 'pinebook-pro-raw)
   (constructor (cut image-with-os
                     (arm64-disk-image (* 9 (expt 2 20))) ;9MiB
                     <>))))

(define pinebook-pro-desktop-raw-image
  (image
   (inherit
    (os->image pinebook-pro-desktop-os #:type pinebook-pro-image-type))
   (name 'pinebook-pro-desktop-raw-image)
   (target #f)))

;; Return the default image.
pinebook-pro-desktop-raw-image

  parent reply	other threads:[~2021-08-30  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-29  9:09 Distributing Guix System Pinebook Pro images Mathieu Othacehe
2021-08-29 15:16 ` Maxim Cournoyer
2021-08-29 20:15 ` Vagrant Cascadian
2021-08-29 20:41   ` Vagrant Cascadian
2021-08-30 11:07     ` Efraim Flashner
2021-08-30 11:00   ` Efraim Flashner
2021-08-30  9:52 ` Mathieu Othacehe [this message]
2021-08-30 14:01   ` Vagrant Cascadian
2021-08-30 14:52     ` Mathieu Othacehe
2021-08-30 19:13       ` André A. Gomes
2021-08-30 14:37 ` Katherine Cox-Buday

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=877dg3b6p3.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=guix-devel@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).