diff options
| author | Hilton Chain <hako@ultrarare.space> | 2023-12-09 15:58:47 +0800 |
|---|---|---|
| committer | Jonathan Brielmaier <jonathan.brielmaier@web.de> | 2024-01-07 17:06:54 +0100 |
| commit | 0b4f1c3affb1faf1aae2afb07bdd4e8697f87f2c (patch) | |
| tree | 834fcf03ad796b4b27042e95750772f1bed203f3 | |
| parent | 1eaa24df40ee65ce33a964639f3174b71466320b (diff) | |
nongnu: make-linux-xanmod: Adjust style.
* nongnu/packages/linux.scm (%default-extra-linux-options,config->string):
Move into make-linux-xanmod.
(make-linux-xanmod): Adjust comments.
Move the base kernel produced by customize-linux out of let form.
[native-inputs]: Use prepend instead of append.
Signed-off-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
| -rw-r--r-- | nongnu/packages/linux.scm | 116 |
1 files changed, 61 insertions, 55 deletions
diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index be6fb8e..222862a 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm | |||
| @@ -46,12 +46,6 @@ | |||
| 46 | #:use-module (srfi srfi-1) | 46 | #:use-module (srfi srfi-1) |
| 47 | #:export (corrupt-linux)) | 47 | #:export (corrupt-linux)) |
| 48 | 48 | ||
| 49 | (define %default-extra-linux-options | ||
| 50 | (@@ (gnu packages linux) %default-extra-linux-options)) | ||
| 51 | |||
| 52 | (define config->string | ||
| 53 | (@@ (gnu packages linux) config->string)) | ||
| 54 | |||
| 55 | (define (linux-url version) | 49 | (define (linux-url version) |
| 56 | "Return a URL for Linux VERSION." | 50 | "Return a URL for Linux VERSION." |
| 57 | (string-append "mirror://kernel.org" | 51 | (string-append "mirror://kernel.org" |
| @@ -189,56 +183,68 @@ on hardware which requires nonfree software to function.")))) | |||
| 189 | #:key | 183 | #:key |
| 190 | (name "linux-xanmod") | 184 | (name "linux-xanmod") |
| 191 | (xanmod-defconfig "config_x86-64-v1")) | 185 | (xanmod-defconfig "config_x86-64-v1")) |
| 192 | (let ((defconfig xanmod-defconfig) ;to be used in phases. | 186 | |
| 193 | (base (customize-linux #:name name | 187 | (define %default-extra-linux-options |
| 194 | #:source source | 188 | (@@ (gnu packages linux) %default-extra-linux-options)) |
| 195 | #:defconfig xanmod-defconfig | 189 | |
| 196 | ;; EXTRAVERSION is used instead. | 190 | (define config->string |
| 197 | #:configs (config->string | 191 | (@@ (gnu packages linux) config->string)) |
| 198 | '(("CONFIG_LOCALVERSION" . ""))) | 192 | |
| 199 | #:extra-version xanmod-revision))) | 193 | (define base-kernel |
| 200 | (package | 194 | (customize-linux |
| 201 | (inherit base) | 195 | #:name name |
| 202 | (version version) | 196 | #:source source |
| 203 | (arguments | 197 | #:defconfig xanmod-defconfig |
| 204 | (substitute-keyword-arguments (package-arguments base) | 198 | ;; EXTRAVERSION is used instead. |
| 205 | ((#:phases phases) | 199 | #:configs (config->string |
| 206 | #~(modify-phases #$phases | 200 | '(("CONFIG_LOCALVERSION" . ""))) |
| 207 | (add-before 'configure 'add-xanmod-defconfig | 201 | #:extra-version xanmod-revision)) |
| 208 | (lambda _ | 202 | |
| 209 | (rename-file | 203 | (package |
| 210 | (string-append "CONFIGS/xanmod/gcc/" #$defconfig) | 204 | (inherit base-kernel) |
| 211 | ".config") | 205 | (version version) |
| 212 | 206 | (arguments | |
| 213 | ;; Adapted from `make-linux-libre*'. | 207 | (substitute-keyword-arguments (package-arguments base-kernel) |
| 214 | (chmod ".config" #o666) | 208 | ((#:phases phases) |
| 215 | (let ((port (open-file ".config" "a")) | 209 | #~(modify-phases #$phases |
| 216 | (extra-configuration | 210 | ;; Since `customize-linux' replaces the configure phase, we add |
| 217 | #$(config->string | 211 | ;; XanMod defconfig beforehand to ensure compatibility of the |
| 218 | ;; FIXME: There might be other support missing. | 212 | ;; resulting package with `customize-linux'. |
| 219 | (append '(("CONFIG_BLK_DEV_NVME" . #t) | 213 | (add-before 'configure 'add-xanmod-defconfig |
| 220 | ("CONFIG_CRYPTO_XTS" . m) | 214 | (lambda _ |
| 221 | ("CONFIG_VIRTIO_CONSOLE" . m)) | 215 | (rename-file |
| 222 | %default-extra-linux-options)))) | 216 | (string-append "CONFIGS/xanmod/gcc/" #$xanmod-defconfig) |
| 223 | (display extra-configuration port) | 217 | ".config") |
| 224 | (close-port port)) | 218 | |
| 225 | (invoke "make" "oldconfig") | 219 | ;; Adapted from `make-linux-libre*'. |
| 226 | 220 | (chmod ".config" #o666) | |
| 227 | (rename-file | 221 | (let ((port (open-file ".config" "a")) |
| 228 | ".config" | 222 | (extra-configuration |
| 229 | (string-append "arch/x86/configs/" #$defconfig)))))))) | 223 | #$(config->string |
| 230 | (native-inputs | 224 | (append %default-extra-linux-options |
| 231 | (modify-inputs (package-native-inputs base) | 225 | ;; NOTE: These are configs expected by Guix |
| 232 | ;; cpio is needed for CONFIG_IKHEADERS. | 226 | ;; but missing from XanMod defconfig. |
| 233 | (append cpio zstd))) | 227 | '(("CONFIG_BLK_DEV_NVME" . #t) |
| 234 | (home-page "https://xanmod.org/") | 228 | ("CONFIG_CRYPTO_XTS" . m) |
| 235 | (supported-systems '("x86_64-linux")) | 229 | ("CONFIG_VIRTIO_CONSOLE" . m)))))) |
| 236 | (synopsis | 230 | (display extra-configuration port) |
| 237 | "Linux kernel distribution with custom settings and new features") | 231 | (close-port port)) |
| 238 | (description | 232 | (invoke "make" "oldconfig") |
| 239 | "This package provides XanMod kernel, a general-purpose Linux kernel | 233 | |
| 234 | (rename-file | ||
| 235 | ".config" | ||
| 236 | (string-append "arch/x86/configs/" #$xanmod-defconfig)))))))) | ||
| 237 | (native-inputs | ||
| 238 | (modify-inputs (package-native-inputs base-kernel) | ||
| 239 | ;; cpio is needed for CONFIG_IKHEADERS. | ||
| 240 | (prepend cpio zstd))) | ||
| 241 | (home-page "https://xanmod.org/") | ||
| 242 | (supported-systems '("x86_64-linux")) | ||
| 243 | (synopsis "Linux kernel distribution with custom settings and new features") | ||
| 244 | (description | ||
| 245 | "This package provides XanMod kernel, a general-purpose Linux kernel | ||
| 240 | distribution with custom settings and new features. It's built to provide a | 246 | distribution with custom settings and new features. It's built to provide a |
| 241 | stable, responsive and smooth desktop experience.")))) | 247 | stable, responsive and smooth desktop experience."))) |
| 242 | 248 | ||
| 243 | ;; Linux-XanMod sources | 249 | ;; Linux-XanMod sources |
| 244 | (define-public linux-xanmod-version "6.5.10") | 250 | (define-public linux-xanmod-version "6.5.10") |
