This commit is contained in:
emmett1 2018-12-02 08:19:43 +08:00
parent 81323bbf67
commit 9aa73f1877
6 changed files with 33 additions and 15 deletions

View file

@ -1,7 +1,26 @@
#!/bin/bash -e #!/bin/bash -e
if [ $(id -u) = 0 ]; then
echo "$0 script need to run as regular user!"
exit 1
fi
source $(dirname $0)/toolchain/functions source $(dirname $0)/toolchain/functions
if [ "$1" != "fetch" ]; then
if [ ! -d $LFS/tools ]; then
sudo mkdir -pv $LFS/tools
fi
if [ ! -w $LFS ]; then
sudo chown -Rv $USER:$USER $LFS
fi
if [ ! -L /tools ] || [ $(realpath /tools) != $LFS/tools ]; then
sudo ln -svf $LFS/tools /
fi
fi
for script in $(ls toolchain | grep ^[0-9]); do for script in $(ls toolchain | grep ^[0-9]); do
if [ "$1" = "fetch" ]; then if [ "$1" = "fetch" ]; then
$(dirname $0)/toolchain/$script "$1" $(dirname $0)/toolchain/$script "$1"

View file

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
if [ $(id -u) != 0 ]; then
echo "$0 script need to run as root!"
exit 1
fi
LFS=/mnt/lfs LFS=/mnt/lfs
lfs_dirs() { lfs_dirs() {

View file

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
if [ $(id -u) != 0 ]; then
echo "$0 script need to run as root!"
exit 1
fi
trap "exit 1" SIGHUP SIGINT SIGQUIT SIGTERM trap "exit 1" SIGHUP SIGINT SIGQUIT SIGTERM
LFSVERSIOM=8.3 LFSVERSIOM=8.3

View file

@ -12,7 +12,8 @@ SRC=${SRC:-$(dirname $0)/src}
NAME=gcc NAME=gcc
VERSION=${GCC_VER} VERSION=${GCC_VER}
fetch "http://www.mpfr.org/mpfr-$MPFR_VER/mpfr-$MPFR_VER.tar.xz" $SRC fetch "http://ftp.osuosl.org/pub/lfs/lfs-packages/8.3/mpfr-$MPFR_VER.tar.xz" $SRC
#fetch "http://www.mpfr.org/mpfr-$MPFR_VER/mpfr-$MPFR_VER.tar.xz" $SRC
fetch "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz" $SRC fetch "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz" $SRC
fetch "http://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.xz" $SRC fetch "http://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.xz" $SRC
fetch "http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz" $SRC fetch "http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz" $SRC

View file

@ -12,7 +12,8 @@ SRC=${SRC:-$(dirname $0)/src}
NAME=gcc NAME=gcc
VERSION=${GCC_VER} VERSION=${GCC_VER}
fetch "http://www.mpfr.org/mpfr-$MPFR_VER/mpfr-$MPFR_VER.tar.xz" $SRC fetch "http://ftp.osuosl.org/pub/lfs/lfs-packages/8.3/mpfr-$MPFR_VER.tar.xz" $SRC
#fetch "http://www.mpfr.org/mpfr-$MPFR_VER/mpfr-$MPFR_VER.tar.xz" $SRC
fetch "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz" $SRC fetch "https://ftp.gnu.org/gnu/mpc/mpc-$MPC_VER.tar.gz" $SRC
fetch "http://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.xz" $SRC fetch "http://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.xz" $SRC
fetch "http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz" $SRC fetch "http://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz" $SRC

View file

@ -34,16 +34,3 @@ fetch() {
fi fi
} }
if [ ! -d $LFS/tools ]; then
sudo mkdir -pv $LFS/tools
fi
if [ ! -w $LFS ]; then
sudo chown -Rv $USER:$USER $LFS
fi
if [ ! -L /tools ] || [ $(realpath /tools) != $LFS/tools ]; then
sudo ln -svf $LFS/tools /
fi