mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
rename build to _run
This commit is contained in:
parent
7b8bc8f463
commit
f16836af8b
45 changed files with 68 additions and 68 deletions
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules '/acpi/'
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary head id cksum tail test uptime w who whoami xargs \
|
||||
swapon uniq seq fdisk sfdisk cfdisk parted free less \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
_APPS="head id cksum tail test uptime w who whoami xargs \
|
||||
swapon uniq seq fdisk sfdisk cfdisk parted free less \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
### setting up base structure
|
||||
map add_dir /root /mnt /sysroot /install /var/log /home /var/tmp
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
# remove initrd-release
|
||||
rm -f /tmp/etc/initrd-release
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
### adding default font and keymap
|
||||
add_binary loadkeys
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build()
|
||||
_run()
|
||||
{
|
||||
### add block device support
|
||||
# sata, scsi, nvme
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_full_dir /var/cache/pacman/pkg
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
rm -rf /var/cache/pacman/pkg
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary hwclock tzselect zic zdump
|
||||
map add_full_dir /usr/share/zoneinfo /usr/share/zoneinfo-leaps
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
### add pcspkr
|
||||
add_module pcspkr
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# archboot-cpio.sh - modular tool for building an initramfs image
|
||||
# archboot-cpio.sh - modular tool for _runing an initramfs image
|
||||
# simplified, stripped down, optimized for size and speed
|
||||
# by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
|
@ -232,44 +232,44 @@ add_binary() {
|
|||
return 0
|
||||
}
|
||||
|
||||
initialize_buildroot() {
|
||||
# creates a temporary directory for the buildroot and initialize it with a
|
||||
initialize__runroot() {
|
||||
# creates a temporary directory for the _runroot and initialize it with a
|
||||
# basic set of necessary directories and symlinks
|
||||
local workdir='' kernver="$1" arch buildroot
|
||||
local workdir='' kernver="$1" arch _runroot
|
||||
arch="$(uname -m)"
|
||||
if ! workdir="$(mktemp -d --tmpdir mkinitcpio.XXXXXX)"; then
|
||||
error 'Failed to create temporary working directory in %s' "${TMPDIR:-/tmp}"
|
||||
return 1
|
||||
fi
|
||||
buildroot="${2:-$workdir/root}"
|
||||
_runroot="${2:-$workdir/root}"
|
||||
if [[ ! -w "${2:-$workdir}" ]]; then
|
||||
error 'Unable to write to build root: %s' "$buildroot"
|
||||
error 'Unable to write to _run root: %s' "$_runroot"
|
||||
return 1
|
||||
fi
|
||||
# base directory structure
|
||||
install -dm755 "$buildroot"/{new_root,proc,sys,dev,run,tmp,var,etc,usr/{local{,/bin,/sbin,/lib},lib,bin}}
|
||||
ln -s "usr/lib" "$buildroot/lib"
|
||||
ln -s "bin" "$buildroot/usr/sbin"
|
||||
ln -s "usr/bin" "$buildroot/bin"
|
||||
ln -s "usr/bin" "$buildroot/sbin"
|
||||
ln -s "/run" "$buildroot/var/run"
|
||||
install -dm755 "$_runroot"/{new_root,proc,sys,dev,run,tmp,var,etc,usr/{local{,/bin,/sbin,/lib},lib,bin}}
|
||||
ln -s "usr/lib" "$_runroot/lib"
|
||||
ln -s "bin" "$_runroot/usr/sbin"
|
||||
ln -s "usr/bin" "$_runroot/bin"
|
||||
ln -s "usr/bin" "$_runroot/sbin"
|
||||
ln -s "/run" "$_runroot/var/run"
|
||||
case "$arch" in
|
||||
x86_64)
|
||||
ln -s "lib" "$buildroot/usr/lib64"
|
||||
ln -s "usr/lib" "$buildroot/lib64"
|
||||
ln -s "lib" "$_runroot/usr/lib64"
|
||||
ln -s "usr/lib" "$_runroot/lib64"
|
||||
;;
|
||||
esac
|
||||
# kernel module dir
|
||||
[[ "$kernver" != 'none' ]] && install -dm755 "$buildroot/usr/lib/modules/$kernver/kernel"
|
||||
[[ "$kernver" != 'none' ]] && install -dm755 "$_runroot/usr/lib/modules/$kernver/kernel"
|
||||
# mount tables
|
||||
ln -s ../proc/self/mounts "$buildroot/etc/mtab"
|
||||
: >"$buildroot/etc/fstab"
|
||||
ln -s ../proc/self/mounts "$_runroot/etc/mtab"
|
||||
: >"$_runroot/etc/fstab"
|
||||
# add a blank ld.so.conf to keep ldconfig happy
|
||||
: >"$buildroot/etc/ld.so.conf"
|
||||
: >"$_runroot/etc/ld.so.conf"
|
||||
printf '%s' "$workdir"
|
||||
}
|
||||
|
||||
run_build_hook() {
|
||||
run__run_hook() {
|
||||
local hook="$1" script=''
|
||||
# shellcheck disable=SC2034
|
||||
local MODULES=() BINARIES=() FILES=() SCRIPT=''
|
||||
|
@ -280,19 +280,19 @@ run_build_hook() {
|
|||
return 1
|
||||
fi
|
||||
# source
|
||||
unset -f build
|
||||
unset -f _run
|
||||
# shellcheck disable=SC1090
|
||||
if ! . "$script"; then
|
||||
error 'Failed to read %s' "$script"
|
||||
return 1
|
||||
fi
|
||||
if ! declare -f build >"${_NO_LOG}"; then
|
||||
error "Hook '%s' has no build function" "${script}"
|
||||
if ! declare -f _run >"${_NO_LOG}"; then
|
||||
error "Hook '%s' has no _run function" "${script}"
|
||||
return 1
|
||||
fi
|
||||
# run
|
||||
msg2 "Running build hook: [%s]" "${script##*/}"
|
||||
build
|
||||
msg2 "Running _run hook: [%s]" "${script##*/}"
|
||||
_run
|
||||
# if we made it this far, return successfully. Hooks can
|
||||
# do their own error catching if it's severe enough, and
|
||||
# we already capture errors from the add_* functions.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules 'arch/x86/kernel/cpu/cpufreq|drivers/cpufreq'
|
||||
map add_binary cpupower cpufreq-bench_plot.sh
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules 'md/dm-*'
|
||||
map add_binary dmsetup dmeventd blkdeactivate dmstats cryptsetup \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules '/firmware/dmi-sysfs'
|
||||
map add_binary dmidecode biosdecode
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_binary efibootmgr
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary efivar efisecdb
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules '/fs/(btrfs|cifs|exfat|ext4|f2fs|fat|hfs|hfsplus|isofs|jfs|nfs|nfsd|nilfs2|nls|ntfs3|udf|xfs|vboxsf)'
|
||||
add_all_modules '/(lib/|kernel|arch/*)/crypto'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
_APPS="mkswap badblocks blkid debugfs dumpe2fs e2fsck e2image e2undo findfs fsck \
|
||||
logsave mkfs.ext2 resize2fs chattr lsattr e2freefrag filefrag \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
# add firmware files and licenses
|
||||
map add_full_dir "/lib/firmware" "/usr/share/licenses/linux-firmware"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
rm -r /lib/firmware
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules '/hv/hv_*'
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build() {
|
||||
_run() {
|
||||
### init modules
|
||||
map add_module vfat? iso9660? nls_cp437? nls_ascii? cdrom? exfat?
|
||||
map add_binary bash sh blkid mount mountpoint switch_root bsdcpio mkfs.btrfs setfont \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary genfstab arch-chroot pacstrap \
|
||||
archboot-binary-check.sh archboot-not-installed.sh hwdetect
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
# save RAM with deleting already copied content
|
||||
rm -rf /var/cache/pacman/pkg
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_file /etc/archboot/defaults /usr/lib/archboot/common.sh \
|
||||
/usr/lib/archboot/container.sh /usr/bin/archboot-"$(uname -m)"-create-container.sh \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary kexec vmcore-dmesg
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
# add firmware files and licenses
|
||||
map add_full_dir "/lib/firmware/amdgpu" "/lib/firmware/i915" "/lib/firmware/nvidia" \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_full_dir /usr/share/licenses/common
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_binary lshw
|
||||
for i in manuf oui pnpid; do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
local symlink
|
||||
### from thin-provisioning-tools
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules -f 'dm-' 'drivers/md/*'
|
||||
map add_binary mdmon mdadm
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
### generate motd
|
||||
MOTD=$(mktemp /var/tmp/motd.XXXX)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_binary nvim
|
||||
map add_full_dir /usr/share/nvim
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary arping clockdiff tracepath ssh genl \
|
||||
ifstat ctstat rtstat lnstat nstat rtacct rtmon ss tc bridge \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
_APPS="arping clockdiff tracepath ssh arpd \
|
||||
genl ifstat ctstat rtstat lnstat nstat rtacct rtmon ss tc \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules -f '_cs|b44|broadcom/bnx2x|brocade|cavium|chelsio|cisco|netronome|mellanox|myricom|qlogic|qualcomm' '/drivers/net/ethernet|/net/ipv4|/net/ipv6|/drivers/net/usb'
|
||||
map add_binary ip getent ping
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary lspci setpci update-pciids
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules -f 'media' '/platform/'
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary findssl.sh scp sftp ssh-add ssh-agent ssh-copy-id ssh-keygen ssh-keyscan sshd \
|
||||
exportfs nfsstat rpc.idmapd rpc.mountd rpc.nfsd rpc.statd rpcdebug showmount \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
# https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot
|
||||
_RUNNING_ARCH="$(uname -m)"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
map add_binary smartctl smartd update-smart-drivedb
|
||||
map add_file /etc/conf.d/smartd /etc/smartd.conf
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_binary lsusb
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_full_dir /usr/share/kbd
|
||||
#add kbd binaries
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
|
||||
build ()
|
||||
_run ()
|
||||
{
|
||||
add_all_modules -f '_cs|b43' '/net/wireless/|/net/ieee80211/|/net/mac80211/'
|
||||
if [[ "$(uname -m)" == "x86_64" ]]; then
|
||||
|
|
Loading…
Reference in a new issue