From b4e6540f430d8dc0b1444781400e9f7ea76efe1d Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 12 Sep 2025 00:58:20 -0300 Subject: [PATCH] distro-files: handle first boot --- distro-files/etc/rc | 8 +++++--- distro-files/usr/libexec/astral/first-boot | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 distro-files/usr/libexec/astral/first-boot diff --git a/distro-files/etc/rc b/distro-files/etc/rc index c5dec51c..27e2954e 100644 --- a/distro-files/etc/rc +++ b/distro-files/etc/rc @@ -13,11 +13,13 @@ chmod 1777 /tmp chmod 0755 /dev/pts -mkdir -p /var/log -mkdir -p /var/run - # required to be owned by root and sticky for rootless Xorg. mkdir -p /tmp/.X11-unix chmod 1777 /tmp/.X11-unix /usr/sbin/acpid + +# do first time boot configuration if needed +if [ ! -f "/var/lib/.first_boot_done" ]; then + /usr/libexec/astral/first-boot +fi diff --git a/distro-files/usr/libexec/astral/first-boot b/distro-files/usr/libexec/astral/first-boot new file mode 100755 index 00000000..dee77e74 --- /dev/null +++ b/distro-files/usr/libexec/astral/first-boot @@ -0,0 +1,19 @@ +#!/usr/bin/bash +# this file will be executed on the first boot of the system +echo first-boot: running first boot script... + +# create some directories needed in case they have not been already +echo first-boot: creating /var directories... +mkdir -p /var/log +mkdir -p /var/run +mkdir -p /var/lib + +# run post install hooks +echo first-boot: running post install hooks... +xbps-reconfigure -a > /var/log/first_install_reconfigure.log + +# all done +touch /var/lib/.first_boot_done + +echo first-boot: syncing disks... +sync