Add missing files to static configs (#474)

This commit is contained in:
Itxaka
2023-10-09 14:39:19 +02:00
committed by GitHub
parent f03b865bc1
commit 6cbcce95cf
3 changed files with 75 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
packages:
- name: "kairos-overlay-files"
category: "static"
version: "1.0.14"
version: "1.1.0"

View File

@@ -0,0 +1,10 @@
# https://www.raspberrypi.com/documentation/computers/config_txt.html
# https://emteria.com/kb/connect-uart-rpi
# https://www.raspberrypi.com/documentation/computers/config_txt.html
enable_uart=1
uart_2ndstage=1
# Disabling bluetooth might change the serial device:
# https://raspberrypi.stackexchange.com/a/69721
# On rpi4, if bluetooth is not disabled (like here), the device is /dev/ttyS0
#dtoverlay=disable-bt

View File

@@ -0,0 +1,64 @@
function setSelinux {
source (loop0)/etc/os-release
set baseSelinuxCmd=""
if regexp "rockylinux|fedora|almalinux|redhat" $KAIROS_FLAVOR; then
set baseSelinuxCmd="selinux=0"
else
# if not in recovery
if [ -z "$recoverylabel" ];then
set baseSelinuxCmd="security=selinux selinux=1"
fi
fi
}
function setExtraConsole {
source (loop0)/etc/os-release
set baseExtraConsole="console=ttyS0"
# rpi
if regexp "arm-rpi" $KAIROS_FLAVOR; then
set baseExtraConsole="console=ttyS0,115200"
fi
# nvidia orin
if regexp "arm-nvidia-jetson-agx-orin" $KAIROS_FLAVOR; then
set baseExtraConsole="console=ttyTCU0,115200"
fi
}
function setExtraArgs {
source (loop0)/etc/os-release
set baseExtraArgs=""
# rpi
if regexp "arm-rpi" $KAIROS_FLAVOR; then
set baseExtraArgs="modprobe.blacklist=vc4 8250.nr_uarts=1"
fi
}
function setKernelCmd {
# At this point we have the system mounted under (loop0)
#
# baseCmd -> Shared between all entries
# baseRootCmd -> specific bits that immucore uses to mount the boot devices and identify the image to mount
# baseSelinuxCmd -> selinux enabled/disabled
# baseExtraConsole -> extra console to set
# baseExtraArgs -> extra needed args
set baseCmd="console=tty1 net.ifnames=1 rd.cos.oemlabel=COS_OEM rd.cos.oemtimeout=10 panic=5 rd.emergency=reboot rd.shell=0 systemd.crash_reboot=yes"
if [ -n "$recoverylabel" ]; then
set baseRootCmd="root=live:LABEL=$recoverylabel rd.live.dir=/ rd.live.squashimg=$img"
else
set baseRootCmd="root=LABEL=$label cos-img/filename=$img"
fi
setSelinux
setExtraConsole
setExtraArgs
# finally set the full cmdline
set kernelcmd="$baseCmd $baseRootCmd $baseSelinuxCmd $baseExtraConsole $baseExtraArgs"
}
# grub.cfg now ships this but during upgrades we do not update the COS_GRUB partition, so no new grub.cfg is copied over there
# We need to keep it for upgrades to work.
# TODO: Deprecate in v2.8-v3.0
set kernel=/boot/vmlinuz
set initramfs=/boot/initrd
# set the kernelcmd dynamically
setKernelCmd