2024-10-23 20:54:05 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
main() {
|
2024-10-25 22:00:00 +02:00
|
|
|
eal.setup.env
|
|
|
|
eal.setup.toolchain
|
2024-10-23 20:54:05 +02:00
|
|
|
}
|
|
|
|
|
2024-10-25 22:00:00 +02:00
|
|
|
function eal.setup.env() {
|
2024-10-23 20:54:05 +02:00
|
|
|
echo "The installer is about to begin setting up the environment. Please wait..."
|
|
|
|
sleep 2
|
2024-10-25 22:00:00 +02:00
|
|
|
|
|
|
|
cat > ~/.bash_profile << "EOF"
|
2024-10-23 20:54:05 +02:00
|
|
|
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
|
|
|
|
EOF
|
|
|
|
|
2024-10-25 22:00:00 +02:00
|
|
|
cat > ~/.bashrc << "EOF"
|
2024-10-23 20:54:05 +02:00
|
|
|
set +h
|
|
|
|
umask 022
|
|
|
|
LFS=/mnt/lfs
|
|
|
|
LC_ALL=POSIX
|
|
|
|
LFS_TGT=$(uname -m)-lfs-linux-gnu
|
|
|
|
PATH=/usr/bin
|
|
|
|
if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
|
|
|
|
PATH=$LFS/tools/bin:$PATH
|
|
|
|
CONFIG_SITE=$LFS/usr/share/config.site
|
2024-11-02 23:10:12 +01:00
|
|
|
MAKEFLAGS=-j$(nproc)
|
|
|
|
export LFS LC_ALL LFS_TGT PATH CONFIG_SITE MAKEFLAGS
|
2024-10-23 20:54:05 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
source ~/.bash_profile
|
|
|
|
}
|
|
|
|
|
2024-11-02 23:10:12 +01:00
|
|
|
function eal.setup.toolchain() {
|
2024-10-25 22:00:00 +02:00
|
|
|
echo -e "I: The detected system triplet is $(/usr/bin/gcc -dumpmachine)."
|
2024-11-02 23:10:12 +01:00
|
|
|
export LFS_TGT=$(/usr/bin/gcc -dumpmachine)
|
2024-10-25 22:00:00 +02:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2024-11-02 23:10:12 +01:00
|
|
|
function eal.install.cross-binutils() {
|
|
|
|
cd $LFS/sources/
|
|
|
|
echo -e "I: -- The installer is now extracting binutils --"
|
|
|
|
sleep 0.5
|
|
|
|
tar -xvf $LFS/sources/binutils-2.43.1.tar.xz
|
|
|
|
cd $LFS/sources/binutils-2.43.1/
|
|
|
|
mkdir -v build
|
|
|
|
cd build
|
|
|
|
echo -e "I: -- The installer is now configuring build options --"
|
|
|
|
sleep 0.5
|
|
|
|
../configure --prefix=$LFS/tools \
|
|
|
|
--with-sysroot=$LFS \
|
|
|
|
--target=$LFS_TGT \
|
|
|
|
--disable-nls \
|
|
|
|
--enable-gprofng=no \
|
|
|
|
--disable-werror \
|
|
|
|
--enable-new-dtags \
|
|
|
|
--enable-default-hash-style=gnu
|
|
|
|
echo -e "I: -- The installer is now compiling the package --"
|
|
|
|
make
|
|
|
|
echo -e "I: -- The installer is now installing the package --"
|
|
|
|
make install
|
|
|
|
|
|
|
|
}
|
2024-10-23 20:54:05 +02:00
|
|
|
main
|