reduce sleep times in init.sh

This commit is contained in:
Tobias Powalowski 2023-11-13 22:10:47 +01:00
parent 7aa966373e
commit d0ea3cae22
9 changed files with 13 additions and 1190 deletions

View file

@ -36,8 +36,6 @@ _progress_wait() {
_task() {
if [[ "${1}" == kernel ]]; then
bsdcpio -u -i "*/lib/modules/" "*/lib/firmware/" <"/mnt/efi/boot/initrd-${_ARCH}.img" &>/dev/null
# wait 1 second until proceeding with module loading, needed at least for kms activation
sleep 1
fi
if [[ "${1}" == cleanup ]]; then
rm -rf /lib/modules/*/kernel/drivers/{acpi,ata,gpu,bcma,block,bluetooth,hid,\
@ -95,7 +93,6 @@ _second_stage() {
_task unmount &
_progress_wait "98" "99" "${_KEEP} Unmounting archboot rootfs..." "1"
_progress "100" "The boot medium can be safely removed now."
sleep 2
# remove files and directories
rm -r /sysroot/sysroot
rm /sysroot/init
@ -137,8 +134,7 @@ if ! [[ -f "/mnt/efi/boot/initrd-${_ARCH}.img" ]] ; then
fi
fi
_first_stage | _dialog --title " Loading Kernel Modules " --gauge "${_KEEP} Loading files..." 6 75 0
# avoid screen messup, don't run dialog on module loading!
printf "\ec"
sleep 0.75
udevadm trigger --type=all --action=add --prioritized-subsystem=module,block,tpmrm,net,tty,input
udevadm settle
# autodetect screen size
@ -158,5 +154,7 @@ echo FONT=ter-v${SIZE}n >> /sysroot/etc/vconsole.conf
systemd-sysusers --root=/sysroot &>/dev/null
systemd-tmpfiles -E --create --root=/sysroot &>/dev/null
printf "\ec"
echo "The boot medium can be safely removed now."
echo ""
echo "Launching systemd $(udevadm --version)..."
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,167 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_cleanup_install() {
rm -rf /usr/share/{man,help,gir-[0-9]*,info,doc,gtk-doc,ibus,perl[0-9]*}
rm -rf /usr/include
rm -rf /usr/lib/libgo.*
}
_cleanup_cache() {
# remove packages from cache
#shellcheck disable=SC2013
for i in $(grep 'installed' /var/log/pacman.log | cut -d ' ' -f 4); do
rm -rf "${_CACHEDIR}/${i}"-[0-9]*
done
}
_update_packages() {
_IGNORE=""
if [[ -n "${_GRAPHIC_IGNORE}" ]]; then
for i in ${_GRAPHIC_IGNORE}; do
_IGNORE="${_IGNORE} --ignore ${i}"
done
fi
#shellcheck disable=SC2086
pacman -Syu ${_IGNORE} --noconfirm &>"${_LOG}"
[[ ! -e "/.full_system" ]] && _cleanup_install
rm /.archboot
}
_install_graphic() {
# check for qxl module
if grep -q qxl /proc/modules; then
_GRAPHIC="${_GRAPHIC} xf86-video-qxl"
fi
for i in ${_GRAPHIC}; do
#shellcheck disable=SC2086
pacman -S ${i} --noconfirm &>"${_LOG}"
[[ ! -e "/.full_system" ]] && _cleanup_install
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 4413000 ]] && _cleanup_cache
rm -f /var/log/pacman.log
done
# install firefox langpacks
if [[ "${_STANDARD_BROWSER}" == "firefox" ]]; then
_LANG="be bg cs da de el fi fr hu it lt lv mk nl nn pl ro ru sk sr tr uk"
for i in ${_LANG}; do
if grep -q "${i}" /etc/locale.conf; then
pacman -S firefox-i18n-"${i}" --noconfirm &>"${_LOG}"
fi
done
if grep -q en_US /etc/locale.conf; then
pacman -S firefox-i18n-en-us --noconfirm &>"${_LOG}"
elif grep -q 'C.UTF-8' /etc/locale.conf; then
pacman -S firefox-i18n-en-us --noconfirm &>"${_LOG}"
elif grep -q es_ES /etc/locale.conf; then
pacman -S firefox-i18n-es-es --noconfirm &>"${_LOG}"
elif grep -q pt_PT /etc/locale.conf; then
pacman -S firefox-i18n-pt-pt --noconfirm &>"${_LOG}"
elif grep -q sv_SE /etc/locale.conf; then
pacman -S firefox-i18n-sv-se --noconfirm &>"${_LOG}"
fi
fi
rm /.archboot
}
_prepare_graphic() {
_GRAPHIC="${1}"
if [[ ! -e "/.full_system" ]]; then
_progress "1" "Removing firmware files..."
rm -rf /usr/lib/firmware
# fix libs first, then install packages from defaults
_GRAPHIC="${1}"
fi
: > /.archboot
_update_packages &
_progress_wait "2" "10" "Updating environment to latest packages..." "5"
_COUNT=11
for i in ${_FIX_PACKAGES}; do
_progress "${_COUNT}" "Installing basic packages: ${i}..."
#shellcheck disable=SC2086
pacman -S ${i} --noconfirm &>"${_LOG}"
[[ ! -e "/.full_system" ]] && _cleanup_install
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -lt 4413000 ]] && _cleanup_cache
rm -f /var/log/pacman.log
_COUNT="$((_COUNT+1))"
done
: > /.archboot
_install_graphic &
_progress_wait "${_COUNT}" "97" "Installing ${_ENVIRONMENT}..." "2"
if [[ ! -e "/.full_system" ]]; then
echo "Removing not used icons..." >"${_LOG}"
rm -rf /usr/share/icons/breeze-dark
echo "Cleanup locale and i18n..." >"${_LOG}"
find /usr/share/locale/ -mindepth 2 ! -path '*/be/*' ! -path '*/bg/*' ! -path '*/cs/*' \
! -path '*/da/*' ! -path '*/de/*' ! -path '*/en/*' ! -path '*/el/*' ! -path '*/es/*' \
! -path '*/fi/*' ! -path '*/fr/*' ! -path '*/hu/*' ! -path '*/it/*' ! -path '*/lt/*' \
! -path '*/lv/*' ! -path '*/mk/*' ! -path '*/nl/*' ! -path '*/nn/*' ! -path '*/pl/*' \
! -path '*/pt/*' ! -path '*/ro/*' ! -path '*/ru/*' ! -path '*/sk/*' ! -path '*/sr/*' \
! -path '*/sv/*' ! -path '*/tr/*' ! -path '*/uk/*' -delete &>"${_NO_LOG}"
find /usr/share/i18n/charmaps ! -name 'UTF-8.gz' -delete &>"${_NO_LOG}"
fi
_progress "98" "Restart dbus..."
systemd-sysusers >"${_LOG}" 2>&1
systemd-tmpfiles --create >"${_LOG}" 2>&1
# fixing dbus requirements
systemctl reload dbus
systemctl reload dbus-org.freedesktop.login1.service
}
_custom_wayland_xorg() {
if [[ -n "${_CUSTOM_WAYLAND}" ]]; then
echo -e "\e[1mStep 1/2:\e[m Installing custom wayland..."
echo " This will need some time..."
_prepare_graphic "${_WAYLAND_PACKAGE} ${_CUSTOM_WAYLAND}" > "${_LOG}" 2>&1
fi
if [[ -n "${_CUSTOM_X}" ]]; then
echo -e "\e[1mStep 1/2:\e[m Installing custom xorg..."
echo " This will need some time..."
_prepare_graphic "${_XORG_PACKAGE} ${_CUSTOM_XORG}" > "${_LOG}" 2>&1
fi
echo -e "\e[1mStep 2/2:\e[m Setting up browser...\e[m"
which firefox &>"${_NO_LOG}" && _firefox_flags
which chromium &>"${_NO_LOG}" && _chromium_flags
}
_chromium_flags() {
echo "Adding chromium flags to /etc/chromium-flags.conf..." >"${_LOG}"
cat << EOF >/etc/chromium-flags.conf
--no-sandbox
--test-type
--incognito
archboot.com
wiki.archlinux.org
wiki.archlinux.org/title/Installation_guide
EOF
}
_firefox_flags() {
if [[ -f "/usr/lib/firefox/browser/defaults/preferences/vendor.js" ]]; then
if ! grep -q startup /usr/lib/firefox/browser/defaults/preferences/vendor.js; then
echo "Adding firefox flags vendor.js..." >"${_LOG}"
cat << EOF >> /usr/lib/firefox/browser/defaults/preferences/vendor.js
pref("browser.aboutwelcome.enabled", false, locked);
pref("browser.startup.homepage_override.once", false, locked);
pref("datareporting.policy.firstRunURL", "https://wiki.archlinux.org/title/Installation_guide", locked);
pref("browser.startup.homepage", "https://archboot.com|https://wiki.archlinux.org|https://wiki.archlinux.org/title/Installation_guide", locked);
pref("browser.startup.firstrunSkipsHomepage"; true, locked);
pref("startup.homepage_welcome_url", "https://archboot.com|https://wiki.archlinux.org", locked );
EOF
fi
fi
}
_autostart_vnc() {
echo "Setting VNC password /etc/tigervnc/passwd to ${_VNC_PW}..." >"${_LOG}"
echo "${_VNC_PW}" | vncpasswd -f > /etc/tigervnc/passwd
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/archboot.desktop
echo "Autostarting tigervnc..." >"${_LOG}"
cat << EOF > /etc/xdg/autostart/tigervnc.desktop
[Desktop Entry]
Type=Application
Name=Tigervnc
Exec=x0vncserver -rfbauth /etc/tigervnc/passwd
EOF
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,63 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_configure_gnome() {
echo "Configuring Gnome..."
[[ "${_STANDARD_BROWSER}" == "firefox" ]] && gsettings set org.gnome.shell favorite-apps "['org.gnome.Settings.desktop', 'org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop', 'firefox.desktop', 'org.gnome.DiskUtility.desktop', 'gparted.desktop', 'archboot.desktop']"
[[ "${_STANDARD_BROWSER}" == "chromium" ]] && gsettings set org.gnome.shell favorite-apps "['org.gnome.Settings.desktop', 'org.gnome.Terminal.desktop', 'org.gnome.Nautilus.desktop', 'chromium.desktop', 'org.gnome.DiskUtility.desktop', 'gparted.desktop', 'archboot.desktop']"
echo "Setting wallpaper..."
gsettings set org.gnome.desktop.background picture-uri file:////usr/share/archboot/grub/archboot-background.png
echo "Autostarting setup..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
GenericName=Installer
Exec=gnome-terminal -- /usr/bin/setup
Icon=system-software-install
EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/
_HIDE_MENU="avahi-discover bssh bvnc org.gnome.Extensions org.gnome.FileRoller org.gnome.gThumb org.gnome.gedit fluid vncviewer lstopo qvidcap qv4l2"
echo "Hiding ${_HIDE_MENU} menu entries..."
for i in ${_HIDE_MENU}; do
echo "[DESKTOP ENTRY]" > /usr/share/applications/"${i}".desktop
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
}
_prepare_gnome() {
if ! [[ -e /usr/bin/gnome-session ]]; then
_prepare_graphic "${_PACKAGES}"
_configure_gnome >"${_LOG}" 2>&1
fi
}
_install_gnome_wayland() {
_PACKAGES="${_WAYLAND_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_GNOME_PACKAGES}"
_prepare_gnome
}
_install_gnome() {
_PACKAGES="${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_GNOME_PACKAGES}"
_prepare_gnome
}
_start_gnome_wayland() {
_progress "100" "Launching GNOME Wayland now, logging is done on ${_LOG}..."
sleep 2
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session >${_LOG} 2>&1" > /usr/bin/gnome-wayland
chmod 755 /usr/bin/gnome-wayland
gnome-wayland
}
_start_gnome() {
_progress "100" "Launching GNOME now, logging is done on ${_LOG}..."
sleep 2
echo "export XDG_SESSION_TYPE=x11" > /root/.xinitrc
#shellcheck disable=SC2129
echo "export GDK_BACKEND=x11" >> /root/.xinitrc
echo "exec dbus-launch gnome-session" >> /root/.xinitrc
startx >"${_LOG}" 2>&1
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,402 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_ram_check() {
while true; do
# continue when 1 GB RAM is free
[[ "$(grep -w MemAvailable /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt "1000000" ]] && break
done
}
_kill_w_dir() {
if [[ -d "${_W_DIR}" ]]; then
rm -r "${_W_DIR}"
fi
}
_create_container() {
# create container without package cache
if [[ -n "${_L_COMPLETE}" ]]; then
"archboot-${_RUNNING_ARCH}-create-container.sh" "${_W_DIR}" -cc -cp >"${_LOG}" 2>&1 || exit 1
fi
# create container with package cache
if [[ -e "${_LOCAL_DB}" ]]; then
# offline mode, for local image
# add the db too on reboot
install -D -m644 "${_LOCAL_DB}" "${_W_DIR}""${_LOCAL_DB}"
if [[ -n "${_L_INSTALL_COMPLETE}" ]]; then
"archboot-${_RUNNING_ARCH}-create-container.sh" "${_W_DIR}" -cc --install-source=file://"${_CACHEDIR}" >"${_LOG}" 2>&1 || exit 1
fi
# needed for checks
cp "${_W_DIR}""${_LOCAL_DB}" "${_LOCAL_DB}"
else
# online mode
if [[ -n "${_L_INSTALL_COMPLETE}" ]]; then
"archboot-${_RUNNING_ARCH}-create-container.sh" "${_W_DIR}" -cc >"${_LOG}" 2>&1 || exit 1
fi
fi
rm "${_W_DIR}"/.archboot
}
_network_check() {
_TITLE="Archboot ${_RUNNING_ARCH} | ${_RUNNING_KERNEL} | Basic Setup | Network Check"
# wait 20 seconds for network link
_COUNT=0
while true; do
sleep 1
if getent hosts www.google.com &>"${_LOG}"; then
break
fi
_COUNT=$((_COUNT+1))
# abort after 20 seconds
_progress "$((_COUNT*5))" "Waiting $((20-_COUNT)) seconds for network link to come up..."
[[ "${_COUNT}" == 20 ]] && break
done | _dialog --title " Network Configuration " --no-mouse --gauge "Waiting 20 seconds for network link to come up..." 6 75 0
if ! getent hosts www.google.com &>"${_NO_LOG}"; then
clear
echo -e "\e[91mAborting:\e[m"
echo -e "Network not yet ready."
echo -e "Please configure your network first."
exit 1
fi
}
_update_installer_check() {
if [[ -f /.update ]]; then
clear
echo -e "\e[91mAborting:\e[m"
echo "update is already running on other tty..."
echo "If you are absolutly sure it's not running, you need to remove /.update"
exit 1
fi
if ! [[ -e "${_LOCAL_DB}" ]]; then
_network_check
fi
}
_full_system_check() {
if [[ -e "/.full_system" ]]; then
clear
echo -e "\e[1mFull Arch Linux system already setup.\e[m"
exit 0
fi
}
_gpg_check() {
# pacman-key process itself
while pgrep -x pacman-key &>"${_NO_LOG}"; do
sleep 1
done
# gpg finished in background
while pgrep -x gpg &>"${_NO_LOG}"; do
sleep 1
done
if [[ -e /etc/systemd/system/pacman-init.service ]]; then
systemctl stop pacman-init.service
fi
rm /.archboot
}
_clean_kernel_cache () {
echo 3 > /proc/sys/vm/drop_caches
}
_clean_archboot() {
# remove everything not necessary
rm -rf /usr/lib/firmware
rm -rf /usr/lib/modules
rm -rf /usr/lib/libstdc++*
_SHARE_DIRS="bash-completion efitools fonts hwdata kbd licenses lshw nano nvim pacman systemd tc zoneinfo"
for i in ${_SHARE_DIRS}; do
#shellcheck disable=SC2115
rm -rf "/usr/share/${i}"
done
}
_collect_files() {
${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount tmp;archboot-cpio.sh -c ${_CONFIG} -d /tmp" >"${_LOG}" 2>&1
rm "${_W_DIR}"/.archboot
}
_create_initramfs() {
# https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt
# compress image with zstd
cd "${_ROOTFS_DIR}" || exit 1
find . -mindepth 1 -printf '%P\0' |
sort -z |
LANG=C bsdtar --null -cnf - -T - |
LANG=C bsdtar --null -cf - --format=newc @- |
zstd --rm -T0> "${_RAM}/${_INITRD}" &
sleep 2
while pgrep -x zstd &>"${_NO_LOG}"; do
_clean_kernel_cache
sleep 1
done
rm "${_W_DIR}"/.archboot
}
_download_latest_task() {
# config
${_DLPROG} -o "${_ETC}/defaults" "${_SOURCE}${_ETC}/defaults?inline=false"
# helper binaries
# main binaries
_SCRIPTS="quickinst setup clock launcher localize network pacsetup update copy-mountpoint rsync-backup restore-usbstick"
for i in ${_SCRIPTS}; do
[[ -e "${_BIN}/${i}" ]] && ${_DLPROG} -o "${_BIN}/${i}" "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false"
done
_SCRIPTS="binary-check.sh not-installed.sh secureboot-keys.sh mkkeys.sh hwsim.sh"
for i in ${_SCRIPTS}; do
[[ -e "${_BIN}/${i}" ]] && ${_DLPROG} -o "${_BIN}/${i}" "${_SOURCE}${_BIN}/archboot-${i}?inline=false"
[[ -e "${_BIN}/archboot-${i}" ]] && ${_DLPROG} -o "${_BIN}/archboot-${i}" "${_SOURCE}${_BIN}/archboot-${i}?inline=false"
done
_TXT="guid-partition.txt guid.txt luks.txt lvm2.txt mbr-partition.txt md.txt"
for i in ${_TXT}; do
[[ -e "${_HELP}/${i}" ]] && ${_DLPROG} -o "${_HELP}/${i}" "${_SOURCE}${_HELP}/${i}?inline=false"
done
# main libs
LIBS="common.sh container.sh release.sh iso.sh login.sh"
for i in ${LIBS}; do
${_DLPROG} -o "${_LIB}/${i}" "${_SOURCE}${_LIB}/${i}?inline=false"
done
# update libs
LIBS="update.sh manage.sh desktop.sh xfce.sh gnome.sh plasma.sh sway.sh"
for i in ${LIBS}; do
${_DLPROG} -o "${_UPDATE}/${i}" "${_SOURCE}${_UPDATE}/${i}?inline=false"
done
# run libs
LIBS="container.sh release.sh"
for i in ${LIBS}; do
${_DLPROG} -o "${_RUN}/${i}" "${_SOURCE}${_RUN}/${i}?inline=false"
done
# setup libs
LIBS="autoconfiguration.sh quicksetup.sh base.sh blockdevices.sh bootloader.sh \
bootloader_sb.sh bootloader_grub.sh bootloader_uki.sh bootloader_systemd_bootd.sh \
bootloader_limine.sh bootloader_pacman_hooks.sh bootloader_refind.sh \
bootloader_systemd_services.sh bootloader_uboot.sh btrfs.sh common.sh \
configuration.sh mountpoints.sh network.sh pacman.sh partition.sh storage.sh"
for i in ${LIBS}; do
${_DLPROG} -o "${_INST}/${i}" "${_SOURCE}${_INST}/${i}?inline=false"
done
rm /.archboot
}
_download_latest() {
# Download latest setup and quickinst script from git repository
[[ -d "${_INST}" ]] || mkdir "${_INST}"
: > /.archboot
_download_latest_task &
_progress_wait "0" "99" "Downloading latest GIT..." "0.2"
_progress "100" "Download completed successfully."
sleep 2
}
_new_environment() {
_kill_w_dir
: > /.archboot
_gpg_check &
_progress_wait "0" "99" "Waiting for pacman keyring..." "0.75"
_progress "100" "Pacman keyring initialized."
_progress "1" "Removing files from /..."
_clean_archboot
_clean_kernel_cache
[[ -d "${_W_DIR}" ]] || mkdir -p "${_W_DIR}"
: > "${_W_DIR}"/.archboot
_create_container &
_progress_wait "2" "40" "Generating container in ${_W_DIR}..." "5.5"
_clean_kernel_cache
_ram_check
_progress "41" "Copying kernel ${_VMLINUZ} to ${_RAM}/..."
# use ramfs to get immediate free space on file deletion
mkdir "${_RAM}"
mount -t ramfs none "${_RAM}"
#shellcheck disable=SC2116,2086
[[ "${_RUNNING_ARCH}" == "x86_64" || "${_RUNNING_ARCH}" == "riscv64" ]] && _VMLINUZ="$(echo ${_W_DIR}/usr/lib/modules/*/vmlinuz)"
[[ "${_RUNNING_ARCH}" == "aarch64" ]] && _VMLINUZ="${_W_DIR}/boot/Image"
cp "${_VMLINUZ}" "${_RAM}/"
_VMLINUZ="$(basename "${_VMLINUZ}")"
# write initramfs to "${_ROOTFS_DIR}
: > "${_W_DIR}"/.archboot
_collect_files &
_progress_wait "42" "84" "Collecting rootfs files in ${_W_DIR}..." "3.75"
_progress "85" "Cleanup ${_W_DIR}..."
find "${_W_DIR}"/. -mindepth 1 -maxdepth 1 ! -name 'tmp' -exec rm -rf {} \;
_clean_kernel_cache
_ram_check
# local switch, don't kexec on local image
if [[ -e "${_LOCAL_DB}" ]]; then
_progress "86" "Moving rootfs to ${_RAM}..."
mv "${_ROOTFS_DIR}"/* "${_RAM}/"
# cleanup mkinitcpio directories and files
_progress "95" "Cleanup ${_RAM}..."
rm -r "${_RAM}"/sysroot &>"${_NO_LOG}"
rm "${_RAM}"/{init,"${_VMLINUZ}"} &>"${_NO_LOG}"
_progress "100" "Switching to rootfs ${_RAM}..."
sleep 2
# https://www.freedesktop.org/software/systemd/man/bootup.html
# enable systemd initrd functionality
: > /etc/initrd-release
# fix /run/nouser issues
systemctl stop systemd-user-sessions.service
# avoid issues by taking down services in ordered way
systemctl stop dbus-org.freedesktop.login1.service
systemctl stop dbus.socket
# prepare for initrd-switch-root
systemctl start initrd-cleanup.service
systemctl start initrd-switch-root.target
fi
_progress "86" "Preserving Basic Setup values..."
if [[ -e '/.localize' ]]; then
cp /etc/{locale.gen,locale.conf} "${_ROOTFS_DIR}"/etc
cp /.localize "${_ROOTFS_DIR}"/
${_NSPAWN} "${_ROOTFS_DIR}" /bin/bash -c "locale-gen" &>"${_NO_LOG}"
cp /etc/vconsole.conf "${_ROOTFS_DIR}"/etc
: >"${_ROOTFS_DIR}"/.vconsole-run
fi
if [[ -e '/.clock' ]]; then
cp -a /etc/{adjtime,localtime} "${_ROOTFS_DIR}"/etc
${_NSPAWN} "${_ROOTFS_DIR}" /bin/bash -c "systemctl enable systemd-timesyncd.service" &>"${_NO_LOG}"
cp /.clock "${_ROOTFS_DIR}"/
fi
if [[ -e '/.network' ]]; then
cp -r /var/lib/iwd "${_ROOTFS_DIR}"/var/lib
${_NSPAWN} "${_ROOTFS_DIR}" /bin/bash -c "systemctl enable iwd" &>"${_NO_LOG}"
cp /etc/systemd/network/* "${_ROOTFS_DIR}"/etc/systemd/network/
${_NSPAWN} "${_ROOTFS_DIR}" /bin/bash -c "systemctl enable systemd-networkd" &>"${_NO_LOG}"
${_NSPAWN} "${_ROOTFS_DIR}" /bin/bash -c "systemctl enable systemd-resolved" &>"${_NO_LOG}"
rm "${_ROOTFS_DIR}"/etc/systemd/network/10-wired-auto-dhcp.network
[[ -e '/etc/profile.d/proxy.sh' ]] && cp /etc/profile.d/proxy.sh "${_ROOTFS_DIR}"/etc/profile.d/proxy.sh
cp /.network "${_ROOTFS_DIR}"/
cp /.network-interface "${_ROOTFS_DIR}"/
fi
if [[ -e '/.pacsetup' ]]; then
cp /etc/pacman.conf "${_ROOTFS_DIR}"/etc
cp /etc/pacman.d/mirrorlist "${_ROOTFS_DIR}"/etc/pacman.d/
cp -ar /etc/pacman.d/gnupg "${_ROOTFS_DIR}"/etc/pacman.d
cp /.pacsetup "${_ROOTFS_DIR}"/
fi
: > "${_W_DIR}"/.archboot
_create_initramfs &
_progress_wait "87" "94" "Creating initramfs ${_RAM}/${_INITRD}..." "1"
_progress "95" "Cleanup ${_W_DIR}..."
cd /
_kill_w_dir
_clean_kernel_cache
_progress "97" "Waiting for kernel to free RAM..."
# wait until enough memory is available!
while true; do
[[ "$(($(stat -c %s "${_RAM}/${_INITRD}")*200/100000))" -lt "$(grep -w MemAvailable /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" ]] && break
sleep 1
done
_MEM_MIN=""
# only needed on aarch64
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
_MEM_MIN="--mem-min=0xA0000000"
fi
_progress "100" "Restarting with KEXEC_LOAD..."
kexec -c -f ${_MEM_MIN} "${_RAM}/${_VMLINUZ}" --initrd="${_RAM}/${_INITRD}" --reuse-cmdline &
sleep 0.1
_clean_kernel_cache
rm "${_RAM}"/{"${_VMLINUZ}","${_INITRD}"}
umount "${_RAM}" &>"${_NO_LOG}"
rm -r "${_RAM}" &>"${_NO_LOG}"
#shellcheck disable=SC2115
rm -rf /usr/* &>"${_NO_LOG}"
while true; do
_clean_kernel_cache
read -r -t 1
printf "\ec"
done
}
_full_system() {
_progress "1" "Refreshing pacman package database..."
pacman -Sy >"${_LOG}" 2>&1 || exit 1
_PACKAGES="$(pacman -Qqn)"
_COUNT=0
_PACKAGE_COUNT="$(pacman -Qqn | wc -l)"
if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then
_MKINITCPIO="mkinitcpio=99"
else
_MKINITCPIO="initramfs"
fi
for i in ${_PACKAGES}; do
if [[ "$((_COUNT*100/_PACKAGE_COUNT-4))" -gt 1 ]]; then
_progress "$((_COUNT*100/_PACKAGE_COUNT-4))" "Reinstalling all packages, installing ${i} now..."
fi
#shellcheck disable=SC2086
pacman -S --assume-installed ${_MKINITCPIO} --noconfirm ${i} >"${_LOG}" 2>&1 || exit 1
_COUNT="$((_COUNT+1))"
done
: >/tmp/60-mkinitcpio-remove.hook
: >/tmp/90-mkinitcpio-install.hook
# install mkinitcpio as last package, without rebuild trigger
pacman -S --hookdir /tmp --noconfirm mkinitcpio >"${_LOG}" 2>&1 || exit 1
_progress "97" "Adding texinfo and man-pages..."
pacman -S --noconfirm man-db man-pages texinfo >"${_LOG}" 2>&1 || exit 1
_progress "98" "Checking kernel version..."
_INSTALLED_KERNEL="$(pacman -Qi linux | grep Version | cut -d ':' -f 2 | sed -e 's# ##g' -e 's#\.arch#-arch#g')"
if ! [[ "${_INSTALLED_KERNEL}" == "${_RUNNING_KERNEL}" ]]; then
_progress "99" "Skipping kernel module loading..."
else
_progress "99" "Trigger kernel module loading..."
udevadm trigger --action=add --type=subsystems
udevadm trigger --action=add --type=devices
udevadm settle
fi
_progress "100" "Full Arch Linux system is ready now."
sleep 2
: > /.full_system
}
_new_image() {
_PRESET_LATEST="${_RUNNING_ARCH}-latest"
_PRESET_LOCAL="${_RUNNING_ARCH}-local"
_ISONAME="archboot-$(date +%Y.%m.%d-%H.%M)"
_progress "1" "Removing files from /..."
_clean_archboot
_clean_kernel_cache
[[ -d "${_CACHEDIR}" ]] && rm -f "${_CACHEDIR}"/*
mkdir /archboot
cd /archboot || exit 1
_W_DIR="$(mktemp -u archboot-release.XXX)"
# create container
[[ -d "${_W_DIR}" ]] || mkdir -p "${_W_DIR}"
: > "${_W_DIR}"/.archboot
_create_container &
_progress_wait "2" "20" "Generating container in ${_W_DIR}..." "10"
_progress "21" "Create archboot.db in ${_W_DIR}..."
_create_archboot_db "${_W_DIR}${_CACHEDIR}" > "${_LOG}"
# riscv64 does not support kexec at the moment
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
# removing not working lvm2 from latest image
_progress "22" "Removing lvm2 from container..."
${_NSPAWN} "${_W_DIR}" pacman -Rdd lvm2 --noconfirm &>"${_NO_LOG}"
# generate local iso in container, umount tmp it's a tmpfs and weird things could happen then
: > "${_W_DIR}"/.archboot
(${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*; archboot-${_RUNNING_ARCH}-iso.sh -g -s -p=${_PRESET_LOCAL} \
-i=${_ISONAME}-local-${_RUNNING_ARCH}" > "${_LOG}"; rm -rf "${_W_DIR:?}${_CACHEDIR:?}"/*; rm "${_W_DIR}"/.archboot) &
_ram_check
_progress_wait "23" "55" "Generating local ISO..." "10"
# generate latest iso in container
: > "${_W_DIR}"/.archboot
(${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;rm -rf /tmp/*;archboot-${_RUNNING_ARCH}-iso.sh -g -s -p=${_PRESET_LATEST} \
-i=${_ISONAME}-latest-${_RUNNING_ARCH}" > "${_LOG}"; rm "${_W_DIR}"/.archboot) &
_progress_wait "56" "69" "Generating latest ISO..." "10"
_progress "70" "Installing lvm2 to container..."
${_NSPAWN} "${_W_DIR}" pacman -Sy lvm2 --noconfirm &>"${_NO_LOG}"
fi
: > "${_W_DIR}"/.archboot
# generate iso in container
(${_NSPAWN} "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_RUNNING_ARCH}-iso.sh -g \
-i=${_ISONAME}-${_RUNNING_ARCH}" > "${_LOG}"; rm "${_W_DIR}"/.archboot) &
_progress_wait "71" "97" "Generating normal ISO..." "10"
_progress "98" "Cleanup container..."
# move iso out of container
mv "${_W_DIR}"/archboot*.iso ./ &>"${_NO_LOG}"
mv "${_W_DIR}"/archboot*.img ./ &>"${_NO_LOG}"
rm -r "${_W_DIR}"
_progress "100" "New isofiles are located in /archboot."
sleep 2
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,95 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_configure_plasma() {
echo "Configuring KDE..."
sed -i -e "s#<default>applications:.*#<default>applications:systemsettings.desktop,applications:org.kde.konsole.desktop,preferred://filemanager,applications:${_STANDARD_BROWSER}.desktop,applications:gparted.desktop,applications:archboot.desktop</default>#g" /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/config/main.xml
echo "Replacing wallpaper..."
for i in /usr/share/wallpapers/Next/contents/images/*; do
cp /usr/share/archboot/grub/archboot-background.png "${i}"
done
echo "Replacing menu structure..."
cat << EOF >/etc/xdg/menus/applications.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>Applications</Name>
<Directory>kde-main.directory</Directory>
<!-- Search the default locations -->
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<DefaultLayout>
<Merge type="files"/>
<Merge type="menus"/>
<Separator/>
<Menuname>More</Menuname>
</DefaultLayout>
<Layout>
<Merge type="files"/>
<Merge type="menus"/>
<Menuname>Applications</Menuname>
</Layout>
<Menu>
<Name>Settingsmenu</Name>
<Directory>kf5-settingsmenu.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
</Menu>
<DefaultMergeDirs/>
<Include>
<Filename>archboot.desktop</Filename>
<Filename>${_STANDARD_BROWSER}.desktop</Filename>
<Filename>org.kde.dolphin.desktop</Filename>
<Filename>gparted.desktop</Filename>
<Filename>org.kde.konsole.desktop</Filename>
</Include>
</Menu>
EOF
echo "Autostarting setup..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
GenericName=Installer
Exec=konsole -p colors=Linux -e /usr/bin/setup
Icon=system-software-install
EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/
}
_prepare_plasma() {
if ! [[ -e /usr/bin/startplasma-x11 ]]; then
_prepare_graphic "${_PACKAGES}"
_configure_plasma >"${_LOG}" 2>&1
fi
}
_install_plasma_wayland() {
_PACKAGES="${_WAYLAND_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_PLASMA_PACKAGES}"
_prepare_plasma
}
_install_plasma() {
_PACKAGES="${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_PLASMA_PACKAGES}"
_prepare_plasma
}
_start_plasma_wayland() {
_progress "100" "Launching Plasma/KDE Wayland now, logging is done on ${_LOG}..."
sleep 2
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session startplasma-wayland >${_LOG} 2>&1" > /usr/bin/plasma-wayland
chmod 755 /usr/bin/plasma-wayland
plasma-wayland
}
_start_plasma() {
_progress "100" "Launching Plasma/KDE now, logging is done on ${_LOG}..."
sleep 2
echo "export DESKTOP_SESSION=plasma" > /root/.xinitrc
echo "exec startplasma-x11" >> /root/.xinitrc
startx >"${_LOG}" 2>&1
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,116 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_configure_sway() {
echo "Configuring Sway..."
echo "Configuring bemenu..."
#shellcheck disable=SC2016
sed -i -e 's|^set $menu.*|set $menu j4-dmenu-desktop --dmenu=\x27bemenu -i --tf "#00ff00" --hf "#00ff00" --nf "#dcdccc" --fn "pango:Terminus 12" -H 30\x27 --no-generic --term="foot"|g' /etc/sway/config
echo "Configuring wallpaper..."
sed -i -e 's|^output .*|output * bg /usr/share/archboot/grub/archboot-background.png fill|g' /etc/sway/config
echo "Configuring foot..."
if ! grep -q 'archboot colors' /etc/xdg/foot/foot.ini; then
cat <<EOF >> /etc/xdg/foot/foot.ini
# archboot colors
[colors]
background=000000
foreground=ffffff
## Normal/regular colors (color palette 0-7)
regular0=000000 # bright black
regular1=ff0000 # bright red
regular2=00ff00 # bright green
regular3=ffff00 # bright yellow
regular4=005fff # bright blue
regular5=ff00ff # bright magenta
regular6=00ffff # bright cyan
regular7=ffffff # bright white
## Bright colors (color palette 8-15)
bright0=000000 # bright black
bright1=ff0000 # bright red
bright2=00ff00 # bright green
bright3=ffff00 # bright yellow
bright4=005fff # bright blue
bright5=ff00ff # bright magenta
bright6=00ffff # bright cyan
bright7=ffffff # bright white
[main]
font=monospace:size=12
EOF
fi
echo "Autostarting setup..."
grep -q 'exec foot' /etc/sway/config ||\
echo "exec foot -- /usr/bin/setup" >> /etc/sway/config
if ! grep -q firefox /etc/sway/config; then
cat <<EOF >> /etc/sway/config
# from https://wiki.gentoo.org/wiki/Sway
# automatic floating
for_window [window_role = "pop-up"] floating enable
for_window [window_role = "bubble"] floating enable
for_window [window_role = "dialog"] floating enable
for_window [window_type = "dialog"] floating enable
for_window [window_role = "task_dialog"] floating enable
for_window [window_type = "menu"] floating enable
for_window [app_id = "floating"] floating enable
for_window [app_id = "floating_update"] floating enable, resize set width 1000px height 600px
for_window [class = "(?i)pinentry"] floating enable
for_window [title = "Administrator privileges required"] floating enable
# firefox tweaks
for_window [title = "About Mozilla Firefox"] floating enable
for_window [window_role = "About"] floating enable
for_window [app_id="firefox" title="Library"] floating enable, border pixel 1, sticky enable
for_window [title = "Firefox - Sharing Indicator"] kill
for_window [title = "Firefox — Sharing Indicator"] kill
EOF
fi
echo "Configuring desktop files..."
cat << EOF > /usr/share/applications/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
GenericName=Installer
Exec=foot -- /usr/bin/setup
Icon=system-software-install
EOF
_HIDE_MENU="avahi-discover bssh bvnc org.codeberg.dnkl.foot-server org.codeberg.dnkl.footclient qvidcap qv4l2"
echo "Hiding ${_HIDE_MENU} menu entries..."
for i in ${_HIDE_MENU}; do
echo "[DESKTOP ENTRY]" > /usr/share/applications/"${i}".desktop
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
echo "Configuring waybar..."
if ! grep -q 'exec waybar' /etc/sway/config; then
# hide sway-bar
sed -i '/position top/a mode invisible' /etc/sway/config
# diable not usable plugins
echo "exec waybar" >> /etc/sway/config
sed -i -e 's#, "custom/media"##g' /etc/xdg/waybar/config
sed -i -e 's#"mpd", "idle_inhibitor", "pulseaudio",##g' /etc/xdg/waybar/config
fi
echo "Configuring wayvnc..."
if ! grep -q wayvnc /etc/sway/config; then
echo "address=0.0.0.0" > /etc/wayvnc
echo "exec wayvnc -C /etc/wayvnc &" >> /etc/sway/config
fi
}
_install_sway() {
_PACKAGES="${_WAYLAND_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_SWAY_PACKAGES}"
if ! [[ -e /usr/bin/sway ]]; then
_prepare_graphic "${_PACKAGES}"
_configure_sway >"${_LOG}" 2>&1
fi
}
_start_sway() {
echo "MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland \
XKB_DEFAULT_LAYOUT=$(grep 'KEYMAP' /etc/vconsole.conf | cut -d '=' -f2 | sed -e 's#-.*##g') \
exec dbus-run-session sway >${_LOG} 2>&1" > /usr/bin/sway-wayland
chmod 755 /usr/bin/sway-wayland
sway-wayland
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,80 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_D_SCRIPTS=""
_L_COMPLETE=""
_L_INSTALL_COMPLETE=""
_G_RELEASE=""
_CONFIG="/etc/archboot/${_RUNNING_ARCH}-update_installer.conf"
_W_DIR="/archboot"
_ROOTFS_DIR="${_W_DIR}/tmp"
_SOURCE="https://gitlab.archlinux.org/tpowa/archboot/-/raw/master"
_BIN="/usr/bin"
_ETC="/etc/archboot"
_LIB="/usr/lib/archboot"
_RAM="/sysroot"
_INITRD="initrd.img"
_INST="/${_LIB}/installer"
_HELP="/${_LIB}/installer/help"
_RUN="/${_LIB}/run"
_UPDATE="/${_LIB}/update"
_MENU_TITLE=" Logging to ${_VC} | ${_LOG} "
_graphic_options() {
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-gnome\e[m Launch Gnome desktop with VNC sharing enabled."
echo -e " \e[1m-gnome-wayland\e[m Launch Gnome desktop with Wayland backend."
echo -e " \e[1m-plasma\e[m Launch KDE Plasma desktop with VNC sharing enabled."
echo -e " \e[1m-plasma-wayland\e[m Launch KDE Plasma desktop with Wayland backend."
fi
}
usage () {
echo -e "\e[1mManage \e[36mArchboot\e[m\e[1m - Arch Linux Environment:\e[m"
echo -e "\e[1m-----------------------------------------\e[m"
echo -e " \e[1m-help\e[m This message."
if [[ ! -e "${_LOCAL_DB}" || -e "/usr/bin/setup" ]]; then
echo -e " \e[1m-update\e[m Update scripts: setup, quickinst, network, clock and helpers."
fi
# latest image
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2000000 && ! -e "/.full_system" && ! -e "${_LOCAL_DB}" ]]; then
echo -e " \e[1m-full-system\e[m Switch to full Arch Linux system."
# local image
elif [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2571000 && ! -e "/.full_system" && -e "${_LOCAL_DB}" && -e "/usr/bin/setup" ]]; then
echo -e " \e[1m-full-system\e[m Switch to full Arch Linux system."
fi
echo -e ""
if [[ -e "/usr/bin/setup" ]]; then
# works only on latest image
if ! [[ -e "${_LOCAL_DB}" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2400000 ]] ; then
_graphic_options
fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 1500000 ]]; then
echo -e " \e[1m-sway\e[m Launch Sway desktop with VNC sharing enabled."
echo -e " \e[1m-xfce\e[m Launch Xfce desktop with VNC sharing enabled."
echo -e " \e[1m-custom-xorg\e[m Install custom X environment."
[[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 2400000 ]] && echo -e " \e[1m-custom-wayland\e[m Install custom Wayland environment."
echo ""
fi
fi
fi
if ! [[ -e "${_LOCAL_DB}" ]] || [[ -e "${_LOCAL_DB}" && ! -e "/usr/bin/setup" ]]; then
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 1970000 ]]; then
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-latest\e[m Launch latest archboot environment (using kexec)."
fi
fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 3271000 ]]; then
if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then
echo -e " \e[1m-latest-install\e[m Launch latest archboot environment with"
echo -e " package cache (using kexec)."
fi
fi
if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt 4216000 ]]; then
echo -e " \e[1m-latest-image\e[m Generate latest image files in /archboot directory."
fi
fi
exit 0
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -1,252 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_install_xfce() {
if ! [[ -e /usr/bin/startxfce4 ]]; then
_prepare_graphic "${_XORG_PACKAGE} ${_VNC_PACKAGE} ${_STANDARD_PACKAGES} ${_STANDARD_BROWSER} ${_XFCE_PACKAGES}"
_configure_xfce >"${_LOG}" 2>&1
fi
}
_configure_xfce() {
echo "Configuring xfce panel..."
cat << EOF >/etc/xdg/xfce4/panel/default.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-panel" version="1.0">
<property name="configver" type="int" value="2"/>
<property name="panels" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<property name="dark-mode" type="bool" value="true"/>
<property name="panel-1" type="empty">
<property name="position" type="string" value="p=6;x=0;y=0"/>
<property name="length" type="uint" value="100"/>
<property name="position-locked" type="bool" value="true"/>
<property name="icon-size" type="uint" value="16"/>
<property name="size" type="uint" value="26"/>
<property name="plugin-ids" type="array">
<value type="int" value="1"/>
<value type="int" value="2"/>
<value type="int" value="3"/>
<value type="int" value="4"/>
<value type="int" value="5"/>
<value type="int" value="6"/>
<value type="int" value="7"/>
<value type="int" value="8"/>
<value type="int" value="9"/>
<value type="int" value="10"/>
<value type="int" value="11"/>
<value type="int" value="12"/>
<value type="int" value="13"/>
<value type="int" value="14"/>
</property>
</property>
<property name="panel-2" type="empty">
<property name="autohide-behavior" type="uint" value="1"/>
<property name="position" type="string" value="p=10;x=0;y=0"/>
<property name="length" type="uint" value="1"/>
<property name="position-locked" type="bool" value="true"/>
<property name="size" type="uint" value="48"/>
<property name="plugin-ids" type="array">
<value type="int" value="15"/>
<value type="int" value="16"/>
<value type="int" value="17"/>
<value type="int" value="18"/>
<value type="int" value="19"/>
<value type="int" value="20"/>
<value type="int" value="21"/>
<value type="int" value="22"/>
</property>
</property>
</property>
<property name="plugins" type="empty">
<property name="plugin-1" type="string" value="applicationsmenu"/>
<property name="plugin-2" type="string" value="tasklist">
<property name="grouping" type="uint" value="1"/>
</property>
<property name="plugin-3" type="string" value="separator">
<property name="expand" type="bool" value="true"/>
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-4" type="string" value="pager"/>
<property name="plugin-5" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-6" type="string" value="systray">
<property name="square-icons" type="bool" value="true"/>
</property>
<property name="plugin-8" type="string" value="pulseaudio">
<property name="enable-keyboard-shortcuts" type="bool" value="true"/>
<property name="show-notifications" type="bool" value="true"/>
</property>
<property name="plugin-9" type="string" value="power-manager-plugin"/>
<property name="plugin-10" type="string" value="notification-plugin"/>
<property name="plugin-11" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-12" type="string" value="clock"/>
<property name="plugin-13" type="string" value="separator">
<property name="style" type="uint" value="0"/>
</property>
<property name="plugin-14" type="string" value="actions"/>
<property name="plugin-15" type="string" value="showdesktop"/>
<property name="plugin-16" type="string" value="separator"/>
<property name="plugin-17" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-terminal-emulator.desktop"/>
</property>
</property>
<property name="plugin-18" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-file-manager.desktop"/>
</property>
</property>
<property name="plugin-19" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="xfce4-web-browser.desktop"/>
</property>
</property>
<property name="plugin-20" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="gparted.desktop"/>
</property>
</property>
<property name="plugin-21" type="string" value="separator"/>
<property name="plugin-22" type="string" value="launcher">
<property name="items" type="array">
<value type="string" value="archboot.desktop"/>
</property>
</property>
</property>
</channel>
EOF
echo "Setting breeze as default icons..."
sed -i -e 's#<property name="IconThemeName" type="string" value="Adwaita"/>#<property name="IconThemeName" type="string" value="breeze"/>#g' \
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
echo "Setting archboot background image..."
cat << EOF >/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="xfce4-desktop" version="1.0">
<property name="backdrop" type="empty">
<property name="screen0" type="empty">
<property name="monitor0" type="empty">
<property name="image-path" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="last-single-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
<property name="image-show" type="bool" value="true"/>
<property name="image-style" type="int" value="0"/>
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorVNC-0" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
<property name="monitorHDMI1" type="empty">
<property name="workspace0" type="empty">
<property name="color-style" type="int" value="0"/>
<property name="image-style" type="int" value="3"/>
<property name="last-image" type="string" value="/usr/share/archboot/grub/archboot-background.png"/>
</property>
</property>
</property>
</property>
</channel>
EOF
echo "Replacing appfinder launcher with gparted..."
sed -i -e 's#xfce4-appfinder#gparted#g' /etc/xdg/xfce4/panel/default.xml
echo "Replacing directory menu launcher with setup..."
sed -i -e 's#directorymenu#archboot#g' /etc/xdg/xfce4/panel/default.xml
echo "Setting ${_STANDARD_BROWSER} as default browser..."
sed -i -e "s#firefox#${_STANDARD_BROWSER}#g" /etc/xdg/xfce4/helpers.rc
echo "Replacing menu structure..."
cat << EOF >/etc/xdg/menus/xfce-applications.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>Xfce</Name>
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<Include>
<Category>X-Xfce-Toplevel</Category>
</Include>
<Layout>
<Filename>archboot.desktop</Filename>
<Filename>gparted.desktop</Filename>
<Filename>xfce4-run.desktop</Filename>
<Separator/>
<Filename>xfce4-terminal-emulator.desktop</Filename>
<Filename>xfce4-file-manager.desktop</Filename>
<Filename>xfce4-web-browser.desktop</Filename>
<Separator/>
<Menuname>Settings</Menuname>
<Separator/>
<Merge type="all"/>
<Separator/>
<Filename>xfce4-session-logout.desktop</Filename>
</Layout>
<Menu>
<Name>Settings</Name>
<Directory>xfce-settings.directory</Directory>
<Include>
<Category>Settings</Category>
</Include>
<Layout>
<Filename>xfce-settings-manager.desktop</Filename>
<Separator/>
<Merge type="all"/>
</Layout>
<Menu>
<Name>Screensavers</Name>
<Directory>xfce-screensavers.directory</Directory>
<Include>
<Category>Screensaver</Category>
</Include>
</Menu>
</Menu>
<DefaultMergeDirs/>
</Menu>
EOF
echo "Adding gparted to xfce top level menu..."
sed -i -e 's#Categories=.*#Categories=X-Xfce-Toplevel;#g' /usr/share/applications/gparted.desktop
_HIDE_MENU="xfce4-mail-reader xfce4-about"
echo "Hiding ${_HIDE_MENU} menu entries..."
for i in ${_HIDE_MENU}; do
echo 'NoDisplay=true' >> /usr/share/applications/"${i}".desktop
done
echo "Autostarting setup..."
cat << EOF > /etc/xdg/autostart/archboot.desktop
[Desktop Entry]
Type=Application
Name=Archboot Setup
GenericName=Installer
Exec=xfce4-terminal -x /usr/bin/setup
Icon=system-software-install
Categories=X-Xfce-Toplevel;
EOF
cp /etc/xdg/autostart/archboot.desktop /usr/share/applications/
}
_start_xfce() {
_progress "100" "Launching XFCE now, logging is done on ${_LOG}..."
sleep 2
startxfce4 >"${_LOG}" 2>&1
}
# vim: set ft=sh ts=4 sw=4 et:

View file

@ -15,7 +15,7 @@
<body>
<p><span><img src="logo.png" alt="Logo"></span></p>
<h1>Archboot Project | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=Z7GXKW4MKHK7C"><img src="donate.png" alt="Donate"></a></h1>
<p><strong>&copy; 2006 - 2023 | <a href=mailto:tpowa@archlinux.org>Tobias Powalowski</a></strong> | Arch Linux Developer <strong><a href="https://archlinux.org/people/developers/#tpowa">tpowa</a></strong><br><strong>Last update: 02.11.2023 20:19</strong></p>
<p><strong>&copy; 2006 - 2023 | <a href=mailto:tpowa@archlinux.org>Tobias Powalowski</a></strong> | Arch Linux Developer <strong><a href="https://archlinux.org/people/developers/#tpowa">tpowa</a></strong><br><strong>Last update: 13.11.2023 20:00</strong></p>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#introduction" id="toc-introduction"><strong><span class="toc-section-number">1.</span> Introduction</strong></a></li>
@ -751,7 +751,7 @@ The calculated size to boot the image follows the formula:<br>
<td class="MyNo">&#10006;</td>
</tr>
<tr class="odd">
<td><a href="https://wiki.archlinux.org/title/Systemd" title="Systemd"><strong>systemd</strong></a> on early userspace</td>
<td><a href="https://wiki.archlinux.org/title/Systemd" title="Systemd"><strong>Systemd</strong></a> on early userspace</td>
<td class="MyYes">&#10004;</td>
<td class="MyNo">&#10006;</td>
</tr>
@ -787,32 +787,32 @@ The calculated size to boot the image follows the formula:<br>
</tr>
<tr>
<td>Virtual Machine boot to prompt<sup>3</sup></td>
<td class="MyYes">19 seconds</td>
<td class="MyNo">33 seconds</td>
<td class="MyYes">20 seconds</td>
<td class="MyNo">24 seconds</td>
</tr>
<tr class="odd">
<td>Virtual Machine systemd-analyze<sup>3</sup></td>
<td class="MyYes">18 seconds</td>
<td class="MyNo">83 seconds</td>
<td class="MyYes">20 seconds</td>
<td class="MyNo">73 seconds</td>
</tr>
<tr class="odd">
<td>Minimum RAM to boot in MiB<sup>3</sup></td>
<td class="MyYes">710</td>
<td class="MyYes">740</td>
<td class="MyNo">770</td>
</tr>
<tr>
<td>Free RAM on system in MiB<sup>3</sup></td>
<td class="MyYes">3310</td>
<td class="MyNo">2767</td>
<td class="MyNo">2815</td>
</tr>
<tr class="odd">
<td>Imagesize in MiB</td>
<td class="MyYes">179 - 783</td>
<td class="MyYes">183 - 797</td>
<td class="MyNo">847</td>
</tr>
<tr class="even">
<td>ROOTFS size in MiB</td>
<td class="MyYes">389</td>
<td class="MyYes">398</td>
<td class="MyNo">1700</td>
</tr>
<tr class="odd">