aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
Diffstat (limited to 'README.org')
-rw-r--r--README.org154
1 files changed, 144 insertions, 10 deletions
diff --git a/README.org b/README.org
index bd37139..0bac7f7 100644
--- a/README.org
+++ b/README.org
@@ -63,22 +63,32 @@ From this we extract the necessary guix bootloader configuration options (for se
- terminal-inputs :: console serial
- terminal-outputs :: console serial
-*** TODO Manual modifications to Debian's Grub
+*** Manual modifications to Debian's Grub
-In ~/etc/default/grub~ we need to modify ~GRUB_DEFAULT=<MENU_ITEM>~
+Modify grub config on debian to add an additional (and default) option to chainload Guix
+grub.
-TODO ...
+- Add a menuitem for Guix in ~/etc/grub.d/40_custom~, where ~<EFI-UUID>~ is replaced with the
+ efi partition UUID.
-Modify grub config on debian to add an additional (and default) option to chainload Guix grub
+ #+begin_src text
+ menuentry "Gnu Guix" {
+ insmod part_gpt
+ insmod search_fs_uuid
+ insmod chain
+ search --fs-uuid --no-floppy --set=root <EFI-UUID>
+ chainloader ($root)/EFI/Guix/grubx64.efi
+ }
+ #+end_src
-- Add a menuitem for Guix in ~/etc/grub.d/40_custom~
-- Modify ~/etc/default/grub~ setting ~GRUB_DEFAULT=<n>~ where ~<n>~ is the menu item number,
- starting from 0, or (preferably) the menu item name/id.
+- Modify ~/etc/default/grub~ setting ~GRUB_DEFAULT="Gnu Guix"~
+
+- Run ~grub-mkconfig -o /boot/grub/grub.cfg~
** Network configuration
-Using the a snippet from ~/etc/network/interfaces~ below, we can extract the necessary details
-to configure Guix's static-networking-service.
+Using the a snippet taken from ~/etc/network/interfaces~ on the existing debian installation
+(below), we can extract the necessary details to configure Guix's static-networking-service.
- Interface :: eno8303
- Address :: 216.37.76.55/24
@@ -102,6 +112,15 @@ to configure Guix's static-networking-service.
For this installation we are using ~/dev/sda~ (a 1.5T ssd which is faster then the
alternative 3.6T ssd in the server).
+First, we require a variety of tools to setup and partition the disk destined for Guix
+installation. These could be installed on debian, however an alternative approach would be to
+use Guix from debian as a package manager to temporarily provide the prerequisite tools. This
+can be done using the shell spawned from the following command.
+
+#+begin_src shell
+ guix shell parted btrfs-progs dosfstools
+#+end_src
+
*** Create disk partition table and layout
#+begin_src bash
@@ -176,9 +195,10 @@ Create nested subvolumes for ~/gnu/store~ and ~/home~.
#+begin_src bash
mkdir /mnt/swap
mount -o subvol=@swap /dev/sda2 /mnt/swap
- dd if=/dev/zero of=/mnt/swap/swapfile bs=1M count=32768
chmod 600 /mnt/swap/swapfile
+ touch /mnt/swap/swapfile
chattr +C /mnt/swap/swapfile
+ dd if=/dev/zero of=/mnt/swap/swapfile bs=1M count=32768
mkswap /mnt/swap/swapfile
#+end_src
@@ -202,7 +222,121 @@ To test the configuration in a vm before deployment, the following can be used.
$(guix time-machine -C channels.scm -- system vm -e '(@ (guix-na config balg02) %system)') -m 2G -smp 2 -nic user,model=virtio-net-pci
#+end_src
+** Manual Testing of bootstrapping Guix from a Debian VM
+
+To correctly test this deployment, a environment that mimics bal02g should be used. The
+closest to this is a VM with debian installed, with an additional virtual disk to bootstrap
+guix onto. This will enable validating bootloader changes required to chainboot Guix's Grub.
+
+This testing could be automated, but was done manually as we do not expect to have to
+bootstrap a system like this often.
+
+*** Setup Debian VM
+
+1. Using ~qemu~, ~libvirt~, ~virtualbox~, etc.. create a VM that boots using UEFI firmware.
+
+ 1. Create an additional virtual disk that will be used to bootstrap Guix onto from Debian.
+ This disk should be ~>20GiB~.
+
+ 2. Ensure that there is a serial device attached to the VM.
+
+2. Install Debian 12 on the VM created during step 1 (this can be a minimal server
+ installation, no desktop, etc..).
+
+ 1. It's worth noting that for some reason debian didn't setup a efi boot
+ entry for some reason. Not sure why. To create one I used:
+
+ #+begin_src shell
+ efibootmgr --create --disk /dev/vda -p 1 -L "Debian" -l "\EFI\debian\grub64.efi"
+ #+end_src
+
+ After which I would have adjusted the boot order with:
+
+ #+begin_src shell
+ efibootmgr -o X,Y,...
+ #+end_src
+
+ However, in my case it was not needed as the boot order had debian first.
+
+3. Reboot VM; further configure Debian.
+
+ 1. Enable serial for debian grub
+
+ Modify ~/etc/default/grub~, adjusting ~GRUB_TERMINAL~ and ~GRUB_CMDLINE_LINUX_DEFAULT~ as
+ follows.
+
+ #+begin_src text
+ GRUB_TERMINAL="console serial"
+ GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200n8"
+ #+end_src
+
+ 2. Enable getty over serial
+
+ #+begin_src shell
+ systemctl enable getty@ttyS0.service
+ systemctl start getty@ttyS0.service
+ #+end_src
+
+*** Test Bootstrapping Gnu Guix from Debian
+
+With the Debian VM setup, we can now apply the documented bootstrapping steps.
+
+1. [[*Disk Partitioning][Disk Partitioning]], but with disks adjusted to match the testing VM.
+2. [[*Bootstrap Guix][Bootstrap Guix]], ensure ~<EFI-UUID>~ matches the VM efi partition used for Guix.
+3. [[*Manual modifications to Debian's Grub][Manual modifications to Debian's Grub]], again ensuring ~<EFI-UUID>~ matches the VM efi
+ partition used for Guix.
+4. Reboot
+
+Following rebooting the VM, its expected that:
+
+- Debian Grub boots first, has "Gnu Guix" as its default selected option, which boots Guixs'
+ Grub.
+- Serial access works for:
+ - Debian and Guix Grub/s
+ - Debian and Guix linux console
+
+As this testing is occurring in a VM, its worth noting things that are NOT expected to to be
+testable.
+
+- The network interfaces are not going to match what is on balg02, so its expected that the
+ networking service will not be able to start.
+
* Bootstrap Guix
Using Guix on debian, bootstrap the machine using the configuration in [[*Define Guix operating-system for the machine][Define Guix
operating-system for the machine]].
+
+** Configure Guix Channels
+
+First, fetch the most recent channel file from the target machine.
+
+#+begin_src shell
+ curl -O https://git.rekahsoft.ca/rekahsoft/guix-north-america/raw/branch/master/channels.scm
+#+end_src
+
+** Create and Bootstrap System
+
+Create a ~bootstrap.scm~ file like below, but where ~<EFI-UUID>~ is replaced with the efi
+partition UUID.
+
+#+begin_src scheme
+ ((@ (guix-na config balg02) balg02) "<EFI-UUID>")
+#+end_src
+
+Use ~guix system init ...~ to instantiate the system, but using guix time-machine to use
+pinned dependencies.
+
+#+begin_src shell
+ guix time-machine -C channels.scm -- system init bootstrap.scm /mnt
+#+end_src
+
+** Post Boostrapping
+
+After guix has been bootstrapped, its useful to do an initial ~guix pull~ using the same
+channels that were used during bootstrapping.
+
+#+begin_src shell
+ guix pull -C /run/current-system/channels.scm
+#+end_src
+
+To ensure your shell refers to the correct guix after its been updated, run ~hash guix~.