forked from SystemCrafters/guix-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-iso.sh
More file actions
executable file
·42 lines (33 loc) · 1.44 KB
/
Copy pathbuild-iso.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# -----------------------------------------------------------------------------
# Utilities
# -----------------------------------------------------------------------------
die() {
# **
# Prints a message to stderr & exits script with non-successful code "1"
# *
printf '%s\n' "$@" >&2
exit 1
}
# -----------------------------------------------------------------------------
# Main
# -----------------------------------------------------------------------------
# Write out the channels file so it can be included
guix time-machine -C './guix/base-channels.scm' -- \
describe -f channels > './guix/channels.scm' || exit 0
#
# Note that this outputs also specific commits to the channels file, which is not a great
# idea in general...
#
# Build the image
printf 'Attempting to build the image...\n\n'
printf 'Note that this script also builds a full kernel, be sure to have at least 30GBs on /tmp or choose a different TMPDIR for guix-daemon\n\n'
image=$(guix time-machine -C './guix/channels.scm' --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' -- system image -t iso9660 './guix/installer.scm') \
|| die 'Could not create image.'
release_tag=$(date +"%Y%m%d%H%M")
cp "${image}" "./guix-installer-${release_tag}.iso" ||
die 'An error occurred while copying.'
printf 'Image was succesfully built: %s\n' "${image}"
# cleanup
unset -f die
unset -v image release_tag