mumble-vm-install.sh: switch to guix system init

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-20 17:28:45 +02:00
parent 65f67ada92
commit f858429ad4
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
2 changed files with 25 additions and 10 deletions

View File

@ -1,7 +1,7 @@
<domain type="kvm">
<name>guix-vm-installer</name>
<memory unit="KiB">16777216</memory>
<currentMemory unit="KiB">16777216</currentMemory>
<memory unit="KiB">4194304</memory>
<currentMemory unit="KiB">4194304</currentMemory>
<resource>
<partition>/machine</partition>
</resource>

View File

@ -207,15 +207,30 @@ guix shell -C --nesting autoconf automake bash coreutils grep sed -- \
guix shell -C --nesting bash coreutils gawk grep sed -- \
./configure ; report "./configure"
# TODO: use guix init or temporary storage instead to reduce the
# memory consumption. Right now we tested this script with 16GiB of
# RAM which is probably too big for many potential users. Requiring
# 4GiB would be more reasonable.
guix shell -C --nesting automake coreutils gawk grep make sed -- \
make ; report "make"
guix shell -C --nesting automake coreutils gawk grep make sed tar xz -- \
make mumble-vm.tar.xz ; report "Generating VM definition"
guix shell -C ddrescue -- ddrescue mumble-vm.img /dev/vda && sync ; \
report "ddrescue mumble-vm.img /dev/vda"
cp mumble-vm.tar.xz ../ && \
cd ../ && \
rm -rf mumble-vm && \
guix shell -C tar xz -- tar xf mumble-vm.tar.xz && \
rm -f mumble-vm.tar.xz ; report "Removing git repository"
guix gc ; report "guix gc"
echo 'label: gpt' | sfdisk /dev/vda ; report "GPT creation on /dev/vda" ; \
report "GPT formating"
echo ';;L;*' | sfdisk /dev/vda ; report "/dev/vda1 creation" ; \
report "Adding partition"
mkfs.ext4 -F -L Guix_image /dev/vda1 ; report "EXT4 formating"
mount /dev/vda1 /mnt ; report "mount /dev/vda1 /mnt" ; report "mounting rootfs"
herd start cow-store /mnt ; report "Using /mnt for storing guix system init packages"
guix system init mumble-vm-system.scm /mnt ; report "guix system init"
umount /mnt ; report "umount rootfs"
printf "Installation done: %s\n" \
"you can remove the install media and reboot to the new VM"