first commit from PC

This commit is contained in:
2025-07-20 13:28:12 +10:00
parent a2971879f0
commit a27c86ffe9
42 changed files with 1551 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
FROM debian
COPY cross-toolchain.sh /
RUN chmod +x cross-toolchain.sh
RUN . /cross-toolchain.sh
+49
View File
@@ -0,0 +1,49 @@
#!/bin/bash
apt-get update
apt-get upgrade -y
apt-get install -y wget
export LFS=/mnt/lfs
wget https://mirror.dogado.de/LFS/lfs-packages/lfs-packages-11.3.tar
tar xf lfs-packages-11.3.tar
mv 11.3 sources
mv sources $LFS
groupadd lfs
useradd -s /bin/bash -g lfs -m -k /dev/null lfs
passwd lfs
chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools}
case $(uname -m) in
x86_64) chown -v lfs $LFS/lib64 ;;
esac
su - lfs
cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF
cat > ~/.bashrc << "EOF"
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
export LFS LC_ALL LFS_TGT PATH CONFIG_SITE
EOF
source ~/.bash_profile
cd $LFS/sources
tar xf binutils-2.40.tar.xz
pushd binutils-2.40
mkdir -v build
cd build
../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--enable-gprofng=no \
--disable-werror
make
make install
popd