diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-07-10 13:03:46 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-07-10 13:03:46 +0200 |
| commit | 1650dd8a38019d539086f74981ce3f96f9679da4 (patch) | |
| tree | 3b840468e654109e4745905378bace4e8e885831 /gnu | |
| parent | 9ca7eaa134088c0a3e0b4f53fca84a5b82c8f8ec (diff) | |
gnu: linux-libre: Fallback to 'defconfig' when there's no config file.
* gnu/packages/linux.scm (kernel-config): Return #f rather than error
out in the default case.
(linux-libre)[native-inputs]: Add "kconfig" input only when
'kernel-config' returns true.
[build-phase]: Adjust accordingly.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/linux.scm | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 0db08fc7c8f..167775a7006 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm | |||
| @@ -172,7 +172,7 @@ | |||
| 172 | 172 | ||
| 173 | (define (kernel-config system) | 173 | (define (kernel-config system) |
| 174 | "Return the absolute file name of the Linux-Libre build configuration file | 174 | "Return the absolute file name of the Linux-Libre build configuration file |
| 175 | for SYSTEM." | 175 | for SYSTEM, or #f if there is no configuration for SYSTEM." |
| 176 | (define (lookup file) | 176 | (define (lookup file) |
| 177 | (let ((file (string-append "gnu/packages/" file))) | 177 | (let ((file (string-append "gnu/packages/" file))) |
| 178 | (search-path %load-path file))) | 178 | (search-path %load-path file))) |
| @@ -183,7 +183,7 @@ for SYSTEM." | |||
| 183 | ("x86_64-linux" | 183 | ("x86_64-linux" |
| 184 | (lookup "linux-libre-x86_64.conf")) | 184 | (lookup "linux-libre-x86_64.conf")) |
| 185 | (_ | 185 | (_ |
| 186 | (error "unsupported architecture" system)))) | 186 | #f))) |
| 187 | 187 | ||
| 188 | (define-public linux-libre | 188 | (define-public linux-libre |
| 189 | (let* ((version "3.15") | 189 | (let* ((version "3.15") |
| @@ -201,8 +201,14 @@ for SYSTEM." | |||
| 201 | 201 | ||
| 202 | (let ((build (assoc-ref %standard-phases 'build)) | 202 | (let ((build (assoc-ref %standard-phases 'build)) |
| 203 | (config (assoc-ref inputs "kconfig"))) | 203 | (config (assoc-ref inputs "kconfig"))) |
| 204 | (copy-file config ".config") | 204 | |
| 205 | (chmod ".config" #o666) | 205 | ;; Use the architecture-specific config if available, and |
| 206 | ;; 'defconfig' otherwise. | ||
| 207 | (if config | ||
| 208 | (begin | ||
| 209 | (copy-file config ".config") | ||
| 210 | (chmod ".config" #o666)) | ||
| 211 | (system* "make" "defconfig")) | ||
| 206 | 212 | ||
| 207 | ;; Appending works even when the option wasn't in the | 213 | ;; Appending works even when the option wasn't in the |
| 208 | ;; file. The last one prevails if duplicated. | 214 | ;; file. The last one prevails if duplicated. |
| @@ -258,8 +264,12 @@ for SYSTEM." | |||
| 258 | ("bc" ,bc) | 264 | ("bc" ,bc) |
| 259 | ("module-init-tools" ,module-init-tools) | 265 | ("module-init-tools" ,module-init-tools) |
| 260 | ("patch/freedo+gnu" ,%boot-logo-patch) | 266 | ("patch/freedo+gnu" ,%boot-logo-patch) |
| 261 | ("kconfig" ,(kernel-config (or (%current-target-system) | 267 | |
| 262 | (%current-system)))))) | 268 | ,@(let ((conf (kernel-config (or (%current-target-system) |
| 269 | (%current-system))))) | ||
| 270 | (if conf | ||
| 271 | `(("kconfig" ,conf)) | ||
| 272 | '())))) | ||
| 263 | (arguments | 273 | (arguments |
| 264 | `(#:modules ((guix build gnu-build-system) | 274 | `(#:modules ((guix build gnu-build-system) |
| 265 | (guix build utils) | 275 | (guix build utils) |
