[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26341: [PATCH 1/5] build: syscalls: Add reboot.
From: |
Ludovic Courtès |
Subject: |
bug#26341: [PATCH 1/5] build: syscalls: Add reboot. |
Date: |
Mon, 10 Apr 2017 11:42:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Hi Mathieu,
Mathieu Othacehe <address@hidden> skribis:
> * guix/build/syscalls.scm (static-or-ffi): New macro. Used to dispatch between
> static Guile core implementation and FFI version.
> (reboot): New export procedure. Reimplemented from guile-linux-syscalls.patch.
> (RB_AUTOBOOT, ..., RB_KEXEC): New exported flags replacing static Guile flags.
[...]
> + #:replace (RB_AUTOBOOT
> + RB_HALT_SYSTEM
> + RB_ENABLED_CAD
> + RB_DISABLE_CAD
> + RB_POWER_OFF
> + RB_SW_SUSPEND
> + RB_KEXEC
> + reboot))
The problem is that we cannot #:replace unconditionally (when not using
the patched Guile, there’s nothing to replace¹).
So perhaps we should remove #:export, #:replace, and #:re-export for
‘mount’ & co, and instead have a macro like this:
(define-syntax define-as-needed
(syntax-rules ()
"Define VARIABLE. If VARIABLE already exists in (guile) then re-export
it,
otherwise export the newly-defined VARIABLE."
((_ (proc args ...) body ...)
(define-as-needed proc (lambda (args ...) body ...)))
((_ variable value)
(begin
(when (module-defined? the-scm-module 'variable)
(re-export variable))
(define variable
(if (module-defined? the-scm-module 'variable)
(module-ref the-scm-module 'variable)
value))
(unless (module-defined? the-scm-module 'variable)
(export variable))))))
(define-as-needed RB_AUTOBOOT #x123)
(define-as-needed (mount foo bar)
'baz)
WDYT?
Sorry that this simple thing ends up being complicated! ;-)
Thank you,
Ludo’.
¹ In practice #:replace works even when there’s nothing to replace, but
I’d rather not rely on it.
- bug#26341: [PATCH] build: vm: Add missing module., (continued)
- bug#26341: [PATCH] build: vm: Add missing module., Ludovic Courtès, 2017/04/05
- bug#26341: [PATCH] build: vm: Add missing module., Mathieu Othacehe, 2017/04/06
- bug#26341: [PATCH] build: vm: Add missing module., Ludovic Courtès, 2017/04/06
- bug#26341: [PATCH] build: vm: Add missing module., Ludovic Courtès, 2017/04/07
- bug#26341: [PATCH] build: vm: Add missing module., Mathieu Othacehe, 2017/04/08
- bug#26341: [PATCH] build: vm: Add missing module., Ludovic Courtès, 2017/04/05
bug#26341: [PATCH 1/2] build: syscalls: Allow mount and umount use from static Guile., Mathieu Othacehe, 2017/04/06
bug#26341: [PATCH 0/5] Fix warnings related to syscalls in static Guile., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 3/5] build: syscalls: Add mount and umount to #:replace list., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 4/5] build: syscalls: Add load-linux-module., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 5/5] build: Fix compilation warnings., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 2/5] build: syscalls: Allow use to network-interface syscalls independently of calling context., Mathieu Othacehe, 2017/04/08
bug#26341: [PATCH 1/5] build: syscalls: Add reboot., Mathieu Othacehe, 2017/04/10