Skip to content

Instantly share code, notes, and snippets.

@maestrow
Last active September 30, 2018 09:34
Show Gist options
  • Save maestrow/bf1eaee3436e733a3fd47800fba95370 to your computer and use it in GitHub Desktop.
Save maestrow/bf1eaee3436e733a3fd47800fba95370 to your computer and use it in GitHub Desktop.
Linux

http://www.linuxfromscratch.org

  • Change root password in Windows 10 WSL: sudo passwd
  • Extract tar: tar -xf --directory ./destination/dir
  • Problem: bash: !/dir: event not found. Solution: You can turn off history substitution using set +H. See below Env script.

Preparations

Host System Requirements

./version-check.sh

Sources

wget http://www.linuxfromscratch.org/lfs/view/development/wget-list
mkdir -v $LFS/sources
chmod -v a+wt $LFS/sources
wget --input-file=wget-list --continue --directory-prefix=$LFS/sources
pushd $LFS/sources
md5sum -c md5sums
popd

Add user

groupadd lfs
useradd -s /bin/bash -g lfs -m -k /dev/null lfs

$LFS variable

export LFS=/mnt/lfs
echo $LFS

Env

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

Create tools dir

mkdir -v $LFS/tools
ln -sv $LFS/tools /

X is missing on your system

При выполнении make могут возникать ошибки из-за отсутствия в системе определенных пакетов. Такие сообщения выглядят так:

WARNING: 'flex' is missing on your system.

После чего идет сообщение об ошибке. Чтобы решить данную проблему, нужно просто установить соответствующий пакет. Например, в этом случае выполнить: sudo apt-get install flex. Затем очистить и повторить сборку: make clean && make.

Далее приведена таблица соответствия отсутствующих компонентов и соответствующий пакетов для установки:

What is missing Package to install
makeinfo texinfo
flex flex

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment