Compare commits
5 Commits
2ad3de479c
...
226ef3a039
Author | SHA1 | Date | |
---|---|---|---|
226ef3a039 | |||
9892e06b94 | |||
fa954988a9 | |||
d0af376e8c | |||
a73873f764 |
@ -87,6 +87,49 @@ suppkglist="firmware-linux,firmware-linux-nonfree,firmware-bnx2,firmware-bnx2x,n
|
|||||||
# roles will overwrite it by default during configuration.
|
# roles will overwrite it by default during configuration.
|
||||||
root_password="hCb1y2PF"
|
root_password="hCb1y2PF"
|
||||||
|
|
||||||
|
# Cleanup function for failures or final termination
|
||||||
|
cleanup() {
|
||||||
|
set +o errexit
|
||||||
|
|
||||||
|
echo -n "Cleaning up target... "
|
||||||
|
umount ${target}/tmp >&2
|
||||||
|
umount ${target}/run >&2
|
||||||
|
umount ${target}/sys >&2
|
||||||
|
umount ${target}/proc >&2
|
||||||
|
umount ${target}/dev/pts >&2
|
||||||
|
umount ${target}/dev >&2
|
||||||
|
umount ${target}/var/lib/ceph >&2
|
||||||
|
umount ${target}/var/lib/zookeeper >&2
|
||||||
|
umount ${target}/boot/efi >&2
|
||||||
|
umount ${target}/boot >&2
|
||||||
|
umount ${target} >&2
|
||||||
|
vgchange -an >&2
|
||||||
|
rmdir ${target} >&2
|
||||||
|
echo "done."
|
||||||
|
|
||||||
|
echo -n "Removing lockfile... "
|
||||||
|
rm ${lockfile}
|
||||||
|
echo "done."
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [[ -z ${DONE} ]]; then
|
||||||
|
case ${install_option} in
|
||||||
|
on)
|
||||||
|
echo "A fatal error occurred; rebooting in 30 seconds. Press any key to spawn a shell."
|
||||||
|
if ! read -t 30; then
|
||||||
|
reboot
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "A fatal error occurred. Use the shell to inspect the log for errors at:"
|
||||||
|
echo -e " ${logfile}"
|
||||||
|
echo "To restart the installer, run '/install.sh'."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
# Checkin function
|
# Checkin function
|
||||||
seed_checkin() (
|
seed_checkin() (
|
||||||
case ${1} in
|
case ${1} in
|
||||||
@ -136,7 +179,7 @@ seed_config() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Fetch the seed config
|
# Fetch the seed config
|
||||||
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed
|
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed || exit 1
|
||||||
|
|
||||||
# Load the variables from the seed config
|
# Load the variables from the seed config
|
||||||
. /tmp/install.seed || exit 1
|
. /tmp/install.seed || exit 1
|
||||||
@ -180,6 +223,14 @@ seed_config() {
|
|||||||
echo "Invalid disk or disk not found!"
|
echo "Invalid disk or disk not found!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "WARNING! All data on block device ${target_disk} will be wiped!"
|
||||||
|
echo -n "Press any key within 15 seconds to cancel... "
|
||||||
|
if read -t 15; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
interactive_config() {
|
interactive_config() {
|
||||||
@ -538,43 +589,6 @@ case ${install_option} in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
set +o errexit
|
|
||||||
echo -n "Cleaning up... "
|
|
||||||
umount ${target}/tmp >&2
|
|
||||||
umount ${target}/run >&2
|
|
||||||
umount ${target}/sys >&2
|
|
||||||
umount ${target}/proc >&2
|
|
||||||
umount ${target}/dev/pts >&2
|
|
||||||
umount ${target}/dev >&2
|
|
||||||
umount ${target}/var/lib/ceph >&2
|
|
||||||
umount ${target}/var/lib/zookeeper >&2
|
|
||||||
umount ${target}/boot/efi >&2
|
|
||||||
umount ${target}/boot >&2
|
|
||||||
umount ${target} >&2
|
|
||||||
vgchange -an >&2
|
|
||||||
rmdir ${target} >&2
|
|
||||||
rm ${lockfile}
|
|
||||||
echo "done."
|
|
||||||
echo
|
|
||||||
|
|
||||||
if [[ -z ${DONE} ]]; then
|
|
||||||
case ${install_option} in
|
|
||||||
on)
|
|
||||||
echo "A fatal error occurred; rebooting in 30 seconds. Press any key to spawn a shell."
|
|
||||||
if ! read -t 30; then
|
|
||||||
reboot
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# noop
|
|
||||||
true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
echo -n "Determining partition sizes... "
|
echo -n "Determining partition sizes... "
|
||||||
blockdev_size_bytes="$( blockdev --getsize64 ${target_disk} )"
|
blockdev_size_bytes="$( blockdev --getsize64 ${target_disk} )"
|
||||||
blockdev_size_gbytes="$(( ${blockdev_size_bytes} / 1024 / 1024 / 1024 - 1))"
|
blockdev_size_gbytes="$(( ${blockdev_size_bytes} / 1024 / 1024 / 1024 - 1))"
|
||||||
@ -596,14 +610,14 @@ fi
|
|||||||
|
|
||||||
echo -n "Unmounting potential partitions on target device... "
|
echo -n "Unmounting potential partitions on target device... "
|
||||||
for mount in $( mount | grep "${target_disk}" | awk '{ print $3 }' | sort -r ); do
|
for mount in $( mount | grep "${target_disk}" | awk '{ print $3 }' | sort -r ); do
|
||||||
umount -f ${mount} >&2
|
umount -f ${mount} >&2 || true
|
||||||
done
|
done
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
echo -n "Unmounting potential LVM logical volumes on target device... "
|
echo -n "Unmounting potential LVM logical volumes on target device... "
|
||||||
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
||||||
for mount in $( mount | grep "/${vg}" | awk '{ print $3 }' | sort -r ); do
|
for mount in $( mount | grep "/${vg}" | awk '{ print $3 }' | sort -r ); do
|
||||||
umount -f ${mount} >&2
|
umount -f ${mount} >&2 || true
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
echo "done."
|
echo "done."
|
||||||
@ -612,13 +626,14 @@ echo -n "Disabing potential LVM volume groups on target device... "
|
|||||||
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
||||||
vgchange -an ${vg} >&2 || true
|
vgchange -an ${vg} >&2 || true
|
||||||
sleep 1
|
sleep 1
|
||||||
vgchange -an ${vg} >&2
|
vgchange -an ${vg} >&2 || true
|
||||||
|
yes | vgremove -f ${vg} || true
|
||||||
done
|
done
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
echo -n "Removing existing LVM physical volumes... "
|
echo -n "Removing existing LVM physical volumes... "
|
||||||
for pv in $( pvcscan | grep "${target_disk}" | awk '{ print $2 }' ); do
|
for pv in $( pvcscan | grep "${target_disk}" | awk '{ print $2 }' ); do
|
||||||
yes | pvremove ${pv}
|
yes | pvremove -f ${pv} || true
|
||||||
done
|
done
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
@ -667,7 +682,7 @@ yes | pvcreate -ffy ${target_disk}4 >&2
|
|||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
echo -n "Creating LVM VG 'vgx'... "
|
echo -n "Creating LVM VG 'vgx'... "
|
||||||
yes | vgcreate vgx ${target_disk}4 >&2
|
yes | vgcreate -f vgx ${target_disk}4 >&2
|
||||||
echo "done."
|
echo "done."
|
||||||
|
|
||||||
echo -n "Creating root logical volume (${size_root_lv}GB)... "
|
echo -n "Creating root logical volume (${size_root_lv}GB)... "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user