aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Timothy Sample <samplet@ngyro.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 bootloader depthcharge)
  #:use-module (gnu bootloader extlinux)
  #:use-module (gnu bootloader)
  #:use-module (gnu packages bootloaders)
  #:use-module (guix gexp)
  #:use-module (guix utils)
  #:use-module (ice-9 match)
  #:export (depthcharge-bootloader))

(define (signed-kernel kernel kernel-arguments initrd)
  (define builder
    (with-imported-modules '((guix build utils))
      #~(begin
          (use-modules (guix build utils)
                       (ice-9 binary-ports)
                       (rnrs bytevectors))
          (set-path-environment-variable "PATH" '("bin") (list #$dtc))

          ;; TODO: These files have to be writable, so we copy them.
          ;; This can probably be fixed by using a ".its" file, just
          ;; be careful not to break initrd loading.
          (copy-file #$kernel "zImage")
          (chmod "zImage" #o755)
          (copy-file (string-append (dirname #$kernel) "/lib/dtbs/"
                                    "rk3288-veyron-speedy.dtb")
                     "rk3288-veyron-speedy.dtb")
          (chmod "rk3288-veyron-speedy.dtb" #o644)
          (copy-file #$initrd "initrd")
          (chmod "initrd" #o644)

          (invoke (string-append #$u-boot-tools "/bin/mkimage")
                  "-D" "-I dts -O dtb -p 2048"
		  "-f" "auto"
                  "-A" "arm"
                  "-O" "linux"
                  "-T" "kernel"
                  "-C" "None"
                  "-d" "zImage"
                  "-a" "0"
                  "-b" "rk3288-veyron-speedy.dtb"
                  "-i" "initrd"
	          "image.itb")
          (call-with-output-file "bootloader.bin"
            (lambda (port)
              (put-bytevector port (make-bytevector 512 0))))
          (with-output-to-file "kernel-arguments"
	    (lambda ()
	      (display (string-join (list #$@kernel-arguments)))))
          (invoke (string-append #$vboot-utils "/bin/vbutil_kernel")
                  "--pack" #$output
                  "--version" "1"
                  "--vmlinuz" "image.itb"
		  "--arch" "arm"
		  "--keyblock" (string-append #$vboot-utils
                                              "/share/vboot-utils/devkeys/"
                                              "kernel.keyblock")
		  "--signprivate" (string-append #$vboot-utils
                                                 "/share/vboot-utils/devkeys/"
                                                 "kernel_data_key.vbprivk")
                  "--config" "kernel-arguments"
                  "--bootloader" "bootloader.bin"))))
  (computed-file "vmlinux.kpart" builder))

(define* (depthcharge-configuration-file config entries
                                         #:key
                                         (system (%current-system))
                                         (old-entries '())
                                         #:allow-other-keys)
  (match entries
    ((entry)
     (let ((kernel (menu-entry-linux entry))
           (kernel-arguments (menu-entry-linux-arguments entry))
           (initrd (menu-entry-initrd entry)))
       ;; XXX: Make this a symlink.
       (signed-kernel kernel kernel-arguments initrd)))
    (_ (error "Too many bootloader menu entries!"))))

(define install-depthcharge
  #~(lambda (bootloader device mount-point)
      (let ((kpart (string-append mount-point
                                  "/boot/depthcharge/vmlinux.kpart")))
        (write-file-on-device kpart (stat:size (stat kpart)) device 0))))

(define depthcharge-bootloader
  (bootloader
   (name 'depthcharge)
   (package #f)
   (installer install-depthcharge)
   (configuration-file "/boot/depthcharge/vmlinux.kpart")
   (configuration-file-generator depthcharge-configuration-file)))
qps....* gnu/packages/lxqt.scm (qps): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-26gnu: Add qterminal....* gnu/packages/lxqt.scm (qterminal): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-26gnu: Add screengrab....* gnu/packages/lxqt.scm (screengrab): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-26gnu: Add lximage-qt....* gnu/packages/lxqt.scm (lximage-qt): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-26gnu: lxqt.scm: Sort packages into base, core, etc....* gnu/packages/lxqt.scm: Sort packages into base, core, etc. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-26gnu: Add qtermwidget....* gnu/packages/lxqt.scm (qtermwidget): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add pavucontrol-qt....* gnu/packages/lxqt.scm (pavucontrol-qt): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-themes....* gnu/packages/lxqt.scm (lxqt-themes): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-qtplugin....* gnu/packages/lxqt.scm (lxqt-qtplugin): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-powermanagement....* gnu/packages/lxqt.scm (lxqt-powermanagement): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-openssh-askpass....* gnu/packages/lxqt.scm (lxqt-openssh-askpass): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-policykit....* gnu/packages/lxqt.scm (lxqt-policykit): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-notificationd....* gnu/packages/lxqt.scm (lxqt-notificationd): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: lxqt.scm: Move qttools from inputs to native-inputs....* gnu/packages/lxqt.scm: Move qttools from inputs to native-inputs. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-25gnu: Add lxqt-config....* gnu/packages/lxqt.scm (lxqt-config): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: lxqt.scm: Add prefix to licenses imports....* gnu/packages/lxqt.scm: Import (guix licenses) with prefix "license:". Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-admin....* gnu/packages/lxqt.scm (lxqt-admin): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-about....* gnu/packages/lxqt.scm (lxqt-about): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add pcmanfm-qt....* gnu/packages/lxqt.scm (pcmanfm-qt): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add libfm-qt....* gnu/packages/lxqt.scm (libfm-qt): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-sudo....* gnu/packages/lxqt.scm (lxqt-sudo): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-runner....* gnu/packages/lxqt.scm (lxqt-runner): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-panel....* gnu/packages/lxqt.scm (lxqt-panel): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add libsysstat....* gnu/packages/lxqt.scm (libsysstat): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-24gnu: Add lxqt-globalkeys....* gnu/packages/lxqt.scm (lxqt-globalkeys): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-23gnu: Add libstatgrab....* gnu/packages/lxqt.scm (libstatgrab): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-23gnu: Add libdbusmenu-qt....* gnu/packages/lxqt.scm (libdbusmenu-qt): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-23gnu: lxqt.scm: Sort packages alphabetically....* gnu/packages/lxqt.scm: Sort packages alphabetically. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-23gnu: lxqt-build-tools: Update download URL and home page URL....* gnu/packages/lxqt.scm (lxqt-build-tools) [source]: Update download URL to the 'lxqt' repository. [home-page]: Use HTTPS. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-23gnu: lxqt-session: Update to 0.13.0....* gnu/packages/lxqt.scm (lxqt-session): Update to 0.13.0. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-22gnu: liblxqt: Update to 0.13.0....* gnu/packages/lxqt.scm (liblxqt): Update to 0.13.0. [source]: Remove patches. [home-page]: Use HTTPS. * gnu/packages/patches/liblxqt-include.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-10-22gnu: libqtxdg: Update to 3.2.0....* gnu/packages/lxqt.scm (libqtxdg): Update to 3.2.0. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Meiyo Peng 2018-06-04gnu: lxqt-build-tools: Update to 0.5.0....* gnu/packages/lxqt.scm (lxqt-build-tools): Update to 0.5.0. Tobias Geerinckx-Rice 2018-03-20Correct name and Email for ng0....* .mailmap: Correct name and Email for ng0. * Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish gnu/packages/accessibility.scm, gnu/packages/admin.scm, gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/cinnamon.scm, gnu/packages/compression.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gnuzilla.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr> ng0 2017-10-22gnu: lxqt-common: Remove....This package is marked as deprecated upstream. Fixes <https://bugs.gnu.org/28823>. * gnu/packages/lxqt.scm (lxqt-common): Remove. Ludovic Courtès 2017-09-26gnu: Add lxqt-build-tools....* gnu/packages/lxqt.scm (lxqt-build-tools): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> ng0