Commit 7392d385 authored by Benjamin Slade's avatar Benjamin Slade

clean up

parent 7be84bf5
#!/bin/bash
DEVICE=/dev/sda # set this accordingly
LUKSNAME=samcryptz
wipefs --force --all ${DEVICE}
# Set MBR
/sbin/parted --script --align opt ${DEVICE} mklabel msdos
/sbin/parted --script --align opt ${DEVICE} mkpart pri 1MiB 100%
/sbin/parted --script --align opt ${DEVICE} set 1 boot on
/sbin/parted --script --align opt ${DEVICE} p # print
# Create LUKS container and open/mount it
cryptsetup luksFormat --type luks1 ${DEVICE}1
cryptsetup luksOpen ${DEVICE}1 ${LUKSNAME}
# We put this UUID into an env var to reuse later
CRYPTUUID=`blkid -o export ${DEVICE}1 | grep -E '^UUID='`
#!/bin/bash
TARGET=/mnt
ZPOOLNAME=dozer
ZFSROOTBASENAME=${ZPOOLNAME}/ROOT
ZFSROOTDATASET=${ZFSROOTBASENAME}/void
/sbin/zpool create -f \
-R ${TARGET} \
-O mountpoint=none \
-O relatime=on \
-O compression=on \
-o ashift=12 \
${ZPOOLNAME} /dev/mapper/${LUKSNAME}
/sbin/zfs create -o canmount=off ${ZFSROOTBASENAME}
/sbin/zfs create -o mountpoint=/ ${ZFSROOTDATASET}
/sbin/zfs create -o mountpoint=/boot ${ZPOOLNAME}/boot
/sbin/zfs create -o mountpoint=/home ${ZPOOLNAME}/home
/sbin/zfs create -o mountpoint=/home/slade ${ZPOOLNAME}/home/slade
/sbin/zfs create -o mountpoint=/root ${ZPOOLNAME}/home/root
/sbin/zfs create -o mountpoint=/var/cache/xbps ${ZPOOLNAME}/var
/sbin/zfs create -o mountpoint=/var ${ZPOOLNAME}/var
/sbin/zfs create -o mountpoint=/var/log ${ZPOOLNAME}/var/log
/sbin/zpool set bootfs=${ZFSROOTDATASET} ${ZPOOLNAME} # Do not skip this step
/sbin/zpool status -v # print zpool info
#!/bin/bash
VOIDMIRROR=https://a-hel-fi.m.voidlinux.org/live/current/
VOIDFILE=void-x86_64-ROOTFS-20181111.tar.xz
wget -N ${VOIDMIRROR}/${VOIDFILE}
wget -N ${VOIDMIRROR}/sha256sums.txt
wget -N ${VOIDMIRROR}/sha256sums.txt.sig
#!/bin/bash
for i in /dev /dev/pts /proc /sys
do
echo -n "mount $i..."
mount -B $i ${TARGET}$i
echo 'done!'
done
cp -p /etc/resolv.conf ${TARGET}/etc/
chroot /mnt
#!/bin/bash
. importvars.sh # get variables
echo "Set root password: "
passwd
# TODO: set up /etc/locale.conf
echo "en_GB.UTF-8 UTF-8" >> /etc/default/libc-locales
xbps-reconfigure -f glibc-locales
xbps-install -Su
xbps-install -S linux cryptsetup grub python python3 zfs
# TODO: dracut
xbps-reconfigure -f linux4.19 # TODO: programmatically figure out name of latest stable linux kernel
# TODO: grub
echo "the following should say 'zfs'; otherwise something has gone wrong: "
grub-probe /
zpool set cachefile=/etc/zfs/zpool.cache ${ZPOOLNAME} # IMPORTANT
zfs create -o sync=always -o primarycache=metadata -o secondarycache=none -b 4k -V 8G -o logbias=throughput ${ZPOOLNAME}/swap
mkswap -f /dev/zvol/rogue/swap
echo "# zol swap vol" >> /etc/fstab
echo "/dev/zvol/${ZPOOLNAME}/swap none swap sw 0 0" >> /etc/fstab
echo "hit return to exit chroot"
read exitchroot
exit
#!/bin/bash
for i in sys proc dev/pts dev
do
umount ${TARGET}/$i
done
/sbin/zfs unmount -a
/sbin/zpool export -a -f
echo "Hit any key to reboot"
read reboot
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment