diff --git a/main/bash/APKBUILD b/main/bash/APKBUILD
index f25bd7e9930dfec438c4d93f076168e76b38cd62..8557e6facde3b25b92824a17d68e03d2136f9315 100644
--- a/main/bash/APKBUILD
+++ b/main/bash/APKBUILD
@@ -6,7 +6,7 @@ pkgver=5.1.16
 _patchlevel=${pkgver##*.}
 _myver=${pkgver%.*}
 _patchbase=${_myver/./}
-pkgrel=0
+pkgrel=1
 pkgdesc="The GNU Bourne Again shell"
 url="https://www.gnu.org/software/bash/bash.html"
 arch="all"
@@ -16,6 +16,7 @@ makedepends_host="readline-dev>8 ncurses-dev"
 install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
 subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
 source="https://ftp.gnu.org/gnu/bash/bash-$_myver.tar.gz
+	bashrc
 	bash-noinfo.patch
 	"
 # generate url's to patches. note: no forks allowed!
@@ -25,7 +26,7 @@ while [ $_i -le $_patchlevel ]; do
 	[ $_i -ge 10 ] && _pad="0"
 	[ $_i -ge 100 ] && _pad=
 	source="$source https://ftp.gnu.org/gnu/bash/bash-$_myver-patches/bash$_patchbase-$_pad$_i"
-	_i=$(( $_i + 1))
+	_i=$(( _i + 1))
 done
 
 # secfixes:
@@ -34,6 +35,8 @@ done
 
 builddir="$srcdir/$pkgname-$_myver"
 
+export CFLAGS="$CFLAGS -DSYS_BASHRC='\"/etc/bash/bashrc\"'"
+
 prepare() {
 	# NOTE: This section is for applying the vendor patches, which are required to fix
 	# security holes.  `default_prepare` does *not* apply vendor patches in the format
@@ -78,6 +81,9 @@ check() {
 }
 
 package() {
+	mkdir -p "$pkgdir"/etc/bash
+	mv "$srcdir"/bashrc "$pkgdir"/etc/bash/bashrc
+
 	make DESTDIR="$pkgdir" install
 
 	rm -rf "$pkgdir"/usr/share/locale
@@ -92,6 +98,7 @@ dev() {
 
 sha512sums="
 c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c  bash-5.1.tar.gz
+4542e19f2c6c31fff1f412379d5e36c65767cf2d91f1311e8d43f2566e2e50ab8dddff6045aec9b0272ed7387aa9b35daf6b0844478c0bda94d961efcf6f3ae3  bashrc
 9d8845491d0fe335bdd8e9a2bd98bda54bfed2ae3c35b2196c6d5a38bdf96c4d97572ba7d6b19ab605ef4e8f001f64cf3312f87dedebb9e37a95ad2c44e33cdb  bash-noinfo.patch
 1cd86805a2639614372aec29a710bc456e330abcbbaa0867820c94f714a1fa5fb5c1b18aa2c10263ae0bce9dad7579c7af2f732282315c1c34bfd6a90777bfd2  bash51-001
 923e7822a9629645347d3aea0058fb5e2d52223507159a62369309f264612df44a84931c19e0ccb3852e98ce672dfbd454477090b4041b5a0de477c94eb61088  bash51-002
diff --git a/main/bash/bashrc b/main/bash/bashrc
new file mode 100644
index 0000000000000000000000000000000000000000..b851cf50b08e33f3da60ffa64f110e61a1aefd49
--- /dev/null
+++ b/main/bash/bashrc
@@ -0,0 +1,14 @@
+# Do not edit this file.
+# Place your readable configs in /etc/profile.d/*.sh
+
+if [[ $- != *i* ]] ; then
+	# Shell is non-interactive.  Be done now!
+	return
+fi
+
+if [ -d /etc/profile.d/ ]; then
+	for f in /etc/profile.d/*.sh; do
+		[ -r "$f" ] && . "$f"
+	done
+	unset f
+fi