Compare commits

...

10 commits

Author SHA1 Message Date
Tobias Powalowski
16015d5abc update CHANGELOG 2024-08-13 16:12:52 +02:00
Tobias Powalowski
806b58b5fa update wording 2024-08-13 16:09:49 +02:00
Tobias Powalowski
8e9aba1dbf better wording 2024-08-13 15:56:50 +02:00
Tobias Powalowski
57c750e158 better wording 2024-08-13 15:55:30 +02:00
Tobias Powalowski
8a9b7a8c36 switch clean-blockdevice to clean-bockdevice.sh 2024-08-13 15:46:10 +02:00
Tobias Powalowski
0bd8cd2035 change wording 2024-08-13 15:31:38 +02:00
Tobias Powalowski
7e6d4d7ce3 change wording 2024-08-13 15:29:30 +02:00
Tobias Powalowski
3bbb151378 change order 2024-08-13 15:26:58 +02:00
Tobias Powalowski
2a76bdb828 allow multiple devices 2024-08-13 15:20:00 +02:00
Tobias Powalowski
aca85bcef8 add bash completion for clean-blockdevice 2024-08-13 10:45:31 +02:00
8 changed files with 39 additions and 25 deletions

View file

@ -2,7 +2,7 @@ On the road to 2024.08:
---
Environment:
- updated and unified usage information in all scripts
- added clean-blockdevice script
- added clean-blockdevice.sh script
---
Highlights 2024.07:
- kernel 6.10.x

View file

@ -9,23 +9,26 @@ _usage()
echo -e "\e[1m----------------------------\e[m"
echo -e "This script removes all filesystem signatures"
echo -e "and partition table from the device."
echo -e "\e[1m\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[m"
echo -e "\e[1m\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE(S)! \e[m"
echo ""
echo -e "Usage: \e[1m${_BASENAME} <device>\e[m"
echo -e "Usage: \e[1m${_BASENAME} <device(s)>\e[m"
exit 0
}
##################################################
[[ -z "${1}" ]] && _usage "$@"
[[ -z "${1}" ]] && _usage
### check for root
if ! [[ ${UID} -eq 0 ]]; then
echo "ERROR: Please run as root user!"
exit 1
fi
echo -e "\e[1mCleaning blockdevice ${1}...\e[m"
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on ${1} now! \e[m"
echo -e "\e[1mCleaning blockdevice(s) $*...\e[m"
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on $* now! \e[m"
sleep 10
echo -e "\e[1mSTEP 1/2:\e[m Cleaning filesystem signatures..."
wipefs -f -a "${1}"
echo -e "\e[1mSTEP 2/2:\e[m Cleaning partition table..."
dd if=/dev/zero of="${1}" bs=1M count=10
echo -e "\e[1mFinished.\e[m"
#shellcheck disable=SC2068
for i in $@; do
echo -e "\e[1mSTEP 1/2:\e[m Cleaning ${i} filesystem signatures..."
wipefs -f -a "${i}"
echo -e "\e[1mSTEP 2/2:\e[m Cleaning ${i} partition table..."
dd if=/dev/zero of="${i}" bs=1M count=10
echo -e "\e[1mFinished ${i}.\e[m"
done

View file

@ -8,9 +8,10 @@ _usage () {
echo -e "\e[1m---------------------------\e[m"
echo "This will create an archboot container for an archboot image."
echo ""
echo "Options:"
echo " -cc Cleanup container eg. removing manpages, includes..."
echo " -cp Cleanup container package cache"
echo " -install-source=<server> add package server with archboot repository"
echo " -install-source=<server> Use <server> containing archboot repository"
echo ""
echo -e "Usage: \e[1m${_BASENAME} <directory> <options>\e[m"
exit 0

View file

@ -15,7 +15,7 @@ _run ()
_file_rename /usr/bin/archboot-copy-mountpoint.sh /usr/bin/copy-mountpoint.sh
_file_rename /usr/bin/archboot-rsync-backup.sh /usr/bin/rsync-backup.sh
_file_rename /usr/bin/archboot-restore-usbstick.sh /usr/bin/restore-usbstick.sh
_file_rename /usr/bin/archboot-clean-blockdevice.sh /usr/bin/clean-blockdevice
_file_rename /usr/bin/archboot-clean-blockdevice.sh /usr/bin/clean-blockdevice.sh
_file_rename /usr/bin/archboot-testsuite.sh /usr/bin/testsuite
_full_dir /usr/lib/archboot/installer
_file /etc/archboot/defaults

View file

@ -11,13 +11,13 @@ _usage () {
echo -e "\e[1m--------------------------------------\e[m"
echo "This will create an archboot iso image."
echo ""
echo " -h This message."
echo "Options:"
echo " -g Starting generation of image."
echo " -c=CONFIG Which CONFIG should be used."
echo " ${_CONFIG_DIR} locates the configs"
echo " ${_CONFIG_DIR} includes the config files"
echo " default=${_ARCH}.conf"
echo " -i=IMAGENAME Your IMAGENAME."
echo " -s Save initramfs to $(pwd)"
echo " -s Save initramfs files in current work directory"
echo ""
echo -e "Usage: \e[1m${_BASENAME} <options>\e[m"
exit 0
@ -30,7 +30,6 @@ _parameters() {
-s|--s) _SAVE_INIT="1" ;;
-c=*|--c=*) _CONFIG="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
-i=*|--i=*) _IMAGENAME="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
-h|--h|?) _usage ;;
*) _usage ;;
esac
shift

View file

@ -20,7 +20,7 @@ _usage () {
echo -e "\e[1m\e[36mArchboot\e[m\e[1m - Create Release Images\e[m"
echo -e "\e[1m--------------------------------\e[m"
echo "This will create an archboot release image in <directory>."
echo "You can specify a certain <server> with an archboot repository."
echo "Optional: You can specify a certain <server> with an archboot repository."
echo ""
echo -e "Usage: \e[1m${_BASENAME} <directory> <server>\e[m"
exit 0

View file

@ -151,11 +151,11 @@ _download_latest_task() {
${_DLPROG} -o "${_ETC}/defaults" "${_SOURCE}${_ETC}/defaults?inline=false"
# helper binaries
# main binaries
_SCRIPTS="quickinst setup clock clean-blockdevice launcher localize network pacsetup update testsuite"
_SCRIPTS="quickinst setup clock launcher localize network pacsetup update testsuite"
for i in ${_SCRIPTS}; do
[[ -e "${_BIN}/${i}" ]] && ${_DLPROG} -o "${_BIN}/${i}" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
done
_SCRIPTS="copy-mountpoint rsync-backup restore-usbstick"
_SCRIPTS="clean-blockdevice copy-mountpoint rsync-backup restore-usbstick"
for i in ${_SCRIPTS}; do
[[ -e "${_BIN}/${i}.sh" ]] && ${_DLPROG} -o "${_BIN}/${i}.sh" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
done

View file

@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_clean_blockdevice()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
compopt -o bashdefault -o default
COMPREPLY=( $(compgen -W "$(lsblk -pnro NAME,TYPE | rg '(.*) disk$' -r '$1')" -- $cur) )
return 0
}
complete -F _clean_blockdevice clean-blockdevice.sh