-
-
Save haryx8/25bbf3f1fbdede8946a6984991fbb576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@@@@@@ | |
@ LFS @ | |
@@@@@@@ | |
apt-get install gawk | |
apt-get install bison | |
apt-get install texinfo | |
# create boot partition 100MB ext2 | |
# create system partition 9900MB ext4 | |
export LFS=/mnt/lfs | |
mkdir -pv $LFS | |
mount -v -t ext4 /dev/<xxx> $LFS | |
mkdir -v $LFS/sources | |
chmod -v a+wt $LFS/sources | |
wget http://linuxfromscratch.org/lfs/view/stable/wget-list | |
wget --input-file=wget-list --continue --directory-prefix=$LFS/sources | |
pushd $LFS/sources | |
wget http://linuxfromscratch.org/lfs/view/stable/md5sums | |
md5sum -c md5sums | |
popdud | |
mkdir -v $LFS/tools | |
ln -sv $LFS/tools / | |
groupadd lfs | |
useradd -s /bin/bash -g lfs -m -k /dev/null lfs | |
passwd lfs | |
chown -v lfs $LFS/tools | |
chown -v lfs $LFS/sources | |
su - lfs | |
export LFS=/mnt/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=/tools/bin:/bin:/usr/bin | |
export LFS LC_ALL LFS_TGT PATH | |
EOF | |
source ~/.bash_profile | |
dpkg-reconfigure dash | |
cd $LFS/sources | |
tar -xfv binutils...xxx | |
cd binutils...xxx | |
mkdir -v build | |
cd build | |
case $(uname -m) in | |
x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; | |
esac | |
../configure --prefix=/tools \ | |
--with-sysroot=$LFS \ | |
--with-lib-path=/tools/lib \ | |
--target=$LFS_TGT \ | |
--disable-nls \ | |
--disable-werror | |
make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment