mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
Compare commits
10 commits
465bd8e38a
...
16015d5abc
Author | SHA1 | Date | |
---|---|---|---|
|
16015d5abc | ||
|
806b58b5fa | ||
|
8e9aba1dbf | ||
|
57c750e158 | ||
|
8a9b7a8c36 | ||
|
0bd8cd2035 | ||
|
7e6d4d7ce3 | ||
|
3bbb151378 | ||
|
2a76bdb828 | ||
|
aca85bcef8 |
8 changed files with 39 additions and 25 deletions
|
@ -2,7 +2,7 @@ On the road to 2024.08:
|
||||||
---
|
---
|
||||||
Environment:
|
Environment:
|
||||||
- updated and unified usage information in all scripts
|
- updated and unified usage information in all scripts
|
||||||
- added clean-blockdevice script
|
- added clean-blockdevice.sh script
|
||||||
---
|
---
|
||||||
Highlights 2024.07:
|
Highlights 2024.07:
|
||||||
- kernel 6.10.x
|
- kernel 6.10.x
|
||||||
|
|
|
@ -8,24 +8,27 @@ _usage()
|
||||||
echo -e "\e[1m\e[36mARCHBOOT\e[m \e[1m- Clean blockdevice\e[m"
|
echo -e "\e[1m\e[36mARCHBOOT\e[m \e[1m- Clean blockdevice\e[m"
|
||||||
echo -e "\e[1m----------------------------\e[m"
|
echo -e "\e[1m----------------------------\e[m"
|
||||||
echo -e "This script removes all filesystem signatures"
|
echo -e "This script removes all filesystem signatures"
|
||||||
echo -e "and partitiontable from the device."
|
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 ""
|
||||||
echo -e "Usage: \e[1m${_BASENAME} <device>\e[m"
|
echo -e "Usage: \e[1m${_BASENAME} <device(s)>\e[m"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
##################################################
|
##################################################
|
||||||
[[ -z "${1}" ]] && _usage "$@"
|
[[ -z "${1}" ]] && _usage
|
||||||
### check for root
|
### check for root
|
||||||
if ! [[ ${UID} -eq 0 ]]; then
|
if ! [[ ${UID} -eq 0 ]]; then
|
||||||
echo "ERROR: Please run as root user!"
|
echo "ERROR: Please run as root user!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo -e "\e[1mCleaning blockdevice ${1}...\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 ${1} now! \e[m"
|
echo -e "\e[91mWARNING: 10 seconds for hitting CTRL+C to stop the process on $* now! \e[m"
|
||||||
sleep 10
|
sleep 10
|
||||||
echo -e "\e[1mSTEP 1/2:\e[m Cleaning filesystem signatures..."
|
#shellcheck disable=SC2068
|
||||||
wipefs -f -a "${1}"
|
for i in $@; do
|
||||||
echo -e "\e[1mSTEP 2/2:\e[m Cleaning partition table..."
|
echo -e "\e[1mSTEP 1/2:\e[m Cleaning ${i} filesystem signatures..."
|
||||||
dd if=/dev/zero of="${1}" bs=1M count=10
|
wipefs -f -a "${i}"
|
||||||
echo -e "\e[1mFinished.\e[m"
|
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
|
||||||
|
|
|
@ -8,9 +8,10 @@ _usage () {
|
||||||
echo -e "\e[1m---------------------------\e[m"
|
echo -e "\e[1m---------------------------\e[m"
|
||||||
echo "This will create an archboot container for an archboot image."
|
echo "This will create an archboot container for an archboot image."
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
echo " -cc Cleanup container eg. removing manpages, includes..."
|
echo " -cc Cleanup container eg. removing manpages, includes..."
|
||||||
echo " -cp Cleanup container package cache"
|
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 ""
|
||||||
echo -e "Usage: \e[1m${_BASENAME} <directory> <options>\e[m"
|
echo -e "Usage: \e[1m${_BASENAME} <directory> <options>\e[m"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -15,7 +15,7 @@ _run ()
|
||||||
_file_rename /usr/bin/archboot-copy-mountpoint.sh /usr/bin/copy-mountpoint.sh
|
_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-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-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
|
_file_rename /usr/bin/archboot-testsuite.sh /usr/bin/testsuite
|
||||||
_full_dir /usr/lib/archboot/installer
|
_full_dir /usr/lib/archboot/installer
|
||||||
_file /etc/archboot/defaults
|
_file /etc/archboot/defaults
|
||||||
|
|
|
@ -11,13 +11,13 @@ _usage () {
|
||||||
echo -e "\e[1m--------------------------------------\e[m"
|
echo -e "\e[1m--------------------------------------\e[m"
|
||||||
echo "This will create an archboot iso image."
|
echo "This will create an archboot iso image."
|
||||||
echo ""
|
echo ""
|
||||||
echo " -h This message."
|
echo "Options:"
|
||||||
echo " -g Starting generation of image."
|
echo " -g Starting generation of image."
|
||||||
echo " -c=CONFIG Which CONFIG should be used."
|
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 " default=${_ARCH}.conf"
|
||||||
echo " -i=IMAGENAME Your IMAGENAME."
|
echo " -i=IMAGENAME Your IMAGENAME."
|
||||||
echo " -s Save initramfs to $(pwd)"
|
echo " -s Save initramfs files in current work directory"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "Usage: \e[1m${_BASENAME} <options>\e[m"
|
echo -e "Usage: \e[1m${_BASENAME} <options>\e[m"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -30,7 +30,6 @@ _parameters() {
|
||||||
-s|--s) _SAVE_INIT="1" ;;
|
-s|--s) _SAVE_INIT="1" ;;
|
||||||
-c=*|--c=*) _CONFIG="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
|
-c=*|--c=*) _CONFIG="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
|
||||||
-i=*|--i=*) _IMAGENAME="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
|
-i=*|--i=*) _IMAGENAME="$(echo "${1}" | rg -o '=(.*)' -r '$1')" ;;
|
||||||
-h|--h|?) _usage ;;
|
|
||||||
*) _usage ;;
|
*) _usage ;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -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[36mArchboot\e[m\e[1m - Create Release Images\e[m"
|
||||||
echo -e "\e[1m--------------------------------\e[m"
|
echo -e "\e[1m--------------------------------\e[m"
|
||||||
echo "This will create an archboot release image in <directory>."
|
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 ""
|
||||||
echo -e "Usage: \e[1m${_BASENAME} <directory> <server>\e[m"
|
echo -e "Usage: \e[1m${_BASENAME} <directory> <server>\e[m"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -151,11 +151,11 @@ _download_latest_task() {
|
||||||
${_DLPROG} -o "${_ETC}/defaults" "${_SOURCE}${_ETC}/defaults?inline=false"
|
${_DLPROG} -o "${_ETC}/defaults" "${_SOURCE}${_ETC}/defaults?inline=false"
|
||||||
# helper binaries
|
# helper binaries
|
||||||
# main 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
|
for i in ${_SCRIPTS}; do
|
||||||
[[ -e "${_BIN}/${i}" ]] && ${_DLPROG} -o "${_BIN}/${i}" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
|
[[ -e "${_BIN}/${i}" ]] && ${_DLPROG} -o "${_BIN}/${i}" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
|
||||||
done
|
done
|
||||||
_SCRIPTS="copy-mountpoint rsync-backup restore-usbstick"
|
_SCRIPTS="clean-blockdevice copy-mountpoint rsync-backup restore-usbstick"
|
||||||
for i in ${_SCRIPTS}; do
|
for i in ${_SCRIPTS}; do
|
||||||
[[ -e "${_BIN}/${i}.sh" ]] && ${_DLPROG} -o "${_BIN}/${i}.sh" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
|
[[ -e "${_BIN}/${i}.sh" ]] && ${_DLPROG} -o "${_BIN}/${i}.sh" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
|
||||||
done
|
done
|
||||||
|
|
11
usr/share/bash-completion/completions/clean-blockdevice.sh
Normal file
11
usr/share/bash-completion/completions/clean-blockdevice.sh
Normal 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
|
Loading…
Reference in a new issue