script(hosts/Infini-STICK): add mount script
This commit is contained in:
parent
33362f1c1f
commit
e2e9cd4458
2 changed files with 35 additions and 0 deletions
28
hosts/Infini-STICK/mount.bash
Executable file
28
hosts/Infini-STICK/mount.bash
Executable file
|
@ -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
|
|
@ -53,6 +53,13 @@ Setup with a wide array of hardware compatibility, specifically using the =porta
|
||||||
<<cleanup>>
|
<<cleanup>>
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+NAME: mount
|
||||||
|
#+BEGIN_SRC bash :tangle mount.bash :shebang "#!/usr/bin/env bash" :noweb yes :comments noweb
|
||||||
|
<<boilerplate>>
|
||||||
|
|
||||||
|
<<mounting>>
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Script Boilerplate
|
** Script Boilerplate
|
||||||
|
|
||||||
#+NAME: boilerplate
|
#+NAME: boilerplate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue