mirror of
https://codeberg.org/privacy1st/arch-installer
synced 2024-12-23 02:16:05 +01:00
refactor: avoid subshell
This commit is contained in:
parent
03e1135e4c
commit
2e3db5e3dc
@ -61,13 +61,13 @@ function get_cpu_vendor() {
|
||||
if [[ -z "${CPU_VENDOR}" ]] || [[ "${CPU_VENDOR}" == 'autodetect' ]]; then
|
||||
|
||||
# If run virtual environment (e.g. VirtualBox) then no CPU microcode is required
|
||||
if cat /proc/cpuinfo | grep '^flags.*hypervisor' >/dev/null; then
|
||||
if grep '^flags.*hypervisor' /proc/cpuinfo >/dev/null; then
|
||||
echo 'Detected virtual environment.'
|
||||
CPU_VENDOR='none'
|
||||
|
||||
else
|
||||
local vendor_id
|
||||
vendor_id=$(cat /proc/cpuinfo | grep vendor_id | head -1 | sed 's|vendor_id\s*:\s*||')
|
||||
vendor_id=$(grep vendor_id /proc/cpuinfo | head -1 | sed 's|vendor_id\s*:\s*||')
|
||||
|
||||
if [ "${vendor_id}" = 'AuthenticAMD' ]; then
|
||||
CPU_VENDOR='amd'
|
||||
|
Loading…
Reference in New Issue
Block a user