guix-devel
[Top][All Lists]
Advanced

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

Re: Building a bootable disk image for A20-OLinuXino


From: Ludovic Courtès
Subject: Re: Building a bootable disk image for A20-OLinuXino
Date: Sun, 12 Jan 2020 12:55:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Mathieu!

Mathieu Othacehe <address@hidden> skribis:

>>   (bootloader (bootloader-configuration
>>                 (bootloader u-boot-a20-olinuxino-micro-bootloader)
>>                 (target "/dev/mmcblk0")))
>>
>> … this time with offloading to an actual ARM machine.  I wrote the
>> resulting image to an SD card, but the result appears to be unbootable.
>>
>> What am I doing wrong?
>
> Well, I prefer to set target to "/dev/vda", produce the image, then dd
> it on the SD card. This way, you have an image with the bootloader
> installed. But, this should work too.

Looking at the code (‘write-file-on-device’ called from
‘install-allwinner-u-boot’), it looks like it has to be “/dev/vda”,
indeed!

> The only way to debug is to plug an UART cable[1] :p. Most of the time, the
> initrd is missing some drivers to mount the SD card ("sunxi-mmc" and
> "sd_mod" maybe?).
>
> To find missing modules, I usually remove the "quiet" kernel argument
> and compare dmesg output with a Raspbian, or whatever is booting.

I don’t have a UART cable at hand, so I’m really shooting in the dark
until I get one.  :-)

Attached is the latest config I’ve tested, to no avail.  I’d say that
the kernel boots, because the Ethernet socket starts blinking, but
there’s no heartbeat.

Danny, I think you added U-Boot support for this board; did you get it
to work on the metal?

Thanks,
Ludo’.

(use-modules (gnu) (gnu bootloader u-boot))
(use-service-modules networking ssh avahi)
(use-package-modules screen linux pulseaudio wget)
(use-modules (srfi srfi-1))

;; /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt102

;; # redefine green led to blink until shutdown, try to switch OTG port to host
;; (echo heartbeat >/sys/class/leds/*green*/trigger) 2>/dev/null
;; echo 0 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role 2>/dev/null

;; olimex@A20-OLinuXino:~$ cat .config/pulse/default.pa
;; load-module module-alsa-sink
;; load-module module-rtp-recv
;; load-module module-native-protocol-unix

(define heartbeat-service
  (simple-service 'heartbeat activation-service-type
                  #~(catch 'system-error
                      (lambda ()
                        (call-with-output-file
                            "/sys/class/leds/green:ph02:led1/trigger"
                          (lambda (port)
                            (display "heartbeat\n" port))))
                      (const #f))))

(define %ludo-key
  (local-file "/home/ludo/.ssh/id_rsa.pub"))

(operating-system
  (host-name "olimex")
  (timezone "Europe/Paris")
  (locale "en_US.utf8")

  (bootloader (bootloader-configuration
                (bootloader u-boot-a20-olinuxino-micro-bootloader)
                (target "/dev/vda")))             ;"/dev/mmcblk0"
  (firmware '())
  (initrd-modules '("sunxi-mmc" "ahci-sunxi" "sunxi-nand" "sunxi" "sd_mod"

                    ;; Taken from /etc/modules in the Debian image.
                    ;; "sw_ahci_platform"            ;SATA support
                    "ahci_platform"
                    ;; "lcd"
                    ;; "hdmi"
                    ;; "ump"
                    ;; "disp"
                    ;; "sunxi-emac"
                    ;; "sunxi-gmac"
                    ;; "nand"
                    ;; "gt2005"
                    ;; sun4i_csi0 i2c_addr=0x78 ccm="gt2005"
                    ;; mali
                    "sun4i_ts"
                    ;; "sunxi_cedar_mod"
                    ;; "gpio_sunxi"
                    ;; "sun4i-keyboard"
                    ;; "g-ether"
                    ;; "pwm-sunxi"
                    ;; sun4i_csi0
                    ;; ft5x_ts
                    ;; "spi-sun7i"
                    ;; "sunxi_can"

                    ;; Taken from %BASE-INITRD-MODULES:
                    "usb-storage" "uas" "usbhid" "hid-generic"
                    "nls_iso8859-1"))

  (file-systems (cons (file-system
                        (device (file-system-label "root"))
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "ludo")
                (comment "Ludovic Courtès")
                (group "users")
                (supplementary-groups '("wheel"
                                        "audio" "video")))
               %base-user-accounts))

  (packages (cons* screen ;strace
                   pulseaudio wget %base-packages))

  (services (append (list heartbeat-service
                          (service dhcp-client-service-type)
                          (service openssh-service-type
                                   (openssh-configuration
                                    (permit-root-login 'without-password)
                                    (authorized-keys
                                     `(("ludo" ,%ludo-key)
                                       ("root" ,%ludo-key)))))
                          ;; (service dropbear-service-type
                          ;;          (dropbear-configuration
                          ;;           (port-number 2222)
                          ;;           (root-login? #t)))
                          (tor-hidden-service "ssh"
                                              '((22 "127.0.0.1:22")
                                                (80 "127.0.0.1:8080")))

                          (service agetty-service-type
                                   (agetty-configuration
                                    (tty "ttyS0")
                                    (keep-baud? #t)
                                    (term "vt102")
                                    (baud-rate "115200,38400,9600")))

                          (service ntp-service-type)
                          (service avahi-service-type))
                    %base-services))
  (name-service-switch %mdns-host-lookup-nss))

reply via email to

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