Set a safe date on initrafms (#962)

This commit is contained in:
Itxaka 2024-07-15 09:33:40 +02:00 committed by GitHub
parent 200042f5bf
commit b7c07c0bb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 14 deletions

View File

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

View File

@ -0,0 +1,22 @@
#cloud-config
name: "RPI configs"
stages:
initramfs.before:
# set a safe "near" date as default for rpi + alpine without rtc clock as otherwise
# the swclock doesnt work as expected and we create a lot of files with their dates at unix epoch
# which can lead to wrong calculations (days since login for example)
# later in the boot process ntpd or other software clocks will trigger and update the date
- name: "Set a safe date before user creation for RPI without hardware clocks"
if: '[ -f "/sbin/openrc" ] && [ -f "/proc/device-tree/model" ] && grep -i "Raspberry Pi" "/proc/device-tree/model"'
commands:
- date -s "2006-08-14 02:34:56-06:00"
rootfs.after:
# Automatically expand persistent partition on Raspberry Pi 4
- if: '[ ! -f /run/cos/recovery_mode ] && [ ! -f /run/cos/live_mode ] && [ -f "/sys/firmware/devicetree/base/model" ] && grep -i "Raspberry Pi 4" "/sys/firmware/devicetree/base/model"'
name: "Grow persistent"
layout:
device:
label: COS_PERSISTENT
expand_partition:
# Size 0 is required to specify all remaining space
size: 0

View File

@ -1,13 +0,0 @@
#cloud-config
stages:
rootfs.after:
# Automatically expand persistent partition on Raspberry Pi 4
- if: '[ ! -f /run/cos/recovery_mode ] && [ ! -f /run/cos/live_mode ] && [ -f "/sys/firmware/devicetree/base/model" ] && grep -i "Raspberry Pi 4" "/sys/firmware/devicetree/base/model"'
name: "Grow persistent"
layout:
device:
label: COS_PERSISTENT
expand_partition:
# Size 0 is required to specify all remaining space
size: 0