Compare commits
No commits in common. "226ef3a03916fb687a1b9ad90df81d6af92549af" and "2ad3de479c748b3ce2bbc7f5a164211c59514a63" have entirely different histories.
226ef3a039
...
2ad3de479c
@ -87,49 +87,6 @@ suppkglist="firmware-linux,firmware-linux-nonfree,firmware-bnx2,firmware-bnx2x,n
|
||||
# roles will overwrite it by default during configuration.
|
||||
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
|
||||
seed_checkin() (
|
||||
case ${1} in
|
||||
@ -179,7 +136,7 @@ seed_config() {
|
||||
done
|
||||
|
||||
# Fetch the seed config
|
||||
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed || exit 1
|
||||
tftp -m binary "${seed_host}" -c get "${seed_file}" /tmp/install.seed
|
||||
|
||||
# Load the variables from the seed config
|
||||
. /tmp/install.seed || exit 1
|
||||
@ -223,14 +180,6 @@ seed_config() {
|
||||
echo "Invalid disk or disk not found!"
|
||||
exit 1
|
||||
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() {
|
||||
@ -589,6 +538,43 @@ case ${install_option} in
|
||||
;;
|
||||
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... "
|
||||
blockdev_size_bytes="$( blockdev --getsize64 ${target_disk} )"
|
||||
blockdev_size_gbytes="$(( ${blockdev_size_bytes} / 1024 / 1024 / 1024 - 1))"
|
||||
@ -610,14 +596,14 @@ fi
|
||||
|
||||
echo -n "Unmounting potential partitions on target device... "
|
||||
for mount in $( mount | grep "${target_disk}" | awk '{ print $3 }' | sort -r ); do
|
||||
umount -f ${mount} >&2 || true
|
||||
umount -f ${mount} >&2
|
||||
done
|
||||
echo "done."
|
||||
|
||||
echo -n "Unmounting potential LVM logical volumes on target device... "
|
||||
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
||||
for mount in $( mount | grep "/${vg}" | awk '{ print $3 }' | sort -r ); do
|
||||
umount -f ${mount} >&2 || true
|
||||
umount -f ${mount} >&2
|
||||
done
|
||||
done
|
||||
echo "done."
|
||||
@ -626,14 +612,13 @@ echo -n "Disabing potential LVM volume groups on target device... "
|
||||
for vg in $( pvscan | grep "${target_disk}" | awk '{ print $4 }' ); do
|
||||
vgchange -an ${vg} >&2 || true
|
||||
sleep 1
|
||||
vgchange -an ${vg} >&2 || true
|
||||
yes | vgremove -f ${vg} || true
|
||||
vgchange -an ${vg} >&2
|
||||
done
|
||||
echo "done."
|
||||
|
||||
echo -n "Removing existing LVM physical volumes... "
|
||||
for pv in $( pvcscan | grep "${target_disk}" | awk '{ print $2 }' ); do
|
||||
yes | pvremove -f ${pv} || true
|
||||
yes | pvremove ${pv}
|
||||
done
|
||||
echo "done."
|
||||
|
||||
@ -682,7 +667,7 @@ yes | pvcreate -ffy ${target_disk}4 >&2
|
||||
echo "done."
|
||||
|
||||
echo -n "Creating LVM VG 'vgx'... "
|
||||
yes | vgcreate -f vgx ${target_disk}4 >&2
|
||||
yes | vgcreate vgx ${target_disk}4 >&2
|
||||
echo "done."
|
||||
|
||||
echo -n "Creating root logical volume (${size_root_lv}GB)... "
|
||||
|
Loading…
x
Reference in New Issue
Block a user