QOL improvements to scripts and script
This commit is contained in:
parent
a2cb5a6fec
commit
4cf98e06a7
15
buildiso.sh
15
buildiso.sh
|
@ -27,7 +27,7 @@ srcliveisofilename="$( wget -O- ${srcliveisopath}/ | grep 'debian-live-.*-amd64-
|
|||
srcliveisourl="${srcliveisopath}/${srcliveisofilename}"
|
||||
|
||||
show_help() {
|
||||
echo -e "PVC install ISO generator"
|
||||
echo -e "PVC install ISO generator"
|
||||
echo
|
||||
echo -e " Generates a mostly-automated installer ISO for a PVC node base system. The ISO"
|
||||
echo -e " boots, then runs 'install.sh' to perform the installation to a target server."
|
||||
|
@ -54,11 +54,11 @@ while getopts "h?o:s:a" opt; do
|
|||
exit 0
|
||||
;;
|
||||
o)
|
||||
isofilename=$OPTARG
|
||||
isofilename=$OPTARG
|
||||
;;
|
||||
s)
|
||||
srcliveisourl=$OPTARG
|
||||
;;
|
||||
s)
|
||||
srcliveisourl=$OPTARG
|
||||
;;
|
||||
a)
|
||||
usecachedsquashfs='y'
|
||||
;;
|
||||
|
@ -99,7 +99,7 @@ prepare_iso() {
|
|||
echo -n "Extracting Debian Live ISO files... "
|
||||
iso_tempdir=$( mktemp -d )
|
||||
sudo mount artifacts/${srcliveisofile} ${iso_tempdir} &>/dev/null || fail "Error mounting Live ISO file."
|
||||
sudo rsync -au --exclude live/filesystem.squashfs ${iso_tempdir}/ ${tempdir}/installer/ &>/dev/null || fail "Error extracting Live ISO files."
|
||||
sudo rsync -au --exclude live/filesystem.squashfs ${iso_tempdir}/ ${tempdir}/installer/ &>/dev/null || fail "Error extracting Live ISO files."
|
||||
sudo umount ${iso_tempdir} &>/dev/null || fail "Error unmounting Live ISO file."
|
||||
rmdir ${iso_tempdir} &>/dev/null
|
||||
echo "done."
|
||||
|
@ -129,7 +129,8 @@ prepare_rootfs() {
|
|||
sudo tee ${tempdir}/rootfs/etc/resolv.conf <<<"nameserver 8.8.8.8" &>/dev/null || fail "Error setting resolv.conf"
|
||||
sudo tee -a ${tempdir}/rootfs/root/.bashrc <<<"/install.sh" &>/dev/null || fail "Error setting bashrc."
|
||||
sudo chroot ${tempdir}/rootfs/ /usr/bin/passwd -d root &>/dev/null || fail "Error disabling root password."
|
||||
sudo cp install.sh ${tempdir}/rootfs/ &>/dev/null || fail "Error copying install.sh to tempdir."
|
||||
sudo cp install.sh ${tempdir}/rootfs/ &>/dev/null || fail "Error copying install.sh to tempdir."
|
||||
sudo sed -i "s/XXISOXX/${isofilename}/g" ${tempdir}/rootfs/install.sh &>/dev/null || fail "Error editing install.sh script."
|
||||
echo "done."
|
||||
|
||||
echo -n "Generating squashfs image of live installation... "
|
||||
|
|
18
install.sh
18
install.sh
|
@ -12,16 +12,19 @@ debpkglist="lvm2,parted,gdisk,grub-pc,grub-efi-amd64,linux-image-amd64,sudo,vim,
|
|||
|
||||
clear
|
||||
|
||||
echo "------------------------------------------------"
|
||||
echo "| Preparing to install a PVC node base system. |"
|
||||
echo "------------------------------------------------"
|
||||
echo "-----------------------------------------------------"
|
||||
echo "| PVC Node installer (XXISOXX) |"
|
||||
echo "-----------------------------------------------------"
|
||||
echo
|
||||
echo "This LiveCD will install a PVC node base system ready for bootstrapping with 'pvc-ansible'."
|
||||
echo
|
||||
echo "NOTE: If you make a mistake and need to restart the installer while answering"
|
||||
echo " the questions below, you may do so by typing ^C to cancel the script,"
|
||||
echo " then re-running it by calling /install.sh in the resulting shell."
|
||||
echo
|
||||
|
||||
echo "1) Please enter a fully-qualified hostname for the system."
|
||||
echo "1) Please enter a fully-qualified hostname for the system. This should match the hostname"
|
||||
echo "in the 'pvc-ansible' inventory."
|
||||
while [[ -z ${target_hostname} ]]; do
|
||||
echo
|
||||
echo -n "> "
|
||||
|
@ -46,7 +49,8 @@ disks="$(
|
|||
|
||||
echo "2) Please enter the disk to install the PVC base system to. This disk will be"
|
||||
echo "wiped, an LVM PV created on it, and the system installed to this LVM."
|
||||
echo "NOTE: PVC requires a disk of >16GB to be installed to. 32GB is the recommended minimum."
|
||||
echo "NOTE: PVC requires a disk of >16GB to be installed to. 32GB is the recommended"
|
||||
echo "minimum size, and disks larger than 64GB are not particularly useful."
|
||||
echo
|
||||
echo "Available disks:"
|
||||
echo
|
||||
|
@ -71,8 +75,8 @@ interfaces="$(
|
|||
ip address | grep '^[0-9]' | grep 'eno\|enp\|ens\|wlp' | awk '{ print $2"\t"$3 }' | tr -d ':'
|
||||
)"
|
||||
echo "3a) Please enter the primary network interface for external connectivity. If"
|
||||
echo " no entries are shown here, ensure a cable is connected, then restart the"
|
||||
echo " installer."
|
||||
echo "no entries are shown here, ensure a cable is connected, then restart the"
|
||||
echo "installer."
|
||||
echo
|
||||
echo "Available interfaces:"
|
||||
echo
|
||||
|
|
Loading…
Reference in New Issue