From: Hugo Villeneuve Date: Fri, 3 Oct 2014 02:31:23 +0000 (-0400) Subject: Remove /tools and /cross-tools links on host system X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=e3cea905616f1775d6be858bb65687373315c9c0;p=hvlinux.git Remove /tools and /cross-tools links on host system --- diff --git a/TODO b/TODO index 142f98c..525bfaa 100644 --- a/TODO +++ b/TODO @@ -73,4 +73,3 @@ du fichier sysinfos). Faire un script de test (tester la présence de certains programmes à la toute fin de l'installation (ou dans chaque script d'installation) -Éliminer les liens /tools et /cross-tools diff --git a/functions/main b/functions/main index 038b99d..4af62ad 100644 --- a/functions/main +++ b/functions/main @@ -62,6 +62,9 @@ fi CLFS=${LFS} +CROSS_TOOLS_DIR=${CLFS}/cross-tools +TOOLS_DIR=${CLFS}/tools + # Load functions source ../functions/fpkg source ../functions/lpkg diff --git a/stage0/hv-install-2 b/stage0/hv-install-2 index 7b7f32e..5c9d66b 100755 --- a/stage0/hv-install-2 +++ b/stage0/hv-install-2 @@ -20,25 +20,25 @@ ipkg ${GMP} "\ --enable-cxx \ --disable-static" -export LDFLAGS="-Wl,-rpath,/cross-tools/lib" +export LDFLAGS="-Wl,-rpath,${CROSS_TOOLS_DIR}/lib" ipkg ${MPFR} "\ --disable-static \ - --with-gmp=/cross-tools" + --with-gmp=${CROSS_TOOLS_DIR}" ipkg ${MPC} "\ --disable-static \ - --with-gmp=/cross-tools \ - --with-mpfr=/cross-tools" + --with-gmp=${CROSS_TOOLS_DIR} \ + --with-mpfr=${CROSS_TOOLS_DIR}" ipkg ${ISL} "\ --disable-static \ - --with-gmp-prefix=/cross-tools" + --with-gmp-prefix=${CROSS_TOOLS_DIR}" ipkg ${CLOOG} "\ --disable-static \ --with-bits=gmp \ - --with-gmp-prefix=/cross-tools" + --with-gmp-prefix=${CROSS_TOOLS_DIR}" LDFLAGS="" diff --git a/stage0/ipkg.def b/stage0/ipkg.def index 312982d..d846cee 100644 --- a/stage0/ipkg.def +++ b/stage0/ipkg.def @@ -4,5 +4,5 @@ export BUILD64="-m64" # Setting default configure options for all scripts CONFIGURE_OPTS="\ - --prefix=/cross-tools \ + --prefix=${CROSS_TOOLS_DIR} \ ${CONFIGURE_OPTS}" diff --git a/stage0/pkg/binutils b/stage0/pkg/binutils index 40c8270..2653b0d 100644 --- a/stage0/pkg/binutils +++ b/stage0/pkg/binutils @@ -8,7 +8,8 @@ hvconfig_pre() # --with-lib-path: # Set to dummy (non-existent) directory to prevent having # host directories list. - CONFIGURE_OPTS+=" \ + CONFIGURE_OPTS=" \ + --prefix=/cross-tools \ --host=${CLFS_HOST} \ --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} \ @@ -30,6 +31,12 @@ hvconfig_pre() esac } +hvbuild() +{ + ${HVMAKE} + ${HVMAKE} install DESTDIR=${CLFS} +} + hvconfig_post() { unset AR diff --git a/stage0/pkg/gcc b/stage0/pkg/gcc index ed373ac..70f69c7 100644 --- a/stage0/pkg/gcc +++ b/stage0/pkg/gcc @@ -3,7 +3,7 @@ hvconfig_pre() { export AR=ar - export LDFLAGS="-Wl,-rpath,/cross-tools/lib" + export LDFLAGS="-Wl,-rpath,${CROSS_TOOLS_DIR}/lib" # Common options for passes 1 & 2 # --with-local-prefix: @@ -19,19 +19,20 @@ hvconfig_pre() # --with-native-system-header-dir=/tools/include # then GCC will search for system headers in: # /opt/toolchain/tools/include - CONFIGURE_OPTS+=" \ + CONFIGURE_OPTS=" \ + --prefix=/cross-tools \ --build=${CLFS_HOST} \ --host=${CLFS_HOST} \ --target=${CLFS_TARGET} \ --with-sysroot=${CLFS} \ - --with-local-prefix=/tools \ + --with-local-prefix=${TOOLS_DIR} \ --with-native-system-header-dir=/tools/include \ --disable-nls \ - --with-mpfr=/cross-tools \ - --with-gmp=/cross-tools \ - --with-isl=/cross-tools \ - --with-cloog=/cross-tools \ - --with-mpc=/cross-tools + --with-mpfr=${CROSS_TOOLS_DIR} \ + --with-gmp=${CROSS_TOOLS_DIR} \ + --with-isl=${CROSS_TOOLS_DIR} \ + --with-cloog=${CROSS_TOOLS_DIR} \ + --with-mpc=${CROSS_TOOLS_DIR} --with-system-zlib \ --enable-checking=release \ --disable-multilib" @@ -61,8 +62,8 @@ hvconfig_pre() # We will create a dummy limits.h so the build will not use the one # provided by the host distro: - mkdir -p /tools/include - touch /tools/include/limits.h + mkdir -p ${TOOLS_DIR}/include + touch ${TOOLS_DIR}/include/limits.h else CONFIGURE_OPTS+=" \ --enable-shared \ @@ -97,11 +98,11 @@ hvbuild() { if [ "x${HVLABEL}" = "x${GCC}-pass1" ]; then ${HVMAKE} all-gcc all-target-libgcc - ${HVMAKE} install-gcc install-target-libgcc + ${HVMAKE} install-gcc install-target-libgcc DESTDIR=${CLFS} else ${HVMAKE} \ AS_FOR_TARGET="${CLFS_TARGET}-as" \ LD_FOR_TARGET="${CLFS_TARGET}-ld" - ${HVMAKE} install + ${HVMAKE} install DESTDIR=${CLFS} fi } diff --git a/stage0/pkg/glibc b/stage0/pkg/glibc index d31ab21..acf6b5a 100644 --- a/stage0/pkg/glibc +++ b/stage0/pkg/glibc @@ -20,9 +20,9 @@ hvconfig_pre() --with-tls \ --enable-kernel=$(get_pkg_ver3 ${KERNEL}) \ --with-__thread \ - --with-binutils=/cross-tools/bin \ + --with-binutils=${CROSS_TOOLS_DIR}/bin \ --enable-obsolete-rpc \ - --with-headers=/tools/include" + --with-headers=${TOOLS_DIR}/include" } # For Glibc to support NPTL: @@ -36,6 +36,12 @@ libc_cv_ssp=no EOF } +hvbuild() +{ + ${HVMAKE} + ${HVMAKE} install install_root=${CLFS} +} + hvconfig_post() { unset BUILD_CC diff --git a/stage0/pkg/linux b/stage0/pkg/linux index 1107e1b..19781c7 100644 --- a/stage0/pkg/linux +++ b/stage0/pkg/linux @@ -6,6 +6,6 @@ hvbuild() ${HVMAKE} mrproper ${HVMAKE} ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=dest headers_install - install -dv /tools/include - cp -rv dest/include/* /tools/include + install -dv ${TOOLS_DIR}/include + cp -rv dest/include/* ${TOOLS_DIR}/include } diff --git a/stage0/pkg/ncurses b/stage0/pkg/ncurses index b2126bc..0732883 100644 --- a/stage0/pkg/ncurses +++ b/stage0/pkg/ncurses @@ -14,5 +14,5 @@ hvbuid() ${HVMAKE} -C progs tic # Install tic - install -v -m755 progs/tic /cross-tools/bin + install -v -m755 progs/tic ${CROSS_TOOLS_DIR}/bin } diff --git a/stage0/pre-install b/stage0/pre-install index 5ff17d2..0d72afd 100755 --- a/stage0/pre-install +++ b/stage0/pre-install @@ -30,17 +30,12 @@ done chown -R lfs:lfs ${LFS} -# Creating a link from the host root directory to LFS cross-tools directories -for subdir in tools cross-tools; do - ln -sfvT ${LFS}/${subdir} /${subdir} -done - cat > /home/lfs/.bashrc << "EOF" # Setting up the environment set +h umask 022 LC_ALL=POSIX -PATH=/cross-tools/bin:/bin:/usr/bin +PATH=_CLFS_CROSS_TOOLS_PATH_/bin:/bin:/usr/bin HVMAKE="make -j ${MAKEJOBS}" unset CFLAGS @@ -49,6 +44,8 @@ unset CXXFLAGS export LC_ALL PATH HVMAKE EOF +sed -e "s@_CLFS_CROSS_TOOLS_PATH_@${CROSS_TOOLS_DIR}@" -i /home/lfs/.bashrc + chown lfs:lfs /home/lfs/.bashrc exit $?