microcode metapackages

This commit is contained in:
Daniel Langbein 2021-05-04 22:03:03 +02:00
parent 31d3d15fbc
commit 4f002945a7
6 changed files with 62 additions and 42 deletions

View File

@ -69,27 +69,6 @@ function get_user_input() {
fi fi
} }
function get_cpu_vendor() {
# @post
# CPU_VENDOR ("amd", "intel", "none")
if [ -z "${CPU_VENDOR}" ]; then
# if CPU_VENDOR has no value yet, ask user for input!
local vendor_id
vendor_id=$(cat /proc/cpuinfo | grep vendor_id | head -1 | sed 's|vendor_id\s*:\s*||')
if [ "$vendor_id" = "AuthenticAMD" ]; then
CPU_VENDOR="amd"
elif [ "$vendor_id" = "GenuineIntel" ]; then
CPU_VENDOR="intel"
else
echo "Unknown CPU vendor: $vendor_id"
return 1
fi
fi
}
function get_default_mount_options() { function get_default_mount_options() {
# @pre # @pre
# FS # FS
@ -155,27 +134,10 @@ function choose_mount_options() {
function run_pacstrap() { function run_pacstrap() {
# @pre # @pre
# BIOS_TYPE # BIOS_TYPE
# CPU_VENDOR
echo "Running pacstrap ..." echo "Running pacstrap ..."
PKGS=() PKGS=()
case "${CPU_VENDOR}" in
amd)
PKGS+=("${CPU_VENDOR}-ucode")
;;
intel)
PKGS+=("${CPU_VENDOR}-ucode")
;;
none)
true
;;
*)
echo "Not yet implemented!"
return 1
;;
esac
case "${BIOS_TYPE}" in case "${BIOS_TYPE}" in
uefi) uefi)
PKGS+=('de-p1st-base-efi') PKGS+=('de-p1st-base-efi')
@ -324,8 +286,6 @@ function main() {
check_network || return $? check_network || return $?
# out: BIOS_TYPE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD # out: BIOS_TYPE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD
get_user_input || return $? get_user_input || return $?
# out: CPU_VENDOR
get_cpu_vendor || return $?
# in: FS # in: FS
# out: FS_DEFAULT_MOUNT_OPTIONS # out: FS_DEFAULT_MOUNT_OPTIONS
@ -353,7 +313,7 @@ function main() {
mkdir /mnt/boot || return $? mkdir /mnt/boot || return $?
sudo mount "$BOOT_PART" /mnt/boot || return $? sudo mount "$BOOT_PART" /mnt/boot || return $?
# in: BIOS_TYPE, CPU_VENDOR # in: BIOS_TYPE
run_pacstrap || return $? run_pacstrap || return $?
# in: FS # in: FS
run_genfstab || return $? run_genfstab || return $?

View File

@ -30,4 +30,4 @@ LEAVE_MOUNTED=1
PACSTRAP_INTERACTIVE=1 PACSTRAP_INTERACTIVE=1
# TODO: additional pacman packages, e.g. # TODO: additional pacman packages, e.g.
# ADD_PKGS=('de-p1st-kernel-default') # ADD_PKGS=('de-p1st-kernel-default' 'de-p1st-ucode-amd')

View File

@ -50,3 +50,24 @@ function space_separated_to_array() {
# Without newline at last array element: https://unix.stackexchange.com/a/519917/315162 # Without newline at last array element: https://unix.stackexchange.com/a/519917/315162
readarray -d " " -t ptr2 < <(printf '%s' "$ptr") readarray -d " " -t ptr2 < <(printf '%s' "$ptr")
} }
function get_cpu_vendor() {
# @post
# CPU_VENDOR ("amd", "intel", "none")
if [ -z "${CPU_VENDOR}" ]; then
# if CPU_VENDOR has no value yet, ask user for input!
local vendor_id
vendor_id=$(cat /proc/cpuinfo | grep vendor_id | head -1 | sed 's|vendor_id\s*:\s*||')
if [ "$vendor_id" = "AuthenticAMD" ]; then
CPU_VENDOR="amd"
elif [ "$vendor_id" = "GenuineIntel" ]; then
CPU_VENDOR="intel"
else
echo "Unknown CPU vendor: $vendor_id"
return 1
fi
fi
}

View File

@ -0,0 +1,13 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_pkgname=ucode-amd
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.1
pkgrel=1
pkgdesc="AMD Microcode"
arch=('any')
url="https://codeberg.org/privacy1st/${_reponame}"
license=('MIT')
depends=('amd-ucode')
optdepends=()
provides=('de-p1st-ucode') # implicitly provides $pkgname

View File

@ -0,0 +1,13 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_pkgname=ucode-intel
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.1
pkgrel=1
pkgdesc="Intel Microcode"
arch=('any')
url="https://codeberg.org/privacy1st/${_reponame}"
license=('MIT')
depends=('intel-ucode')
optdepends=()
provides=('de-p1st-ucode') # implicitly provides $pkgname

View File

@ -0,0 +1,13 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_pkgname=ucode-placeholder
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.1
pkgrel=1
pkgdesc="Ucode placeholder, e.g. for VM installation"
arch=('any')
url="https://codeberg.org/privacy1st/${_reponame}"
license=('MIT')
depends=()
optdepends=()
provides=('de-p1st-ucode') # implicitly provides $pkgname