From a0d46a15ca75492c3fd872e89d991a88c45511a8 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 7 Sep 2026 01:15:37 +0000 Subject: [PATCH] Provide user skeleton directory to symlink into. --- _lib.sh | 8 ++++++++ backlight.py => home_user/.local/bin/backlight | 0 start_home.sh | 11 ----------- start_root.sh | 4 +--- start_user.sh | 11 +++++++++++ 5 files changed, 20 insertions(+), 14 deletions(-) rename backlight.py => home_user/.local/bin/backlight (100%) delete mode 100755 start_home.sh create mode 100755 start_user.sh diff --git a/_lib.sh b/_lib.sh index c7002c6..a4759dc 100644 --- a/_lib.sh +++ b/_lib.sh @@ -3,6 +3,7 @@ SCRIPT_NAME=$0 cd "$(dirname "${SCRIPT_NAME}")" # constants unlikely to change +FNAME_PROFILE=.profile NAME_DEV=dev PATH_DEV="/${NAME_DEV}" PATH_MNT=/mnt @@ -14,6 +15,9 @@ NAME_LUKSVG=cryptolvm NAME_SWAP=swap PATH_MNT_ROOT="${PATH_MNT}/root" +# constants derived from changeables +PATH_PROFILE="${HOME}/${FNAME_PROFILE}" + # path constructors path_luks_mapper() { printf '%s/mapper/%s' "${PATH_DEV}" "$1" @@ -151,3 +155,7 @@ usage() { [ "${COUNT_INPUTS}" -eq $# ]\ || die "${MSG}" } +augment_profile() { + msg 'Augmenting user %s …' "${FNAME_PROFILE}" + echo 'alias ls="ls --color=auto"' >> "${PATH_PROFILE}" +} diff --git a/backlight.py b/home_user/.local/bin/backlight similarity index 100% rename from backlight.py rename to home_user/.local/bin/backlight diff --git a/start_home.sh b/start_home.sh deleted file mode 100755 index 9eaf55e..0000000 --- a/start_home.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_lib.sh" - -# constants unlikely to change -FNAME_PROFILE=.profile - -# constants derived from changeables -PATH_PROFILE="${HOME}/${FNAME_PROFILE}" - -msg 'Augmenting user %s …' "${FNAME_PROFILE}" -echo 'alias ls="ls --color=auto"' >> "${PATH_PROFILE}" diff --git a/start_root.sh b/start_root.sh index 9508222..f51d169 100755 --- a/start_root.sh +++ b/start_root.sh @@ -2,7 +2,6 @@ . "$(dirname "$0")/_lib.sh" # constants unlikely to change -FNAME_START_HOME=start_home.sh PATH_DEFAULT_LOCALE=/etc/default/locale PATH_SYSCTL_PRINTK=/etc/sysctl.d/60-printk-console.conf PATH_TLP_THRESH_CONF=/etc/tlp.conf.d/60-thresholds.conf @@ -17,8 +16,7 @@ PRINTK_LEVELS="4 4 1 7" TLP_THRESH_START=40 TLP_THRESH_STOP=80 -msg 'Calling %s …' "${FNAME_START_HOME}" -"./${FNAME_START_HOME}" +augment_profile msg 'Ensuring packages: %s' "${TO_INSTALL}" apt-get -y update diff --git a/start_user.sh b/start_user.sh new file mode 100755 index 0000000..df49b1b --- /dev/null +++ b/start_user.sh @@ -0,0 +1,11 @@ +#!/bin/sh +. "$(dirname "$0")/_lib.sh" + +# constants we might want to change at some point +PATH_SKEL_USER="$(pwd)/home_user" + +augment_profile + +msg 'Linking %s files into home directory …' "${PATH_SKEL_USER}" +find "${PATH_SKEL_USER}" -mindepth 1 -maxdepth 1\ + -exec ln -v -s {} "${HOME}/" \; -- 2.30.2