mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
Compare commits
7 commits
62caddf370
...
d0dce9e72c
Author | SHA1 | Date | |
---|---|---|---|
|
d0dce9e72c | ||
|
e5580e63be | ||
|
f56ee77390 | ||
|
40193842fd | ||
|
b765bd40db | ||
|
4837c6a021 | ||
|
3fb5a52c5e |
16 changed files with 27 additions and 25 deletions
|
@ -34,11 +34,12 @@ server-release:
|
|||
- use local files instead of resync from source server'
|
||||
- switched db compression to zst
|
||||
- make db files reproducible
|
||||
server-update:
|
||||
server-updatee
|
||||
- added automatic update scripts
|
||||
setup:
|
||||
- abort on pacman package installation error
|
||||
- fixed autoconfiguration of mirror
|
||||
- replaced cut usage with choose
|
||||
---
|
||||
Highlights 2024.06:
|
||||
- systemd 256.x support
|
||||
|
|
|
@ -8,8 +8,9 @@ Use:
|
|||
- curl for downloading files
|
||||
- systemd
|
||||
- shellcheck
|
||||
- rg instead of grep
|
||||
- choose instead of cut
|
||||
- fd instead of find
|
||||
- rg instead of grep
|
||||
- sd instead of sed
|
||||
|
||||
Don't use:
|
||||
|
|
|
@ -7,7 +7,7 @@ _SERVER_WAIT="3600"
|
|||
# set program updates that trigger new server release
|
||||
_TRIGGER="archboot archboot-arm archboot-riscv archlinux-keyring
|
||||
archlinuxarm-keyring bcachefs-tools btrfs-progs coreutils
|
||||
cryptsetup device-mapper dosfstools e2fsprogs glibc iproute2
|
||||
cryptsetup device-mapper dosfstools e2fsprogs glibc hwdetect iproute2
|
||||
iputils iw iwd linux linux-firmware lvm2 mdadm mkinitcpio nano neovim
|
||||
openssh pacman systemd thin-provisioning-tools ttyd util-linux
|
||||
xfsprogs"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
_install_files
|
||||
rm /usr/bin/{3cpio,blkid,gzip,journalctl,less,lsmod,mkfs.btrfs,\
|
||||
mountpoint,setfont,sulogin,systemctl}
|
||||
|
|
|
@ -15,7 +15,7 @@ usr/lib/{coreutils,cryptsetup,gconv,modules-load.d,p11-kit,pam.d,pkcs11,polkit-1
|
|||
usr/share/{bash-completion,dbus-1,factory,hwdata,i18n/locales,makepkg,nano,pacman/keyrings,polkit-1,readline,systemd,terminfo} \
|
||||
| tar -C "${_ROOTFS}" -xpf -
|
||||
# only run on archboot container
|
||||
if grep -qw 'archboot' /etc/hostname; then
|
||||
if rg -qw 'archboot' /etc/hostname; then
|
||||
_map _binary locale{-gen,def}
|
||||
_map _file /etc/locale.gen /usr/share/locale/locale.alias
|
||||
# only support UTF-8
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
# remove pacman-init.service
|
||||
rm -f /tmp/etc/systemd/system/multi-user.target.wants/pacman-init.service
|
||||
rm -f /tmp/etc/systemd/system/pacman-init.service
|
||||
|
|
|
@ -16,7 +16,7 @@ _run ()
|
|||
# only take services from systemd package
|
||||
pacman -Sy &>"${_NO_LOG}"
|
||||
#shellcheck disable=SC2046
|
||||
_map _file $(pacman -Ql systemd | grep '/usr/lib/systemd/system/.' | choose 1)
|
||||
_map _file $(pacman -Ql systemd | rg '/usr/lib/systemd/system/.' | choose 1)
|
||||
_map _file /usr/lib/sysusers.d/{arch,basic}.conf
|
||||
# disable systemd services:
|
||||
for i in lvm2-{lvmpolld,monitor} systemd-{boot,random-seed,sysusers\
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
_install_files
|
||||
rm /usr/bin/{\[,addpart,attr,b2sum,base{32,64},basenc,blk{discard,pr,zone},blockdev,bunzip2,\
|
||||
bz{cat,diff,grep,ip2,ip2recover,more},cal,capsh,ch{acl,con,cpu,grp,mem,oom,own,root,rt},\
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
[[ -d /var/cache/pacman/pkg ]] && rm -r /var/cache/pacman/pkg
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
_install_files
|
||||
rm /usr/bin/{badblocks,blkmapd,btrfs-{find-root,image,map-logical,select-super},btrfs{,ck,tune},\
|
||||
chattr,cifscreds,cifs.{idmap,upcall},compile_et,debugfs,\
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
rm -r /lib/firmware
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
_install_mods
|
||||
rm -r /lib/modules
|
||||
_MODS="" _MOD_DEPS=""
|
||||
|
|
|
@ -18,12 +18,12 @@ _run ()
|
|||
echo -e "|-----------|---------|--------|----------|---------|" >> "${_MOTD}"
|
||||
echo -e "| \e[1;92mALT+F1-F4\e[m | \e[1;92mALT+F5\e[m | \e[1;92mALT+F6\e[m | \e[1;92mALT+F11\e[m | \e[1;92mALT+F12\e[m |" >> "${_MOTD}"
|
||||
echo -e "-----------------------------------------------------" >> "${_MOTD}"
|
||||
if echo "${_HOOKS[@]}" | grep -qw net; then
|
||||
if echo "${_HOOKS[@]}" | rg -qw net; then
|
||||
#shellcheck disable=SC2129
|
||||
echo -e "\e[1mFor Additional Wi-Fi Authentification Or Online Help:\e[m" >> "${_MOTD}"
|
||||
echo -e " - Use the \e[1;92m'elinks'\e[m text mode browser." >> "${_MOTD}"
|
||||
fi
|
||||
if echo "${_HOOKS[@]}" | grep -qw installer; then
|
||||
if echo "${_HOOKS[@]}" | rg -qw installer; then
|
||||
#shellcheck disable=SC2129
|
||||
echo -e "\e[1mManage Archboot Environment:\e[m" >> "${_MOTD}"
|
||||
echo -e " - Use the \e[1;92m'launcher'\e[m or the expert \e[1;92m'update'\e[m script." >> "${_MOTD}"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
_run ()
|
||||
{
|
||||
! grep -qw 'archboot' /etc/hostname && return
|
||||
! rg -qw 'archboot' /etc/hostname && return
|
||||
_install_files
|
||||
rm /usr/bin/{arpd,arping,bridge,clockdiff,ctstat,dcb,devlink,\
|
||||
elinks,ethtool,genl,ifstat,lnstat,nstat,ssh,tracepath,rdma,rtacct,\
|
||||
|
|
|
@ -23,7 +23,7 @@ _umount_btrfs() {
|
|||
_find_btrfsraid_devices() {
|
||||
_btrfs_scan
|
||||
if [[ -z "${_DETECT_CREATE_FILESYSTEM}" && "${_FSTYPE}" == "btrfs" ]]; then
|
||||
for i in $(btrfs filesystem show "${_DEV}" | choose 10); do
|
||||
for i in $(btrfs filesystem show "${_DEV}" | rg -o ' (/dev/.*)' -r '$1'); do
|
||||
_BTRFS_DEVS="${_BTRFS_DEVS}#${i}"
|
||||
done
|
||||
fi
|
||||
|
@ -34,7 +34,7 @@ _find_btrfsraid_bootloader_devices() {
|
|||
_BTRFS_COUNT=1
|
||||
if [[ "$(${_LSBLK} FSTYPE "${_BOOTDEV}")" == "btrfs" ]]; then
|
||||
_BTRFS_DEVS=""
|
||||
for i in $(btrfs filesystem show "${_BOOTDEV}" | choose 10); do
|
||||
for i in $(btrfs filesystem show "${_BOOTDEV}" | rg -o ' (/dev/.*)' -r '$1'); do
|
||||
_BTRFS_DEVS="${_BTRFS_DEVS}#${i}"
|
||||
_BTRFS_COUNT=$((_BTRFS_COUNT+1))
|
||||
done
|
||||
|
|
|
@ -22,7 +22,7 @@ _clear_fs_values() {
|
|||
: >/tmp/.btrfs-devices
|
||||
_SKIP_FILESYSTEM=""
|
||||
_FS_TYPE=""
|
||||
_DOMKFS=""
|
||||
_DOMKFS=0
|
||||
_LABEL_NAME=""
|
||||
_FS_OPTIONS=""
|
||||
_BTRFS_DEVS=""
|
||||
|
@ -186,8 +186,8 @@ _create_filesystem() {
|
|||
_BTRFS_DEVS=""
|
||||
_BTRFS_LEVEL=""
|
||||
_SKIP_FILESYSTEM=""
|
||||
[[ -z "${_DOMKFS}" ]] && _dialog --yesno "Would you like to create a filesystem on ${_DEV}?\n\n(This will overwrite existing data!)" 0 0 && _DOMKFS=1
|
||||
if [[ -n "${_DOMKFS}" ]]; then
|
||||
[[ "${_DOMKFS}" == "0" ]] && _dialog --yesno "Would you like to create a filesystem on ${_DEV}?\n\n(This will overwrite existing data!)" 0 0 && _DOMKFS=1
|
||||
if [[ "${_DOMKFS}" == "1" ]]; then
|
||||
[[ "${_FSTYPE}" == "swap" || "${_FSTYPE}" == "vfat" ]] || _select_filesystem || return 1
|
||||
while [[ -z "${_LABEL_NAME}" ]]; do
|
||||
_dialog --no-cancel --title " LABEL Name on ${_DEV} " --inputbox "Keep it short and use no spaces or special characters." 8 60 \
|
||||
|
@ -375,7 +375,7 @@ _mountpoints() {
|
|||
elif [[ "${_FSTYPE}" == "bcachefs" ]]; then
|
||||
echo "${_DEV}|${_FSTYPE}|${_MP}|${_DOMKFS}|${_LABEL_NAME}|${_FS_OPTIONS}|${_BCFS_DEVS}|${_BCFS_COMPRESS}" >>/tmp/.parts
|
||||
# remove members of multi devices
|
||||
if [[ -z "${_DOMKFS}" ]]; then
|
||||
if [[ "${_DOMKFS}" == "0" ]]; then
|
||||
_BCFS_UUID="$(${_LSBLK} UUID -d "${_DEV}")"
|
||||
for i in $(${_LSBLK} NAME,UUID | rg -o "(.*) ${_BCFS_UUID}" -r '$1'); do
|
||||
_DEVS="${_DEVS//$(${_LSBLK} NAME,SIZE -d "${i}" 2>"${_NO_LOG}")/}"
|
||||
|
@ -428,7 +428,7 @@ _mountpoints() {
|
|||
# returns: 1 on failure
|
||||
_mkfs() {
|
||||
[[ -f "/tmp/.mp-error" ]] && rm /tmp/.mp-error
|
||||
if [[ -n "${4}" ]]; then
|
||||
if [[ "${4}" == "1" ]]; then
|
||||
if [[ "${2}" == "swap" ]]; then
|
||||
_progress "${_COUNT}" "Creating and activating swapspace on ${1}..."
|
||||
else
|
||||
|
@ -446,7 +446,7 @@ _mkfs() {
|
|||
_MOUNTOPTIONS=""
|
||||
if [[ "${2}" == "swap" ]]; then
|
||||
swapoff -a &>"${_NO_LOG}"
|
||||
if [[ -n "${4}" ]]; then
|
||||
if [[ "${4}" == "1" ]]; then
|
||||
if echo "${1}" | rg -q '^/dev'; then
|
||||
mkswap -L "${6}" "${1}" &>"${_LOG}" || : >/tmp/.mp-error
|
||||
else
|
||||
|
@ -480,7 +480,7 @@ _mkfs() {
|
|||
fi
|
||||
else
|
||||
# if we were tasked to create the filesystem, do so
|
||||
if [[ -n "${4}" ]]; then
|
||||
if [[ "${4}" == "1" ]]; then
|
||||
#shellcheck disable=SC2086
|
||||
case ${2} in
|
||||
# don't handle anything else here, we will error later
|
||||
|
@ -554,7 +554,7 @@ _mkfs() {
|
|||
fi
|
||||
fi
|
||||
# btrfs needs balancing on fresh created raid, else weird things could happen
|
||||
[[ "${2}" == "btrfs" && -n "${4}" ]] && btrfs balance start --full-balance "${3}""${5}" &>"${_LOG}"
|
||||
[[ "${2}" == "btrfs" && "${4}" == "1" ]] && btrfs balance start --full-balance "${3}""${5}" &>"${_LOG}"
|
||||
fi
|
||||
# add to .device-names for config files
|
||||
#shellcheck disable=SC2155
|
||||
|
|
Loading…
Reference in a new issue