]> git.mdlowis.com Git - proto/aardvark-linux.git/commitdiff
Eliminated complaints from the chroot shell. Need to fix the chroot toolchain so...
authorMike Lowis <mike.lowis@gentex.com>
Tue, 26 Jan 2016 09:08:47 +0000 (09:08 +0000)
committerMike Lowis <mike.lowis@gentex.com>
Tue, 26 Jan 2016 09:08:47 +0000 (09:08 +0000)
build.sh
config.sh
enter-chroot.sh [new file with mode: 0755]

index 9bada242e1cecfe1fcbdc7894a5a4c4c4635a22f..4853112b0175c766b6d6a3633a05efb624081715 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -43,9 +43,9 @@ if [ ! -d "$AL_TOOLS/$(uname -m)-linux-musl" ]; then
     cd "$AL"
 fi
 
-################################################################################
-## Setup the Build Environment
-################################################################################
+###############################################################################
+# Setup the Build Environment
+###############################################################################
 export CC="$(uname -m)-linux-musl-gcc"
 export CXX="$(uname -m)-linux-musl-g++"
 export AR="$(uname -m)-linux-musl-ar"
@@ -56,9 +56,9 @@ export READELF="$(uname -m)-linux-musl-readelf"
 export STRIP="$(uname -m)-linux-musl-strip"
 export LDFLAGS="--static"
 
-################################################################################
-## Setup the Build Environment
-################################################################################
+###############################################################################
+# Install the Base Packages
+###############################################################################
 
 # Install sbase
 gitclone http://git.suckless.org/sbase "$AL_SOURCES/sbase"
@@ -88,24 +88,19 @@ cp -f dot.mkshrc "$AL_ROOT/share/doc/mksh/examples"
 ln -svf mksh "$AL_ROOT/bin/sh"
 cd $AL
 
-# Install make
-fetch make-4.1.tar.gz http://ftp.gnu.org/gnu/make/ "$AL_ROOT/src/make"
-#cd "$AL_SOURCES/make"
-#if [ ! -f "$AL_ROOT/bin/make" ]; then
-#    ./configure               \
-#        --prefix="$AL_TOOLS/" \
-#        --without-guile       \
-#        --without-dmalloc     \
-#        --disable-nls         \
-#        --disable-rpath       \
-#        --disable-largefile   \
-#        --disable-job-server  \
-#        --disable-load
-#    make -j8
-#    make install
-#fi
-#cd "$AL"
-
-# Install kernel sources
+###############################################################################
+# Install Sources
+###############################################################################
 fetch linux-4.4.tar.xz https://cdn.kernel.org/pub/linux/kernel/v4.x/ "$AL_ROOT/src/linux"
+fetch make-4.1.tar.gz  http://ftp.gnu.org/gnu/make/                  "$AL_ROOT/src/make"
 
+###############################################################################
+# Finalize the Chroot
+###############################################################################
+mkdir -pv "$AL_ROOT/dev"
+mkdir -pv "$AL_ROOT/proc"
+mkdir -pv "$AL_ROOT/sys"
+mkdir -pv "$AL_ROOT/tmp"
+mkdir -pv "$AL_ROOT/root"
+#mkdir -pv "$AL_ROOT/$AL_ROOT"
+#ln -svf /tools "$AL_ROOT/$AL_TOOLS"
index 423ef46bda5ba70aad4ac3978fcc7365ee46ff28..e97c8fdff753671ae184bd9f05b03a5256966348 100644 (file)
--- a/config.sh
+++ b/config.sh
@@ -22,24 +22,12 @@ export AL_TARBALLS=$AL/tarballs
 # Variable pointing to the sources directory
 export AL_SOURCES=$AL/sources
 
-
 ###############################################################################
 # Build Environment Settings
 ###############################################################################
 
 # Setup the path to use the cross-tools when they're available
 export AL_TGT=$(uname -m)-linux-musl
-export PATH=$AL_ROOT/tools/$AL_TGT/bin:$PATH
 
-#export CC=$AL_TGT-gcc
-#export CXX=$AL_TGT-g++
-#export AR=$AL_TGT-ar
-#export AS=$AL_TGT-as
-#export LD=$AL_TGT-ld
-#export RANLIB=$AL_TGT-ranlib
-#export READELF=$AL_TGT-readelf
-#export STRIP=$AL_TGT-strip
 #
-#export CFLAGS="-static"
-#export LDFLAGS="-static"
-
+export PATH=$AL_ROOT/tools/$AL_TGT/bin:$PATH
diff --git a/enter-chroot.sh b/enter-chroot.sh
new file mode 100755 (executable)
index 0000000..c11712c
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Load the config file
+. ./config.sh
+
+# Mount virtual filesystems
+mount -t proc proc "$AL_ROOT/proc"
+mount --rbind /sys "$AL_ROOT/sys"
+mount --make-rslave "$AL_ROOT/sys"
+mount --rbind /dev "$AL_ROOT/dev"
+mount --make-rslave "$AL_ROOT/dev"
+
+# Setup env variables
+export PATH=/bin:/tools/$AL_TGT/bin
+
+# Enter the chroot
+chroot "$AL_ROOT" /bin/sh
+
+# Cleanup afterwards
+umount -l "$AL_ROOT/proc"
+umount -l "$AL_ROOT/sys"
+umount -l "$AL_ROOT/dev"
+