add new on the fly update options :)

This commit is contained in:
Tobias Powalowski 2021-09-22 09:02:56 +02:00
parent 03b44bb544
commit 507c33735c
4 changed files with 65 additions and 11 deletions

View file

@ -1,11 +1,61 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
# Download latest setup and quickinst script from git repository _BASENAME="$(basename "${0}")"
D_SCRIPTS=""
L_COMPLETE=""
G_RELEASE=""
PRESET="/etc/archboot/presets/x86_64"
echo 'Downloading latest km, tz, quickinst and setup script...' usage () {
INSTALLER_SOURCE="https://gitlab.archlinux.org/tpowa/archboot/-/raw/master/usr/bin" echo "${_BASENAME}: usage"
[[ -e /usr/bin/quickinst ]] && wget -q "$INSTALLER_SOURCE/archboot-quickinst.sh?inline=false" -O /usr/bin/quickinst echo "Update installer or complete environment or create new image files:"
[[ -e /usr/bin/setup ]] && wget -q "$INSTALLER_SOURCE/archboot-setup.sh?inline=false" -O /usr/bin/setup echo "-------------------------------------------------------------------"
[[ -e /usr/bin/km ]] && wget -q "$INSTALLER_SOURCE/archboot-km.sh?inline=false" -O /usr/bin/km echo ""
[[ -e /usr/bin/tz ]] && wget -q "$INSTALLER_SOURCE/archboot-tz.sh?inline=false" -O /usr/bin/tz echo "PARAMETERS:"
echo " -u Update scripts: setup, quickinst, tz and km."
echo " -c Update and launch complete updated archboot environment (using kexec)."
echo " This operation needs at least 3072 MB RAM."
echo " -i Generate new release image files in /archboot-release directory"
echo " This operation needs at least 4096 MB RAM."
echo " -h This message."
exit 0
}
[[ -z "${1}" ]] && usage
while [ $# -gt 0 ]; do
case ${1} in
-u|--u) D_SCRIPTS="1" ;;
-c|--c) L_COMPLETE="1" ;;
-i|--i) G_RELEASE="1" ;;
-h|--h|?) usage ;;
*) usage ;;
esac
shift
done
# Download latest setup and quickinst script from git repository
if [[ "${D_SCRIPTS}" == "1" ]]; then
echo 'Downloading latest km, tz, quickinst and setup script...'
INSTALLER_SOURCE="https://gitlab.archlinux.org/tpowa/archboot/-/raw/master/usr/bin"
[[ -e /usr/bin/quickinst ]] && wget -q "$INSTALLER_SOURCE/archboot-quickinst.sh?inline=false" -O /usr/bin/quickinst
[[ -e /usr/bin/setup ]] && wget -q "$INSTALLER_SOURCE/archboot-setup.sh?inline=false" -O /usr/bin/setup
[[ -e /usr/bin/km ]] && wget -q "$INSTALLER_SOURCE/archboot-km.sh?inline=false" -O /usr/bin/km
[[ -e /usr/bin/tz ]] && wget -q "$INSTALLER_SOURCE/archboot-tz.sh?inline=false" -O /usr/bin/tz
fi
# Generate new environment and launch it with kexec
if [[ "${L_COMPLETE}" == "1" ]]; then
# create container
archboot-create-container.sh archboot
# generate tarball in container
systemd-nspawn -D archboot mkinitcpio -c ${PRESET} -k ${ALL_kver} -g /initrd.img
kexec -l archboot/boot/vmlinuz-linux --initrd=archboot/boot/intel-ucode.img --initrd=archboot/boot/amd-ucode.img --initrd=archboot/initd.img --append="group_disable=memory rootdelay=10 rootfstype=ramfs"
systemctl kexec
fi
# Generate new images
if [[ "${G_RELEASE}" == "1" ]]; then
archboot-x86_64-release.sh archboot
fi

View file

@ -46,9 +46,9 @@ echo "Creation Tool: 'archboot' Tobias Powalowski <tpowa@archlinux.org>" >>Relea
echo "Homepage: https://wiki.archlinux.org/title/Archboot" >>Release.txt echo "Homepage: https://wiki.archlinux.org/title/Archboot" >>Release.txt
echo "Architecture: x86_64" >>Release.txt echo "Architecture: x86_64" >>Release.txt
echo "RAM requirement to boot: 1024 MB or greater" >>Release.txt echo "RAM requirement to boot: 1024 MB or greater" >>Release.txt
echo "Kernel:$(pacman -Qi linux | grep Version | cut -d ":" -f2)" >>Release.txt echo "Kernel:$(systemd-nspawn -D archboot-release pacman -Qi linux | grep Version | cut -d ":" -f2)" >>Release.txt
echo "Pacman:$(pacman -Qi pacman | grep Version | cut -d ":" -f2)" >>Release.txt echo "Pacman:$(systemd-nspawn -D archboot-release pacman -Qi pacman | grep Version | cut -d ":" -f2)" >>Release.txt
echo "Systemd:$(pacman -Qi systemd | grep Version | cut -d ":" -f2)" >>Release.txt echo "Systemd:$(systemd-nspawn -D archboot-release pacman -Qi systemd | grep Version | cut -d ":" -f2)" >>Release.txt
echo "Have fun" >>Release.txt echo "Have fun" >>Release.txt
echo "Tobias Powalowski" >>Release.txt echo "Tobias Powalowski" >>Release.txt
echo "tpowa@archlinux.org" >>Release.txt echo "tpowa@archlinux.org" >>Release.txt

View file

@ -10,6 +10,10 @@ build ()
add_file "/usr/bin/arch-chroot" add_file "/usr/bin/arch-chroot"
add_file "/usr/bin/pacstrap" add_file "/usr/bin/pacstrap"
add_file "/usr/bin/archboot-update-installer.sh" "/usr/bin/update-installer.sh" add_file "/usr/bin/archboot-update-installer.sh" "/usr/bin/update-installer.sh"
add_file "/usr/bin/archboot-create-container.sh"
add_file "/usr/bin/archboot-x86_64-release.sh"
add_file "/usr/bin/archboot-mktorrent.sh"
add_binary "isoinfo mktorrent sha256sum"
} }
help () help ()

View file

@ -23,7 +23,7 @@ if [ "$(echo "${HOOKS[@]}" | grep archboot_installer)" ]; then
echo " - On first login setup is launched automatically." >> ${MOTD} echo " - On first login setup is launched automatically." >> ${MOTD}
echo " - Please run 'setup' again to install Arch Linux if you left setup." >> ${MOTD} echo " - Please run 'setup' again to install Arch Linux if you left setup." >> ${MOTD}
echo " - vc7 is used for setup logging." >> ${MOTD} echo " - vc7 is used for setup logging." >> ${MOTD}
echo " - Run update-installer.sh to get latest setup, quickinst, tz and km script." >> ${MOTD} echo " - Run update-installer.sh to get update options of installer." >> ${MOTD}
echo "For Experts:" >> ${MOTD} echo "For Experts:" >> ${MOTD}
echo " - Use 'quickinst' to install and bypass the setup routine." >> ${MOTD} echo " - Use 'quickinst' to install and bypass the setup routine." >> ${MOTD}
fi fi