diff --git a/usr/bin/archboot-quickinst.sh b/usr/bin/archboot-quickinst.sh index b3f0fc50f..a1f61262a 100755 --- a/usr/bin/archboot-quickinst.sh +++ b/usr/bin/archboot-quickinst.sh @@ -60,29 +60,35 @@ else PACMAN_CONF="" fi -prepare_pacman || (echo "Pacman preparation FAILED!"; return 1) +if ! prepare_pacman; then + echo "Pacman preparation FAILED!" + return 1 +fi chroot_mount -install_packages || (echo "Package installation FAILED."; chroot_umount; exit 1) +if ! install_packages; then + echo "Package installation FAILED." + chroot_umount + exit 1 +fi locale_gen chroot_umount echo -echo "Package installation complete." +echo -e "\033[1mPackage installation complete.\033[0m" echo -echo "Please install a bootloader. Edit the appropriate config file for" -echo "your loader. Please use ${VMLINUZ} as kernel image." -echo "Chroot into your system to install it into the boot sector:" -echo " # mount -o bind /dev ${DESTDIR}/dev" -echo " # mount -t proc none ${DESTDIR}/proc" -echo " # mount -t sysfs none ${DESTDIR}/sys" -echo " # chroot ${DESTDIR} /bin/bash" +echo -e "Please install a \033[1mbootloader\033[0m. Edit the appropriate config file for" +echo -e "your loader. Please use \033[1m${VMLINUZ}\033[0m as kernel image." +echo -e "Chroot into your system to install it:" +echo -e " \033[1m# mount -o bind /dev ${DESTDIR}/dev\033[0m" +echo -e " \033[1m# mount -t proc none ${DESTDIR}/proc\033[0m" +echo -e " \033[1m# mount -t sysfs none ${DESTDIR}/sys\033[0m" +echo -e " \033[1m# chroot ${DESTDIR} /bin/bash\033[0m" echo echo "Next step, initramfs setup:" -echo "Edit your /etc/mkinitcpio.conf to fit your needs. After that run:" -echo "# mkinitcpio -p ${KERNELPKG}" -echo -echo "Then exit your chroot shell, edit ${DESTDIR}/etc/fstab and reboot!" +echo -e "Edit your \033[1m/etc/mkinitcpio.conf\033[0m to fit your needs. After that run:" +echo -e " \033[1m# mkinitcpio -p ${KERNELPKG}\033[0m" echo +echo -e "Then \033[1mexit\033[0m your chroot shell, edit \033[1m${DESTDIR}/etc/fstab\033[0m and \033[1mreboot\033[0m\!" exit 0 # vim: set ts=4 sw=4 et: diff --git a/usr/bin/archboot-restore-usbstick.sh b/usr/bin/archboot-restore-usbstick.sh index d0ef2a6fe..c2432aa4e 100755 --- a/usr/bin/archboot-restore-usbstick.sh +++ b/usr/bin/archboot-restore-usbstick.sh @@ -7,8 +7,12 @@ APPNAME=$(basename "${0}") usage() { - echo "Restoring an USB device to its original state (FAT32):" - echo "usage: ${APPNAME} " + echo -e "\033[1mWelcome to \033[34marchboot's\033[0m \033[1mRESTORE USB STICK:\033[0m" + echo -e "\033[1m----------------------------------------\033[0m" + echo -e "This script restores an USB device to a \033[1mFAT32\033[0m device." + echo -e "\033[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE\!\033[0m" + echo "" + echo -e "usage: \033[1m${APPNAME} \033[0m" exit "$1" } @@ -18,16 +22,19 @@ usage() ### check for root if ! [[ ${UID} -eq 0 ]]; then - echo "ERROR: Please run as root user!" - exit 1 + echo "ERROR: Please run as root user!" + exit 1 fi - +echo -e "\033[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on ${1} now\!\033[0m" +sleep 10 # clean partitiontable -dd if=/dev/zero of= bs=512 count=2048 -wipefs -a "$1" - +echo -e "\033[1mRestoring USB STICK...\033[0m" +echo -e "\033[1mSTEP 1/3:\033[0m Cleaning partition table..." +dd if=/dev/zero of="${1}" bs=512 count=2048 +wipefs -a "${1}" # create new MBR and partition on -fdisk "$1" < -mkfs.vfat -F32 "$1"1 +echo -e "\033[1mSTEP 3/3:\033[0m Create FAT32 filesystem..." +mkfs.vfat -F32 "${1}"1 +echo -e "\033[1mFinished.\033[0m"