From e2e9cd445809e5b95431f53dc32bc015b6d5810d Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Thu, 9 Dec 2021 14:08:02 -0500 Subject: [PATCH] script(hosts/Infini-STICK): add mount script --- hosts/Infini-STICK/mount.bash | 28 ++++++++++++++++++++++++++++ hosts/Infini-STICK/readme.org | 7 +++++++ 2 files changed, 35 insertions(+) create mode 100755 hosts/Infini-STICK/mount.bash diff --git a/hosts/Infini-STICK/mount.bash b/hosts/Infini-STICK/mount.bash new file mode 100755 index 0000000..7a27de1 --- /dev/null +++ b/hosts/Infini-STICK/mount.bash @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# [[file:readme.org::mount][mount]] +# [[[[file:/etc/nixos/hosts/Infini-STICK/readme.org::boilerplate][boilerplate]]][boilerplate]] +DISK=$1 + +sudo mkdir -p /mnt + +if mountpoint -q -- "/mnt"; then + echo "ERROR: /mnt is a mounted filesystem, aborting" + exit 1 +fi +# boilerplate ends here + +# [[[[file:/etc/nixos/hosts/Infini-STICK/readme.org::mounting][mounting]]][mounting]] +echo "LOG: Mounting tmpfs" +sudo mount -t tmpfs root /mnt + +echo "LOG: - Mounting persistent directories" +sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}1" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}1" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}1" /mnt/boot + +echo "LOG: - Mounting EFI System Partition" +sudo mkdir -p /mnt/boot/efi +sudo mount "${DISK}2" /mnt/boot/efi +# mounting ends here +# mount ends here diff --git a/hosts/Infini-STICK/readme.org b/hosts/Infini-STICK/readme.org index 385e8a9..11b5324 100644 --- a/hosts/Infini-STICK/readme.org +++ b/hosts/Infini-STICK/readme.org @@ -53,6 +53,13 @@ Setup with a wide array of hardware compatibility, specifically using the =porta <> #+END_SRC +#+NAME: mount +#+BEGIN_SRC bash :tangle mount.bash :shebang "#!/usr/bin/env bash" :noweb yes :comments noweb +<> + +<> +#+END_SRC + ** Script Boilerplate #+NAME: boilerplate