summaryrefslogtreecommitdiff
path: root/aports/base-layout/profile
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-04-10 18:17:21 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-04-10 23:09:31 +0200
commitbcbf7c6c9fc7d8a96b1d5c4cc9247b85fe3da2ad (patch)
tree46d796182b2249408b0597485462ef1698dc4c13 /aports/base-layout/profile
parent40d2daea11738408b7bf7b60f14a558ff8c47fb0 (diff)
downloadfreebsd-wifibox-alpine-bcbf7c6c9fc7d8a96b1d5c4cc9247b85fe3da2ad.zip
Move towards custom packages.
Change the build image process in a way that custom-built packages can be utilized. This means a simpler `Makefile` since every modification is implemented on the level of packages. Include the sources for every customized package.
Diffstat (limited to 'aports/base-layout/profile')
-rw-r--r--aports/base-layout/profile45
1 files changed, 45 insertions, 0 deletions
diff --git a/aports/base-layout/profile b/aports/base-layout/profile
new file mode 100644
index 0000000..fd7506b
--- /dev/null
+++ b/aports/base-layout/profile
@@ -0,0 +1,45 @@
+# Append "$1" to $PATH when not already in.
+# Copied from Arch Linux, see #12803 for details.
+append_path () {
+ case ":$PATH:" in
+ *:"$1":*)
+ ;;
+ *)
+ PATH="${PATH:+$PATH:}$1"
+ ;;
+ esac
+}
+
+append_path "/usr/local/sbin"
+append_path "/usr/local/bin"
+append_path "/usr/sbin"
+append_path "/usr/bin"
+append_path "/sbin"
+append_path "/bin"
+unset -f append_path
+
+export PATH
+export PAGER=less
+umask 022
+
+# set up fallback default PS1
+: "${HOSTNAME:=$(hostname)}"
+PS1='${HOSTNAME%%.*}:$PWD'
+[ "$(id -u)" = "0" ] && PS1="${PS1}# "
+[ "$(id -u)" = "0" ] || PS1="${PS1}\$ "
+
+# use nicer PS1 for bash and busybox ash
+[ -n "$BASH_VERSION" -o "$BB_ASH_VERSION" ] && PS1='\h:\w\$ '
+
+# use nicer PS1 for zsh
+[ -n "$ZSH_VERSION" ] && PS1='%m:%~%# '
+
+# export PS1 as before
+export PS1
+
+for script in /etc/profile.d/*.sh ; do
+ if [ -r "$script" ] ; then
+ . "$script"
+ fi
+done
+unset script