Commit 098cacc0 authored by Benjamin Slade's avatar Benjamin Slade

beginning to set up to take input

- also check to make sure /mnt isn't hard-coded
parent fa58f164
#!/bin/bash
read -p "Enter the device you're installing to [/dev/sda]: " DEVICE
DEVICE=${DEVICE:-/dev/sda}
DEVICE=/dev/sda # set this accordingly
LUKSNAME=samcryptz # set this accordingly
read -p "Enter the name to assign to the LUKS partition [cryptz]: " LUKSNAME
LUKSNAME=${LUKSNAME:-cryptz}
read -p "You want to install to ${DEVICE}? Are you sure? Proceeding will irrevocably wipe ${DEVICE}. Please type 'yes' in ALLCAPS to proceed: " proceed
if [ proceed == "YES" ]
then
wipefs --force --all ${DEVICE}
# Set MBR
......@@ -17,3 +24,7 @@ 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='`
else
echo "Cancelled."
fi
......@@ -8,9 +8,15 @@ ip link sh | grep ether | awk '{print $2}' | tr -dc a-f0-9 > /etc/hostid
# or could just generate randomly, as below
# head /dev/urandom | tr -dc a-f0-9 | head -c 13 > /etc/hostid
USERNAME=slade #set accordingly
TARGET=/mnt # set accordingly
ZPOOLNAME=dozer # set to what you want your zpoolname to be
read -p "Enter your planned (non-root) user-name. (You probably don't want the default.) [flynn]: " USERNAME
USERNAME=${USERNAME:-flynn}
read -p "Where should the installation drive be temporarily mounted? (The default should be fine here.) [/mnt]: " TARGET
TARGET=${TARGET:-/mnt}
read -p "What name do you want to assign to the zpool? [tank] ('dozer' is another fine choice, as is 'cas', 'trinity', or 'morpheus'.): " ZPOOLNAME
ZPOOLNAME=${ZPOOLNAME:-tank}
ZFSROOTBASENAME=${ZPOOLNAME}/ROOT
ZFSROOTDATASET=${ZFSROOTBASENAME}/system
......
#!/bin/bash
VOIDMIRROR=https://a-hel-fi.m.voidlinux.org/live/current/
VOIDFILE=void-x86_64-ROOTFS-20181111.tar.xz
wget -N ${VOIDMIRROR}/${VOIDFILE}
read -p "Which Void mirror to use [http://alpha.de.repo.voidlinux.org/live/current]: " VOIDMIRROR
VOIDMIRROR=${VOIDMIRROR:-http://alpha.de.repo.voidlinux.org/live/current}
read -p "Which rootfs to use? (You may well need to check this, as a newer rootfs than the displayed default may be available.) [void-x86_64-ROOTFS-20181111.tar.xz]: " VOIDROOTFS
VOIDROOTFS=${VOIDROOTFS:-void-x86_64-ROOTFS-20181111.tar.xz}
wget -N ${VOIDMIRROR}/${VOIDROOTFS}
wget -N ${VOIDMIRROR}/sha256sums.txt
wget -N ${VOIDMIRROR}/sha256sums.txt.sig
tar xfv ./${VOIDFILE} -C ${TARGET}
echo "The checksum of ${VOIDROOTFS} is: "
sha256 ./${VOIDROOTFS}
echo "You may want to verify this checksum in sha256sums.txt."
......@@ -2,17 +2,17 @@
for i in /dev /dev/pts /proc /sys
do
echo -n "mount $i..."
echo -n "mounting $i..."
mount -B $i ${TARGET}$i
echo 'done!'
echo ' completed.'
done
cp /etc/hostid /mnt/etc/ # copy hostid onto actual system
cp -p /etc/resolv.conf ${TARGET}/etc/
cp -p /etc/resolv.conf ${TARGET}/etc/ # copy DNS resolver configuration
cp /etc/hostid ${TARGET}/etc/ # copy hostid onto actual system
# copy cryptuuid & luksname into chroot location
echo "export CRYPTUUID=${CRYPTUUID}" > /mnt/importvars.sh
echo "export LUKSNAME=${LUKSNAME}" >> /mnt/importvars.sh
echo "export ZPOOLNAME=${ZPOOLNAME}" >> /mnt/importvars.sh
cp 06-config-inside-chroot.sh /mnt/
chroot /mnt
echo "export CRYPTUUID=${CRYPTUUID}" > ${TARGET}/importvars.sh
echo "export LUKSNAME=${LUKSNAME}" >> ${TARGET}/importvars.sh
echo "export ZPOOLNAME=${ZPOOLNAME}" >> ${TARGET}/importvars.sh
cp 06-config-inside-chroot.sh ${TARGET}
chroot ${TARGET}
......@@ -7,6 +7,9 @@ SYSTEMNAME="sushoma" # adjust accordingly
echo ${SYSTEMNAME} > /etc/hostname
# TODO: set up /etc/rc.conf
# timezone
# keyboard
# systemname
echo "Set root password: "
passwd
......
......@@ -2,7 +2,9 @@
for i in sys proc dev/pts dev
do
echo -n "unmounting $i..."
umount ${TARGET}/$i
echo ' completed.'
done
/sbin/zfs unmount -a
......
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