diff options
| author | Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 2020-05-27 09:13:19 +0200 |
|---|---|---|
| committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2020-06-08 16:50:40 +0200 |
| commit | e59706fb8844004b83926f19b7fda89ae4c3338f (patch) | |
| tree | c3833da2e92b188fd6e76973a6ef062dfcb11868 | |
| parent | c1815a7e6dabb3e39909fd30214c5c9424607f5b (diff) | |
system: hurd: Remove 'cross-hurd-image' hack.
The initial
guix build -f gnu/system/hurd.scm
hack has been superseded by regular guix system (cross) build.
* gnu/system/hurd.scm (compile-manifest, cross-hurd-image): Remove.
| -rw-r--r-- | gnu/system/hurd.scm | 177 |
1 files changed, 3 insertions, 174 deletions
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 956682357ed..2205def577a 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm | |||
| @@ -39,16 +39,15 @@ | |||
| 39 | #:use-module (gnu system) | 39 | #:use-module (gnu system) |
| 40 | #:use-module (gnu system shadow) | 40 | #:use-module (gnu system shadow) |
| 41 | #:use-module (gnu system vm) | 41 | #:use-module (gnu system vm) |
| 42 | #:export (cross-hurd-image | 42 | #:export (%base-packages/hurd |
| 43 | %base-packages/hurd | ||
| 44 | %base-services/hurd | 43 | %base-services/hurd |
| 45 | %hurd-default-operating-system | 44 | %hurd-default-operating-system |
| 46 | %hurd-default-operating-system-kernel)) | 45 | %hurd-default-operating-system-kernel)) |
| 47 | 46 | ||
| 48 | ;;; Commentary: | 47 | ;;; Commentary: |
| 49 | ;;; | 48 | ;;; |
| 50 | ;;; This module provides tools to (cross-)build GNU/Hurd virtual machine | 49 | ;;; This module provides system-specifics for the GNU/Hurd operating system |
| 51 | ;;; images. | 50 | ;;; and virtual machine. |
| 52 | ;;; | 51 | ;;; |
| 53 | ;;; Code: | 52 | ;;; Code: |
| 54 | 53 | ||
| @@ -104,173 +103,3 @@ | |||
| 104 | (pam-services '()) | 103 | (pam-services '()) |
| 105 | (setuid-programs '()) | 104 | (setuid-programs '()) |
| 106 | (sudoers-file #f))) | 105 | (sudoers-file #f))) |
| 107 | |||
| 108 | (define* (cross-hurd-image #:key (hurd hurd) (gnumach gnumach)) | ||
| 109 | "Return a cross-built GNU/Hurd image." | ||
| 110 | |||
| 111 | (define (cross-built thing) | ||
| 112 | (with-parameters ((%current-target-system "i586-pc-gnu")) | ||
| 113 | thing)) | ||
| 114 | |||
| 115 | (define (cross-built-entry entry) | ||
| 116 | (manifest-entry | ||
| 117 | (inherit entry) | ||
| 118 | (item (cross-built (manifest-entry-item entry))) | ||
| 119 | (dependencies (map cross-built-entry | ||
| 120 | (manifest-entry-dependencies entry))))) | ||
| 121 | |||
| 122 | (define system-profile | ||
| 123 | (profile | ||
| 124 | (content | ||
| 125 | (map-manifest-entries cross-built-entry | ||
| 126 | (packages->manifest %base-packages/hurd))))) | ||
| 127 | |||
| 128 | (define grub.cfg | ||
| 129 | (let ((hurd (cross-built hurd)) | ||
| 130 | (mach (with-parameters ((%current-system "i686-linux")) | ||
| 131 | gnumach)) | ||
| 132 | (libc (cross-libc "i586-pc-gnu"))) | ||
| 133 | (computed-file "grub.cfg" | ||
| 134 | #~(call-with-output-file #$output | ||
| 135 | (lambda (port) | ||
| 136 | (format port " | ||
| 137 | set timeout=2 | ||
| 138 | search.file ~a/boot/gnumach | ||
| 139 | |||
| 140 | menuentry \"GNU\" { | ||
| 141 | multiboot ~a/boot/gnumach root=device:hd0s1 | ||
| 142 | module ~a/hurd/ext2fs.static ext2fs \\ | ||
| 143 | --multiboot-command-line='${kernel-command-line}' \\ | ||
| 144 | --host-priv-port='${host-port}' \\ | ||
| 145 | --device-master-port='${device-port}' \\ | ||
| 146 | --exec-server-task='${exec-task}' -T typed '${root}' \\ | ||
| 147 | '$(task-create)' '$(task-resume)' | ||
| 148 | module ~a/lib/ld.so.1 exec ~a/hurd/exec '$(exec-task=task-create)' | ||
| 149 | }\n" | ||
| 150 | #+mach #+mach #+hurd | ||
| 151 | #+libc #+hurd)))))) | ||
| 152 | |||
| 153 | (define fstab | ||
| 154 | (plain-file "fstab" | ||
| 155 | "# This file was generated from your Guix configuration. Any changes | ||
| 156 | # will be lost upon reboot or reconfiguration. | ||
| 157 | |||
| 158 | /dev/hd0s1 / ext2 defaults | ||
| 159 | ")) | ||
| 160 | |||
| 161 | (define passwd | ||
| 162 | (plain-file "passwd" | ||
| 163 | "root:x:0:0:root:/root:/bin/sh | ||
| 164 | guixbuilder:x:1:1:guixbuilder:/var/empty:/bin/no-sh | ||
| 165 | ")) | ||
| 166 | |||
| 167 | (define group | ||
| 168 | (plain-file "group" | ||
| 169 | "guixbuild:x:1:guixbuilder | ||
| 170 | ")) | ||
| 171 | |||
| 172 | (define shadow | ||
| 173 | (plain-file "shadow" | ||
| 174 | "root::0:0:0:0::: | ||
| 175 | ")) | ||
| 176 | |||
| 177 | (define etc-profile | ||
| 178 | (plain-file "profile" | ||
| 179 | "\ | ||
| 180 | export PS1='\\u@\\h\\$ ' | ||
| 181 | |||
| 182 | GUIX_PROFILE=\"/run/current-system/profile\" | ||
| 183 | . \"$GUIX_PROFILE/etc/profile\" | ||
| 184 | |||
| 185 | GUIX_PROFILE=\"$HOME/.guix-profile\" | ||
| 186 | if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then | ||
| 187 | . \"$GUIX_PROFILE/etc/profile\" | ||
| 188 | fi\n")) | ||
| 189 | |||
| 190 | (define hurd-directives | ||
| 191 | `((directory "/servers") | ||
| 192 | ,@(map (lambda (server) | ||
| 193 | `(file ,(string-append "/servers/" server))) | ||
| 194 | '("startup" "exec" "proc" "password" | ||
| 195 | "default-pager" "crash-dump-core" | ||
| 196 | "kill" "suspend")) | ||
| 197 | ("/servers/crash" -> "crash-dump-core") | ||
| 198 | (directory "/servers/socket") | ||
| 199 | (file "/servers/socket/1") | ||
| 200 | (file "/servers/socket/2") | ||
| 201 | (file "/servers/socket/16") | ||
| 202 | ("/servers/socket/local" -> "1") | ||
| 203 | ("/servers/socket/inet" -> "2") | ||
| 204 | ("/servers/socket/inet6" -> "16") | ||
| 205 | (directory "/boot") | ||
| 206 | ("/boot/grub.cfg" -> ,grub.cfg) ;XXX: not strictly needed | ||
| 207 | ("/hurd" -> ,(file-append (with-parameters ((%current-target-system | ||
| 208 | "i586-pc-gnu")) | ||
| 209 | hurd) | ||
| 210 | "/hurd")) | ||
| 211 | |||
| 212 | ;; TODO: Create those during activation, eventually. | ||
| 213 | (directory "/root") | ||
| 214 | (file "/root/.guile" | ||
| 215 | ,(object->string | ||
| 216 | '(begin | ||
| 217 | (use-modules (ice-9 readline) (ice-9 colorized)) | ||
| 218 | (activate-readline) (activate-colorized)))) | ||
| 219 | (directory "/run") | ||
| 220 | (directory "/run/current-system") | ||
| 221 | ("/run/current-system/profile" -> ,system-profile) | ||
| 222 | ("/etc/profile" -> ,etc-profile) | ||
| 223 | ("/etc/fstab" -> ,fstab) | ||
| 224 | ("/etc/group" -> ,group) | ||
| 225 | ("/etc/passwd" -> ,passwd) | ||
| 226 | ("/etc/shadow" -> ,shadow) | ||
| 227 | (file "/etc/hostname" "guixygnu") | ||
| 228 | (file "/etc/resolv.conf" | ||
| 229 | "nameserver 10.0.2.3\n") | ||
| 230 | ("/etc/services" -> ,(file-append (with-parameters ((%current-target-system | ||
| 231 | "i586-pc-gnu")) | ||
| 232 | net-base) | ||
| 233 | "/etc/services")) | ||
| 234 | ("/etc/protocols" -> ,(file-append (with-parameters ((%current-target-system | ||
| 235 | "i586-pc-gnu")) | ||
| 236 | net-base) | ||
| 237 | "/etc/protocols")) | ||
| 238 | ("/etc/motd" -> ,(file-append (with-parameters ((%current-target-system | ||
| 239 | "i586-pc-gnu")) | ||
| 240 | hurd) | ||
| 241 | "/etc/motd")) | ||
| 242 | ("/etc/login" -> ,(file-append (with-parameters ((%current-target-system | ||
| 243 | "i586-pc-gnu")) | ||
| 244 | hurd) | ||
| 245 | "/etc/login")) | ||
| 246 | |||
| 247 | |||
| 248 | ;; XXX can we instead, harmlessly set _PATH_TTYS (from glibc) in runttys.c? | ||
| 249 | ("/etc/ttys" -> ,(file-append (with-parameters ((%current-target-system | ||
| 250 | "i586-pc-gnu")) | ||
| 251 | hurd) | ||
| 252 | "/etc/ttys")) | ||
| 253 | ("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system | ||
| 254 | "i586-pc-gnu")) | ||
| 255 | bash) | ||
| 256 | "/bin/sh")))) | ||
| 257 | |||
| 258 | (qemu-image #:file-system-type "ext2" | ||
| 259 | #:file-system-options '("-o" "hurd") | ||
| 260 | #:device-nodes 'hurd | ||
| 261 | #:inputs `(("system" ,system-profile) | ||
| 262 | ("grub.cfg" ,grub.cfg) | ||
| 263 | ("fstab" ,fstab) | ||
| 264 | ("passwd" ,passwd) | ||
| 265 | ("group" ,group) | ||
| 266 | ("etc-profile" ,etc-profile) | ||
| 267 | ("shadow" ,shadow)) | ||
| 268 | #:copy-inputs? #t | ||
| 269 | #:os system-profile | ||
| 270 | #:bootcfg-drv grub.cfg | ||
| 271 | #:bootloader grub-bootloader | ||
| 272 | #:register-closures? #f | ||
| 273 | #:extra-directives hurd-directives)) | ||
| 274 | |||
| 275 | ;; Return this thunk so one can type "guix build -f gnu/system/hurd.scm". | ||
| 276 | cross-hurd-image | ||
