summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsetup_env.sh36
1 files changed, 34 insertions, 2 deletions
diff --git a/setup_env.sh b/setup_env.sh
index 986b5ca..85a5ad8 100755
--- a/setup_env.sh
+++ b/setup_env.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# Script to setup the LinHES development enviroment
-# ./setup_env.sh ( i586|i686|x86_64 )
+# ./setup_env.sh ( i586|i686|x86_64 ) devID
# This script assumes that /tmp is usable.
MIRROR_DIR=../pkg_repo
@@ -17,8 +17,23 @@ case $1 in
exit 1
;;
esac
+
+if [ ! x$2 = x ]
+then
+ #check if developer template is present
+ if [ -d templates/developers/$2 ]
+ then
+ echo "found the template for $2 "
+ FOUNDTEMPLATE="TRUE"
+ else
+ echo "couldn't find templates/developers/$2"
+ exit 2
+ fi
+fi
+
}
+
function pacman_check {
which pacman
status=$?
@@ -32,7 +47,7 @@ function pacman_check {
#-----------------------------------------------
-arg_check $1
+arg_check $1 $2
pacman_check
@@ -69,6 +84,22 @@ fi
#clear out the default resolve.con
mv -f ../build_root.$ARCH/etc/resolv.conf ../build_root.$ARCH/etc/resolv.conf.orig
+if [ x$FOUNDTEMPLATE = xTRUE ]
+then
+ #check for login run
+ if [ -f templates/developers/$2/loginrun.sh ]
+ then
+ cp -f templates/developers/$2/loginrun.sh ../build_root.$ARCH/root/loginrun.sh
+ fi
+
+ if [ -f templates/developers/$2/custom_chroot.sh ]
+ then
+ cd templates/developers/$2
+ ./custom_chroot.sh $ARCH
+ cd -
+ fi
+fi
+
#create custom enter_dev_chroot.sh script
sed -e "s/REPLACEME/$ARCH/g" templates/enter_dev_chroot.sh > ../enter_dev_chroot.$ARCH.sh
chmod 755 ../enter_dev_chroot.$ARCH.sh
@@ -78,6 +109,7 @@ echo "** cd .. **"
echo "** ./enter_dev_chroot.$ARCH.sh **"
echo "********************************************************"
+
#copy makepkg.conf into the chroot
sed -e "s/i686/$ARCH/g" templates/makepkg.conf > ../build_root.$ARCH/etc/makepkg.conf
#copy pacman.conf into the chroot