mirror of
https://github.com/luisgbm/lfs-scripts.git
synced 2026-03-10 04:41:10 +00:00
Updating all scripts, instructions and screenshots for LFS 11.0
This commit is contained in:
parent
bbf422af1b
commit
b5c078a5c9
11 changed files with 85902 additions and 78893 deletions
148
lfs-cross.sh
148
lfs-cross.sh
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
# LFS 10.0 Build Script
|
||||
# LFS 11.0 Build Script
|
||||
# Builds the cross-toolchain and cross compiling temporary tools from chapters 5 and 6
|
||||
# by Luís Mendes :)
|
||||
# 14/09/2020
|
||||
# 08/Sep/2021
|
||||
|
||||
package_name=""
|
||||
package_ext=""
|
||||
|
|
@ -10,39 +10,43 @@ package_ext=""
|
|||
begin() {
|
||||
package_name=$1
|
||||
package_ext=$2
|
||||
|
||||
|
||||
echo "[lfs-scripts] Starting build of $package_name at $(date)"
|
||||
|
||||
tar xf $package_name.$package_ext
|
||||
cd $package_name
|
||||
}
|
||||
|
||||
finish() {
|
||||
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
|
||||
|
||||
cd $LFS/sources
|
||||
rm -rf $package_name
|
||||
}
|
||||
|
||||
cd $LFS/sources
|
||||
|
||||
# 5.2. Binutils-2.35 - Pass 1
|
||||
begin binutils-2.35 tar.xz
|
||||
# 5.2. Binutils-2.37 - Pass 1
|
||||
begin binutils-2.37 tar.xz
|
||||
mkdir -v build
|
||||
cd build
|
||||
../configure --prefix=$LFS/tools \
|
||||
--with-sysroot=$LFS \
|
||||
--target=$LFS_TGT \
|
||||
--disable-nls \
|
||||
cd build
|
||||
../configure --prefix=$LFS/tools \
|
||||
--with-sysroot=$LFS \
|
||||
--target=$LFS_TGT \
|
||||
--disable-nls \
|
||||
--disable-werror
|
||||
make
|
||||
make install
|
||||
make install -j1
|
||||
finish
|
||||
|
||||
# 5.3. GCC-10.2.0 - Pass 1
|
||||
begin gcc-10.2.0 tar.xz
|
||||
# 5.3. GCC-11.2.0 - Pass 1
|
||||
begin gcc-11.2.0 tar.xz
|
||||
tar -xf ../mpfr-4.1.0.tar.xz
|
||||
mv -v mpfr-4.1.0 mpfr
|
||||
tar -xf ../gmp-6.2.0.tar.xz
|
||||
mv -v gmp-6.2.0 gmp
|
||||
tar -xf ../mpc-1.1.0.tar.gz
|
||||
mv -v mpc-1.1.0 mpc
|
||||
tar -xf ../gmp-6.2.1.tar.xz
|
||||
mv -v gmp-6.2.1 gmp
|
||||
tar -xf ../mpc-1.2.1.tar.gz
|
||||
mv -v mpc-1.2.1 mpc
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
sed -e '/m64=/s/lib64/lib/' \
|
||||
|
|
@ -78,8 +82,8 @@ cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
|
|||
`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h
|
||||
finish
|
||||
|
||||
# 5.4. Linux-5.8.3 API Headers
|
||||
begin linux-5.8.3 tar.xz
|
||||
# 5.4. Linux-5.13.12 API Headers
|
||||
begin linux-5.13.12 tar.xz
|
||||
make mrproper
|
||||
make headers
|
||||
find usr/include -name '.*' -delete
|
||||
|
|
@ -87,8 +91,8 @@ rm usr/include/Makefile
|
|||
cp -rv usr/include $LFS/usr
|
||||
finish
|
||||
|
||||
# 5.5. Glibc-2.32
|
||||
begin glibc-2.32 tar.xz
|
||||
# 5.5. Glibc-2.34
|
||||
begin glibc-2.34 tar.xz
|
||||
case $(uname -m) in
|
||||
i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
|
||||
;;
|
||||
|
|
@ -96,27 +100,29 @@ case $(uname -m) in
|
|||
ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
|
||||
;;
|
||||
esac
|
||||
patch -Np1 -i ../glibc-2.32-fhs-1.patch
|
||||
patch -Np1 -i ../glibc-2.34-fhs-1.patch
|
||||
mkdir -v build
|
||||
cd build
|
||||
echo "rootsbindir=/usr/sbin" > configparms
|
||||
../configure \
|
||||
--prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
--build=$(../scripts/config.guess) \
|
||||
--enable-kernel=3.2 \
|
||||
--with-headers=$LFS/usr/include \
|
||||
libc_cv_slibdir=/lib
|
||||
libc_cv_slibdir=/usr/lib
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd
|
||||
echo 'int main(){}' > dummy.c
|
||||
$LFS_TGT-gcc dummy.c
|
||||
readelf -l a.out | grep '/ld-linux'
|
||||
rm -v dummy.c a.out
|
||||
$LFS/tools/libexec/gcc/$LFS_TGT/10.2.0/install-tools/mkheaders
|
||||
$LFS/tools/libexec/gcc/$LFS_TGT/11.2.0/install-tools/mkheaders
|
||||
finish
|
||||
|
||||
# 5.6. Libstdc++ from GCC-10.2.0, Pass 1
|
||||
begin gcc-10.2.0 tar.xz
|
||||
# 5.6. Libstdc++ from GCC-11.2.0, Pass 1
|
||||
begin gcc-11.2.0 tar.xz
|
||||
mkdir -v build
|
||||
cd build
|
||||
../libstdc++-v3/configure \
|
||||
|
|
@ -126,15 +132,13 @@ cd build
|
|||
--disable-multilib \
|
||||
--disable-nls \
|
||||
--disable-libstdcxx-pch \
|
||||
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/10.2.0
|
||||
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/11.2.0
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
||||
# 6.2. M4-1.4.18
|
||||
begin m4-1.4.18 tar.xz
|
||||
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
|
||||
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
|
||||
# 6.2. M4-1.4.19
|
||||
begin m4-1.4.19 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
--build=$(build-aux/config.guess)
|
||||
|
|
@ -164,19 +168,16 @@ popd
|
|||
make
|
||||
make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
|
||||
echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so
|
||||
mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib
|
||||
ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so
|
||||
finish
|
||||
|
||||
# 6.4. Bash-5.0
|
||||
begin bash-5.0 tar.gz
|
||||
# 6.4. Bash-5.1.8
|
||||
begin bash-5.1.8 tar.gz
|
||||
./configure --prefix=/usr \
|
||||
--build=$(support/config.guess) \
|
||||
--host=$LFS_TGT \
|
||||
--without-bash-malloc
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
mv $LFS/usr/bin/bash $LFS/bin/bash
|
||||
ln -sv bash $LFS/bin/sh
|
||||
finish
|
||||
|
||||
|
|
@ -189,39 +190,42 @@ begin coreutils-8.32 tar.xz
|
|||
--enable-no-install-program=kill,uptime
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin
|
||||
mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} $LFS/bin
|
||||
mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname} $LFS/bin
|
||||
mv -v $LFS/usr/bin/{head,nice,sleep,touch} $LFS/bin
|
||||
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
|
||||
mkdir -pv $LFS/usr/share/man/man8
|
||||
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
|
||||
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
|
||||
finish
|
||||
|
||||
# 6.6. Diffutils-3.7
|
||||
begin diffutils-3.7 tar.xz
|
||||
# 6.6. Diffutils-3.8
|
||||
begin diffutils-3.8 tar.xz
|
||||
./configure --prefix=/usr --host=$LFS_TGT
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
||||
# 6.7. File-5.39
|
||||
begin file-5.39 tar.gz
|
||||
./configure --prefix=/usr --host=$LFS_TGT
|
||||
make
|
||||
# 6.7. File-5.40
|
||||
begin file-5.40 tar.gz
|
||||
mkdir build
|
||||
pushd build
|
||||
../configure --disable-bzlib \
|
||||
--disable-libseccomp \
|
||||
--disable-xzlib \
|
||||
--disable-zlib
|
||||
make
|
||||
popd
|
||||
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)
|
||||
make FILE_COMPILE=$(pwd)/build/src/file
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
||||
# 6.8. Findutils-4.7.0
|
||||
begin findutils-4.7.0 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
# 6.8. Findutils-4.8.0
|
||||
begin findutils-4.8.0 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--localstatedir=/var/lib/locate \
|
||||
--host=$LFS_TGT \
|
||||
--build=$(build-aux/config.guess)
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
mv -v $LFS/usr/bin/find $LFS/bin
|
||||
sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb
|
||||
finish
|
||||
|
||||
# 6.9. Gawk-5.1.0
|
||||
|
|
@ -234,11 +238,10 @@ make
|
|||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
||||
# 6.10. Grep-3.4
|
||||
begin grep-3.4 tar.xz
|
||||
# 6.10. Grep-3.7
|
||||
begin grep-3.7 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
--bindir=/bin
|
||||
--host=$LFS_TGT
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
|
@ -248,7 +251,6 @@ begin gzip-1.10 tar.xz
|
|||
./configure --prefix=/usr --host=$LFS_TGT
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
mv -v $LFS/usr/bin/gzip $LFS/bin
|
||||
finish
|
||||
|
||||
# 6.12. Make-4.3
|
||||
|
|
@ -273,18 +275,16 @@ finish
|
|||
# 6.14. Sed-4.8
|
||||
begin sed-4.8 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
--bindir=/bin
|
||||
--host=$LFS_TGT
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
||||
# 6.15. Tar-1.32
|
||||
begin tar-1.32 tar.xz
|
||||
# 6.15. Tar-1.34
|
||||
begin tar-1.34 tar.xz
|
||||
./configure --prefix=/usr \
|
||||
--host=$LFS_TGT \
|
||||
--build=$(build-aux/config.guess) \
|
||||
--bindir=/bin
|
||||
--build=$(build-aux/config.guess)
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
finish
|
||||
|
|
@ -298,13 +298,10 @@ begin xz-5.2.5 tar.xz
|
|||
--docdir=/usr/share/doc/xz-5.2.5
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
mv -v $LFS/usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} $LFS/bin
|
||||
mv -v $LFS/usr/lib/liblzma.so.* $LFS/lib
|
||||
ln -svf ../../lib/$(readlink $LFS/usr/lib/liblzma.so) $LFS/usr/lib/liblzma.so
|
||||
finish
|
||||
|
||||
# 6.17. Binutils-2.35 - Pass 2
|
||||
begin binutils-2.35 tar.xz
|
||||
# 6.17. Binutils-2.37 - Pass 2
|
||||
begin binutils-2.37 tar.xz
|
||||
mkdir -v build
|
||||
cd build
|
||||
../configure \
|
||||
|
|
@ -316,17 +313,18 @@ cd build
|
|||
--disable-werror \
|
||||
--enable-64-bit-bfd
|
||||
make
|
||||
make DESTDIR=$LFS install
|
||||
make DESTDIR=$LFS install -j1
|
||||
install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib
|
||||
finish
|
||||
|
||||
# 6.18. GCC-10.2.0 - Pass 2
|
||||
begin gcc-10.2.0 tar.xz
|
||||
# 6.18. GCC-11.2.0 - Pass 2
|
||||
begin gcc-11.2.0 tar.xz
|
||||
tar -xf ../mpfr-4.1.0.tar.xz
|
||||
mv -v mpfr-4.1.0 mpfr
|
||||
tar -xf ../gmp-6.2.0.tar.xz
|
||||
mv -v gmp-6.2.0 gmp
|
||||
tar -xf ../mpc-1.1.0.tar.gz
|
||||
mv -v mpc-1.1.0 mpc
|
||||
tar -xf ../gmp-6.2.1.tar.xz
|
||||
mv -v gmp-6.2.1 gmp
|
||||
tar -xf ../mpc-1.2.1.tar.gz
|
||||
mv -v mpc-1.2.1 mpc
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue