toolchain modoifications
[hdw-linux/hdw-linux.git] / scripts / Build-Distro
index a5c3a9a..0f0f62f 100755 (executable)
@@ -6,7 +6,7 @@
 # 
 
 # define max priority
-max=13
+max=18
 stages="0 1"
 no_src_del=""
 
@@ -80,14 +80,14 @@ for stage in $stages; do
                [ ! -d ${hdw_build_dir}/var/adm/deps ] && \
                        mkdir -p ${hdw_build_dir}/var/adm/deps/{run,build}
                # symlinking the stage 0/1 prefix to hostsystem root
-               if [ -d /$s1_prefix ]; then
-                       if [ ! -L /$s1_prefix ]; then
+               if [ -d /$tc_name ]; then
+                       if [ ! -L /$tc_name ]; then
                                echo_r "WARNING: "
-                               echo_w "move /$s1_prefix to /${s1_prefix}_old"
-                               mv /$s1_prefix /${s1_prefix}_old
+                               echo_w "move /$tc_name to /${tc_name}_old"
+                               mv /$tc_name /${tc_name}_old
                        fi
                fi
-               ln -sf $hdw_build_dir/$s1_prefix /
+               ln -sf $hdw_build_dir/$tc_name /
        fi
 
        # build according buildorder
@@ -114,7 +114,7 @@ for stage in $stages; do
                                echo_g "done, `date | awk '{ print $4 }'`"
                                # make binary tar package
                                if [ "$hdw_make_package" = "1" -a \
-                                    "$hdw_status" -ge "2" ] ; then
+                                    "$stage" -ge "2" ] ; then
                                        echo -n "creating binary package ..."
                                        if [ -d binaries/{$hdw_arch}-${hdw_arch_opt}/$package ] ; then
                                                echo -n " (deleting old first)"
@@ -199,7 +199,7 @@ for stage in $stages; do
                echo_c "preparing chroot commands ..."
                cat > $root/chroot.sh <<- EOT
 # PATH                          
-export PATH="\$PATH:/${s1_prefix}/bin:/${s1_prefix}/sbin"
+export PATH="\$PATH:/${tc_name}/bin:/${tc_name}/sbin"
 # create essential device nodes
 mknod -m 600 /dev/console c 5 1
 mknod -m 666 /dev/null c 1 3
@@ -240,15 +240,15 @@ EOT
                mount -t devpts devpts $root/dev/pts
                echo_w "entering chroot and start building now ..."
                echo
-               chroot $hdw_build_dir /${s1_prefix}/bin/env PS1='\u@\w\$ ' \
+               chroot $hdw_build_dir /${tc_name}/bin/env PS1='\u@\w\$ ' \
                        PATH="/bin:/usr/bin:/sbin:/usr/sbin" HOME=/root \
-                       /${s1_prefix}/bin/bash --login +h /chroot.sh
+                       /${tc_name}/bin/bash --login +h /chroot.sh
                if [ ! "$?" = "0" ]; then
                        echo_r "something failed in the chroot, aborting."
                        exit 1
                fi
                # remove buildorder files
-               rm -f $root/usr/src/hdw-linux/build_order*
+               rm -f $root/chroot.sh
                # last message
                echo 
                echo_w "you should now have build your hdw-linux distro"