Initial commit

This commit is contained in:
Windy
2021-01-10 06:38:21 -08:00
commit f4ced86d12
124 changed files with 5361 additions and 0 deletions

169
README.md Normal file
View File

@ -0,0 +1,169 @@
# Automated Linux From Scratch 10.0 (SysV)
Tested with Debian 10 Buster.
*This project is based on the Official LFS 10.0 Book*
http://lfs.mirror.fileplanet.com/lfs/view/10.0/
## Package Requirements
Add the following packages
```
sudo apt install build-essential bison gawk git htop texinfo
```
Set these Enviornment Variables
```bash
export LFS=/mnt/lfs
export ALFS=/mnt/lfs/alfs
```
## LFS Partition
| :warning: wipes the /dev/sdb drive |
| --- |
Create a new ext4 parition **/dev/sdb1** (option n) and make it bootable (option a)
```bash
sudo fdisk /dev/sdb
```
Mount new ext4 partition
```bash
sudo mkdir $LFS
sudo mount -t ext4 /dev/sdb1 $LFS
```
## Prepare Host
Grab the alfs project files
```bash
sudo git clone https://github.com/mattwind/alfs.git $ALFS
cd $ALFS
```
Verify required programs
`sudo $ALFS/version_check.sh`
Download toolchain source code from wget-list
`sudo -E $ALFS/get_packages.sh`
Setup the LFS user environment
`sudo -E $ALFS/useradd_lfs.sh`
## Build Toolchain
These scripts are required to run as the new lfs user
```bash
sudo su lfs
$ALFS/scripts/build_toolchain.sh
$ALFS/scripts/build_temp-toolchain.sh
exit
```
## Build LFS System
Run as root with environment variables set earlier
```bash
sudo -E $ALFS/scripts/build_lfs.sh
```
## Grub Bootloader
Below the warning is how I installed grub while inside the chrooted LFS system
Consider reading the LFS book for backing up your bootloader.
http://lfs.mirror.fileplanet.com/lfs/view/stable/chapter10/grub.html
| :warning: make certain you are in chroot |
| --- |
```bash
grub-install --root-directory=/ /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
```
### Grub Tweaks
Updating grub defaults
`vi /etc/default/grub`
Get friendly eth0 network names and qemu console on boot.
```bash
GRUB_TERMINAL=console
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"
```
Remember to run *grub-mkconfig* to apply new grub default settings.
```bash
grub-mkconfig
```
## Extra Scripts
Confirm that LFS and ALFS environment variables are both set and LFS partition is mounted.
Re-enter chroot and pass partition
```bash
sudo -E $ALFS/extras/chroot.sh /dev/sdb1
```
Emulate the LFS system with qemu (pass drive)
```bash
sudo -E $ALFS/extras/qemu.sh /dev/sdb
```
## Notes
The root password in the LFS chrooted system is root.
### LFS User
The lfs user on the host system can be deleted with `sudo deluser lfs` the lfs user */home/lfs* folder can also be removed. It is only required to build the first toolchain.
### Kernel Panic
This can happen if you are trying to boot from qemu and the entry for **root=/dev/???** is not **sda**
Simply edit `vi /boot/grub/grub.cfg` and change root references to sda1
```bash
root=/dev/sda1
```
When I am booting from my physical server I had to set it back to sdb1, because sda is my primary Debian installation.
```bash
root=/dev/sdb1
```
### References
*Linux From Scratch 10 Book*
http://lfs.mirror.fileplanet.com/lfs/view/10.0/
*Beyond Linux From Scrach 10 Book*
http://lfs.mirror.fileplanet.com/blfs/view/10.0/
*Added compressed single page versions to the books directory*

Binary file not shown.

Binary file not shown.

114
defaults/bashrc Normal file
View File

@ -0,0 +1,114 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${lfs_chroot:-}" ] && [ -r /etc/lfs_chroot ]; then
lfs_chroot=lfs_chroot
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${lfs_chroot:+($lfs_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${lfs_chroot:+($lfs_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${lfs_chroot:+($lfs_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
export MAKEFLAGS=-j`nproc`

33
extras/chroot.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
# Quick way to enter your LFS
# set your partition with LFS
PART=$1
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -z ${LFS} ]
then echo "LFS is not defined. example; export LFS=/mnt/lfs; sudo -E ./chroot.sh /dev/sdb1"
exit
fi
if [ -z ${PART} ]
then echo "No partition defined. example; sudo -E ./chroot.sh /dev/sdb1"
exit
fi
cd /
mount -t proc proc $LFS/proc
mount -t sysfs sys $LFS/sys
mount -o bind /dev $LFS/dev
echo lfs_chroot > $LFS/etc/lfs_chroot
chroot $LFS /bin/bash
umount $LFS/{proc,sys,dev}
rm -rf $LFS/etc/lfs_chroot
echo
echo "Exited chroot."
echo

39
extras/qemu.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
# QEMU to test LFS system
# set drive LFS is installed on
# lsusb and find bus and device number
# -usb -device usb-host,hostbus=2,hostaddr=7 \
# ssh, if you decide to go blfs
# connect from local host
# ssh username@localhost -p10022
MEMORY=1G
DRIVE=$1
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -z ${LFS} ]
then echo "LFS is not defined. example; export LFS=/mnt/lfs; sudo -E ./qemu.sh /dev/sdb"
exit
fi
if [ -z ${DRIVE} ]
then echo "No drive defined. example; sudo -E ./qemu.sh /dev/sdb"
exit
fi
qemu-system-x86_64 \
-enable-kvm \
-curses \
-net user,hostfwd=tcp::10022-:22 \
-net nic \
-m $MEMORY \
-cpu host \
-boot d \
-drive format=raw,file=$DRIVE

34
extras/xqemu.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
# QEMU to test LFS system
# set drive LFS is installed on
# lsusb and find bus and device number
# -usb -device usb-host,hostbus=2,hostaddr=7 \
# ssh, if you decide to go blfs
# connect from local host
# ssh username@localhost -p10022
MEMORY=2G
DRIVE=$1
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -z ${DRIVE} ]
then echo "no drive defined. example; sudo ./qemu.sh /dev/sdb"
exit
fi
qemu-system-x86_64 \
-enable-kvm \
-vga vmware \
-net user,hostfwd=tcp::10022-:22 \
-net nic \
-m $MEMORY \
-cpu host \
-boot d \
-drive format=raw,file=$DRIVE

22
get_packages.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Download required files from wget-list
if mount | grep $LFS > /dev/null; then
echo
echo "LFS mount found."
echo
else
echo
echo "No LFS partition found at /mnt/lfs."
echo
exit
fi
mkdir -v $LFS/sources
wget --input-file=wget-list --continue --directory-prefix=$LFS/sources
pushd $LFS/sources
md5sum -c $LFS/alfs/md5sums
popd

85
md5sums Normal file
View File

@ -0,0 +1,85 @@
007aabf1dbb550bcddde52a244cd1070 acl-2.2.53.tar.gz
bc1e5cb5c96d99b24886f1f527d3bb3d attr-2.4.48.tar.gz
50f97f4159805e374639a73e2636f22e autoconf-2.69.tar.xz
6cb234c86f3f984df29ce758e6d0d1d7 automake-1.16.2.tar.xz
2b44b47b905be16f45709648f671820b bash-5.0.tar.gz
bd6a6693f68c2ac5963127f82507716f bc-3.1.5.tar.xz
fc8d55e2f6096de8ff8171173b6f5087 binutils-2.35.tar.xz
e7c8c321351ebdf70f5f0825f3faaee2 bison-3.7.1.tar.xz
67e051268d0c475ea773822f7500d0e5 bzip2-1.0.8.tar.gz
50fcafcecde5a380415b12e9c574e0b2 check-0.15.2.tar.gz
022042695b7d5bcf1a93559a9735e668 coreutils-8.32.tar.xz
e1b07516533f351b3aba3423fafeffd6 dejagnu-1.6.2.tar.gz
4824adc0e95dbbf11dfbdfaad6a1e461 diffutils-3.7.tar.xz
cccfb706d162514e4f9dbfbc9e5d65ee e2fsprogs-1.45.6.tar.gz
23feddb1b3859b03ffdbaf53ba6bd09b elfutils-0.180.tar.bz2
dedfb1964f6098fe9320de827957331f eudev-3.2.9.tar.gz
d2384fa607223447e713e1b9bd272376 expat-2.2.9.tar.xz
00fce8de158422f5ccd2666512329bd2 expect5.45.4.tar.gz
1c450306053622803a25647d88f80f25 file-5.39.tar.gz
731356dec4b1109b812fecfddfead6b2 findutils-4.7.0.tar.xz
2882e3179748cc9f9c23ec593d6adc8d flex-2.6.4.tar.gz
8470c34eeecc41c1aa0c5d89e630df50 gawk-5.1.0.tar.xz
e9fd9b1789155ad09bcf3ae747596b50 gcc-10.2.0.tar.xz
988dc82182121c7570e0cb8b4fcd5415 gdbm-1.18.1.tar.gz
40996bbaf7d1356d3c22e33a8b255b31 gettext-0.21.tar.xz
720c7992861c57cf97d66a2f36d8d1fa glibc-2.32.tar.xz
a325e3f09e6d91e62101e59f9bda3ec1 gmp-6.2.0.tar.xz
9e251c0a618ad0824b51117d5d9db87e gperf-3.1.tar.gz
111b117d22d6a7d049d6ae7505e9c4d2 grep-3.4.tar.xz
08fb04335e2f5e73f23ea4c3adbf0c5f groff-1.22.4.tar.gz
5aaca6713b47ca2456d8324a58755ac7 grub-2.04.tar.xz
691b1221694c3394f1c537df4eee39d3 gzip-1.10.tar.xz
ff19c45f5ac800f5d77c680d9b757fbc iana-etc-20200821.tar.gz
87fef1fa3f603aef11c41dcc097af75e inetutils-1.9.4.tar.xz
12e517cac2b57a0121cda351570f1e63 intltool-0.51.0.tar.gz
e2016acc07d91b2508916c459a8435af iproute2-5.8.0.tar.xz
ac7ec9cedad48f4c279251cddc72008a kbd-2.3.0.tar.xz
3973a74786670d3062d89a827e266581 kmod-27.tar.xz
4ad4408b06d7a6626a055cb453f36819 less-551.tar.gz
ef4abcaeddc1496f7a94b72af99e243a lfs-bootscripts-20200818.tar.xz
f22cd619e04ae7b88a6a0c109b9523eb libcap-2.42.tar.xz
6313289e32f1d38a9df4770b014a2ca7 libffi-3.3.tar.gz
dad443d0911cf9f0f1bd90a334bc9004 libpipeline-1.5.3.tar.gz
1bfb9b923f2c1339b4d2ce1807064aa5 libtool-2.4.6.tar.xz
2656fe1a0942856c8740468d175e39b6 linux-5.8.3.tar.xz
730bb15d96fffe47e148d1e09235af82 m4-1.4.18.tar.xz
fc7a67ea86ace13195b0bce683fd4469 make-4.3.tar.gz
4c8721faa54a4c950c640e5e5c713fb0 man-db-2.9.3.tar.xz
ee4161cbf5ba59be7419937e063252d9 man-pages-5.08.tar.xz
9dd395356f7ec6ef40e2449fc9db3771 meson-0.55.0.tar.gz
4125404e41e482ec68282a2e687f6c73 mpc-1.1.0.tar.gz
bdd3d5efba9c17da8d83a35ec552baef mpfr-4.1.0.tar.xz
e812da327b1c2214ac1aed440ea3ae8d ncurses-6.2.tar.gz
cf1d964113a171da42a8940e7607e71a ninja-1.10.0.tar.gz
76766e98997660138cdaf13a187bd234 openssl-1.1.1g.tar.gz
78ad9937e4caadcba1526ef1853730d5 patch-2.7.6.tar.xz
3812cd9a096a72cb27767c7e2e40441c perl-5.32.0.tar.xz
f6e931e319531b736fadc017f470e68a pkg-config-0.29.2.tar.gz
e8dc8455e573bdc40b8381d572bbb89b procps-ng-3.3.16.tar.xz
573bf80e6b0de86e7f307e310098cf86 psmisc-23.3.tar.xz
35b5a3d0254c1c59be9736373d429db7 Python-3.8.5.tar.xz
2e0a549db8bef61733c37322368c815d python-3.8.5-docs-html.tar.bz2
7e6c1f16aee3244a69aba6e438295ca3 readline-8.0.tar.gz
6d906edfdb3202304059233f51f9a71d sed-4.8.tar.xz
4b05eff8a427cf50e615bda324b5bc45 shadow-4.8.1.tar.xz
c70599ab0d037fde724f7210c2c8d7f8 sysklogd-1.5.1.tar.gz
e11bc4b3eac6e6ddee7f8306230749a9 sysvinit-2.97.tar.xz
83e38700a80a26e30b2df054e69956e5 tar-1.32.tar.xz
97c55573f8520bcab74e21bfd8d0aadc tcl8.6.10-src.tar.gz
a012711241ba3a5bd4a04e833001d489 tcl8.6.10-html.tar.gz
d4c5d8cc84438c5993ec5163a59522a6 texinfo-6.7.tar.xz
96a985bb8eeab535fb8aa2132296763a tzdata2020a.tar.gz
27cd82f9a61422e186b9d6759ddf1634 udev-lfs-20171102.tar.xz
fe7c0f7e439f08970e462c9d44599903 util-linux-2.36.tar.xz
e07b0c1e71aa059cdfddc7c93c00c62a vim-8.2.1361.tar.gz
80bb18a8e6240fcf7ec2f7b57601c170 XML-Parser-2.46.tar.gz
aa1621ec7013a19abab52a8aff04fe5b xz-5.2.5.tar.xz
85adef240c5f370b308da8c938951a68 zlib-1.2.11.tar.xz
dd0b53631303b8f972dafa6fd34beb0c zstd-1.4.5.tar.gz
c1545da2ad7d78574b52c465ec077ed9 bash-5.0-upstream_fixes-1.patch
6a5ac7e89b791aae556de0f745916f7f bzip2-1.0.8-install_docs-1.patch
cd8ebed2a67fff2e231026df91af6776 coreutils-8.32-i18n-1.patch
9a5997c3452909b1769918c759eff8a2 glibc-2.32-fhs-1.patch
f75cca16a38da6caa7d52151f7136895 kbd-2.3.0-backspace-1.patch
4900322141d493e74020c9cf437b2cdc sysvinit-2.97-consolidated-1.patch

39
packages/acl.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=acl-2.2.53.tar.gz
SRC_FOLDER=acl-2.2.53
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--bindir=/bin \
--disable-static \
--libexecdir=/usr/lib \
--docdir=/usr/share/doc/acl-2.2.53
make
make install
mv -v /usr/lib/libacl.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

40
packages/attr.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=attr-2.4.48.tar.gz
SRC_FOLDER=attr-2.4.48
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--bindir=/bin \
--disable-static \
--sysconfdir=/etc \
--docdir=/usr/share/doc/attr-2.4.48
make
#make check
make install
mv -v /usr/lib/libattr.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/autoconf.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=autoconf-2.69.tar.xz
SRC_FOLDER=autoconf-2.69
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i '361 s/{/\\{/' bin/autoscan.in
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/automake.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=automake-1.16.2.tar.xz
SRC_FOLDER=automake-1.16.2
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i "s/''/etags/" t/tags-lisp-space.sh
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.2
make
#make -j4 check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

47
packages/bash.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=bash-5.0.tar.gz
SRC_FOLDER=bash-5.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../bash-5.0-upstream_fixes-1.patch
./configure --prefix=/usr \
--docdir=/usr/share/doc/bash-5.0 \
--without-bash-malloc \
--with-installed-readline
make
# TEST
# chown -Rv tester .
#su tester << EOF
#PATH=$PATH make tests < $(tty)
#EOF
make install
mv -vf /usr/bin/bash /bin
# Run new bash will break current alfs-script
#exec /bin/bash --login +h
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

33
packages/bc.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=bc-3.1.5.tar.xz
SRC_FOLDER=bc-3.1.5
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3
make
#make test
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

48
packages/binutils.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=binutils-2.35.tar.xz
SRC_FOLDER=binutils-2.35
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
expect -c "spawn ls"
spawn ls
sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in
mkdir -v build
cd build
../configure --prefix=/usr \
--enable-gold \
--enable-ld=default \
--enable-plugins \
--enable-shared \
--disable-werror \
--enable-64-bit-bfd \
--with-system-zlib
make tooldir=/usr
#make -k check
make tooldir=/usr install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/bison.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=bison-3.7.1.tar.xz
SRC_FOLDER=bison-3.7.1
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.7.1
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

47
packages/bzip2.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=bzip2-1.0.8.tar.gz
SRC_FOLDER=bzip2-1.0.8
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
make -f Makefile-libbz2_so
make clean
make
make PREFIX=/usr install
cp -v bzip2-shared /bin/bzip2
cp -av libbz2.so* /lib
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
rm -v /usr/bin/{bunzip2,bzcat,bzip2}
ln -sv bzip2 /bin/bunzip2
ln -sv bzip2 /bin/bzcat
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/check.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=check-0.15.2.tar.gz
SRC_FOLDER=check-0.15.2
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --disable-static
make
#make check
make docdir=/usr/share/doc/check-0.15.2 install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

54
packages/coreutils.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=coreutils-8.32.tar.xz
SRC_FOLDER=coreutils-8.32
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../coreutils-8.32-i18n-1.patch
sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk
autoreconf -fiv
FORCE_UNSAFE_CONFIGURE=1 ./configure \
--prefix=/usr \
--enable-no-install-program=kill,uptime
make
#make NON_ROOT_USERNAME=tester check-root
#echo "dummy:x:102:tester" >> /etc/group
#chown -Rv tester .
#su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
sed -i '/dummy/d' /etc/group
make install
mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
mv -v /usr/bin/chroot /usr/sbin
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8
mv -v /usr/bin/{head,nice,sleep,touch} /bin
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

37
packages/dejagnu.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=dejagnu-1.6.2.tar.gz
SRC_FOLDER=dejagnu-1.6.2
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi
makeinfo --plaintext -o doc/dejagnu.txt doc/dejagnu.texi
make install
install -v -dm755 /usr/share/doc/dejagnu-1.6.2
install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.2
#make check
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/diffutils.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=diffutils-3.7.tar.xz
SRC_FOLDER=diffutils-3.7
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

54
packages/e2fsprogs.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=e2fsprogs-1.45.6.tar.gz
SRC_FOLDER=e2fsprogs-1.45.6
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
mkdir -v build
cd build
../configure --prefix=/usr \
--bindir=/bin \
--with-root-prefix="" \
--enable-elf-shlibs \
--disable-libblkid \
--disable-libuuid \
--disable-uuidd \
--disable-fsck
make
#make check
make install
chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
gunzip -v /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

51
packages/eudev.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=eudev-3.2.9.tar.gz
SRC_FOLDER=eudev-3.2.9
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--bindir=/sbin \
--sbindir=/sbin \
--libdir=/usr/lib \
--sysconfdir=/etc \
--libexecdir=/lib \
--with-rootprefix= \
--with-rootlibdir=/lib \
--enable-manpages \
--disable-static
make
mkdir -pv /lib/udev/rules.d
mkdir -pv /etc/udev/rules.d
#make check
make install
tar -xvf ../udev-lfs-20171102.tar.xz
make -f udev-lfs-20171102/Makefile.lfs install
udevadm hwdb --update
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

35
packages/expat.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=expat-2.2.9.tar.xz
SRC_FOLDER=expat-2.2.9
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/expat-2.2.9
make
#make check
make install
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.2.9
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/expect.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=expect5.45.4.tar.gz
SRC_FOLDER=expect5.45.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
./configure --prefix=/usr \
--with-tcl=/usr/lib \
--enable-shared \
--mandir=/usr/share/man \
--with-tclinclude=/usr/include
make
#make test
make install
ln -svf expect5.45.4/libexpect5.45.4.so /usr/lib
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/file.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=file-5.39.tar.gz
SRC_FOLDER=file-5.39
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

37
packages/findutils.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=findutils-4.7.0.tar.xz
SRC_FOLDER=findutils-4.7.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --localstatedir=/var/lib/locate
make
#chown -Rv tester .
#su tester -c "PATH=$PATH make check"
make install
mv -v /usr/bin/find /bin
sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/flex.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=flex-2.6.4.tar.gz
SRC_FOLDER=flex-2.6.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.4
make
#make check
make install
ln -sv flex /usr/bin/lex
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

36
packages/gawk.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gawk-5.1.0.tar.xz
SRC_FOLDER=gawk-5.1.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr
make
#make check
make install
mkdir -v /usr/share/doc/gawk-5.1.0
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.0
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

79
packages/gcc.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gcc-10.2.0.tar.xz
SRC_FOLDER=gcc-10.2.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
mkdir -v build
cd build
../configure --prefix=/usr \
LD=ld \
--enable-languages=c,c++ \
--disable-multilib \
--disable-bootstrap \
--with-system-zlib
make
# TEST
#ulimit -s 32768
#chown -Rv tester .
#su tester -c "PATH=$PATH make -k check"
#../contrib/test_summary
make install
rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/10.2.0/include-fixed/bits/
chown -v -R root:root \
/usr/lib/gcc/*linux-gnu/10.2.0/include{,-fixed}
ln -sv ../usr/bin/cpp /lib
install -v -dm755 /usr/lib/bfd-plugins
ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/10.2.0/liblto_plugin.so \
/usr/lib/bfd-plugins/
# TEST
#echo 'int main(){}' > dummy.c
#cc dummy.c -v -Wl,--verbose &> dummy.log
#readelf -l a.out | grep ': /lib'
#grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
#grep -B4 '^ /usr/include' dummy.log
#grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
#grep "/lib.*/libc.so.6 " dummy.log
#grep found dummy.log
#rm -v dummy.c a.out dummy.log
# move misplaced file
mkdir -pv /usr/share/gdb/auto-load/usr/lib
mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

36
packages/gdbm.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gdbm-1.18.1.tar.gz
SRC_FOLDER=gdbm-1.18.1
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -r -i '/^char.*parseopt_program_(doc|args)/d' src/parseopt.c
./configure --prefix=/usr \
--disable-static \
--enable-libgdbm-compat
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

36
packages/gettext.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gettext-0.21.tar.xz
SRC_FOLDER=gettext-0.21
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/gettext-0.21
make
#make check
make install
chmod -v 0755 /usr/lib/preloadable_libintl.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

136
packages/glibc.sh Executable file
View File

@ -0,0 +1,136 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=glibc-2.32.tar.xz
SRC_FOLDER=glibc-2.32
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../glibc-2.32-fhs-1.patch
mkdir -v build
cd build
../configure --prefix=/usr \
--disable-werror \
--enable-kernel=3.2 \
--enable-stack-protector=strong \
--with-headers=/usr/include \
libc_cv_slibdir=/lib
make
case $(uname -m) in
i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;;
x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;
esac
#make check
touch /etc/ld.so.conf
sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
make install
cp -v ../nscd/nscd.conf /etc/nscd.conf
mkdir -pv /var/cache/nscd
mkdir -pv /usr/lib/locale
localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i de_DE -f UTF-8 de_DE.UTF-8
localedef -i el_GR -f ISO-8859-7 el_GR
localedef -i en_GB -f UTF-8 en_GB.UTF-8
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fa_IR -f UTF-8 fa_IR
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i it_IT -f UTF-8 it_IT.UTF-8
localedef -i ja_JP -f EUC-JP ja_JP
localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true
localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
localedef -i zh_CN -f GB18030 zh_CN.GB18030
localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF
tar -xf ../../tzdata2020a.tar.gz
ZONEINFO=/usr/share/zoneinfo
mkdir -pv $ZONEINFO/{posix,right}
for tz in etcetera southamerica northamerica europe africa antarctica \
asia australasia backward pacificnew systemv; do
zic -L /dev/null -d $ZONEINFO ${tz}
zic -L /dev/null -d $ZONEINFO/posix ${tz}
zic -L leapseconds -d $ZONEINFO/right ${tz}
done
cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
zic -d $ZONEINFO -p America/New_York
unset ZONEINFO
#tzselect
#ln -sfv /usr/share/zoneinfo/<xxx> /etc/localtime
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
EOF
cat >> /etc/ld.so.conf << "EOF"
# Add an include directory
include /etc/ld.so.conf.d/*.conf
EOF
mkdir -pv /etc/ld.so.conf.d
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

41
packages/gmp.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gmp-6.2.0.tar.xz
SRC_FOLDER=gmp-6.2.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--enable-cxx \
--disable-static \
--docdir=/usr/share/doc/gmp-6.2.0
make
#make html
#make check 2>&1 | tee gmp-check-log
#awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
make install
#make install-html
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/gpref.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gperf-3.1.tar.gz
SRC_FOLDER=gperf-3.1
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1
make
#make -j1 check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/grep.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=grep-3.4.tar.xz
SRC_FOLDER=grep-3.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --bindir=/bin
make
#make test
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/groff.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=groff-1.22.4.tar.gz
SRC_FOLDER=groff-1.22.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
PAGE=letter ./configure --prefix=/usr
make -j1
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

37
packages/grub.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=grub-2.04.tar.xz
SRC_FOLDER=grub-2.04
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--sbindir=/sbin \
--sysconfdir=/etc \
--disable-efiemu \
--disable-werror
make
make install
mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/gzip.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=gzip-1.10.tar.xz
SRC_FOLDER=gzip-1.10
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
mv -v /usr/bin/gzip /bin
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

29
packages/iana-etc.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=iana-etc-20200821.tar.gz
SRC_FOLDER=iana-etc-20200821
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
cp services protocols /etc
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

42
packages/inetutils.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=inetutils-1.9.4.tar.xz
SRC_FOLDER=inetutils-1.9.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--localstatedir=/var \
--disable-logger \
--disable-whois \
--disable-rcp \
--disable-rexec \
--disable-rlogin \
--disable-rsh \
--disable-servers
make
#make check
make install
mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
mv -v /usr/bin/ifconfig /sbin
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

35
packages/intltool.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=inetutils-1.9.4.tar.xz
SRC_FOLDER=inetutils-1.9.4
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i 's:\\\${:\\\$\\{:' intltool-update.in
./configure --prefix=/usr
make
#make check
make install
install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/iproute2.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=iproute2-5.8.0.tar.xz
SRC_FOLDER=iproute2-5.8.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i /ARPD/d Makefile
rm -fv man/man8/arpd.8
sed -i 's/.m_ipt.o//' tc/Makefile
make
make DOCDIR=/usr/share/doc/iproute2-5.8.0 install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

41
packages/kbd.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=kbd-2.3.0.tar.xz
SRC_FOLDER=kbd-2.3.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../kbd-2.3.0-backspace-1.patch
sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure
sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
./configure --prefix=/usr --disable-vlock
make
#make check
make install
rm -v /usr/lib/libtswrap.{a,la,so*}
mkdir -v /usr/share/doc/kbd-2.3.0
cp -R -v docs/doc/* /usr/share/doc/kbd-2.3.0
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

43
packages/kmod.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=kmod-27.tar.xz
SRC_FOLDER=kmod-27
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--bindir=/bin \
--sysconfdir=/etc \
--with-rootlibdir=/lib \
--with-xz \
--with-zlib
make
make install
for target in depmod insmod lsmod modinfo modprobe rmmod; do
ln -sfv ../bin/kmod /sbin/$target
done
ln -sfv kmod /bin/lsmod
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

30
packages/less.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=less-551.tar.gz
SRC_FOLDER=less-551
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --sysconfdir=/etc
make
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

28
packages/lfs-bootscripts.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=lfs-bootscripts-20200818.tar.xz
SRC_FOLDER=lfs-bootscripts-20200818
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

38
packages/libcap.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=libcap-2.42.tar.xz
SRC_FOLDER=libcap-2.42
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i '/install -m.*STACAPLIBNAME/d' libcap/Makefile
make lib=lib
#make test
make lib=lib PKGCONFIGDIR=/usr/lib/pkgconfig install
chmod -v 755 /lib/libcap.so.2.42
mv -v /lib/libpsx.a /usr/lib
rm -v /lib/libcap.so
ln -sfv ../../lib/libcap.so.2 /usr/lib/libcap.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

35
packages/libelf.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=elfutils-0.180.tar.bz2
SRC_FOLDER=elfutils-0.180
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --disable-debuginfod --libdir=/lib
make
#make check
make -C libelf install
install -vm644 config/libelf.pc /usr/lib/pkgconfig
rm /lib/libelf.a
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/libffi.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=libffi-3.3.tar.gz
SRC_FOLDER=libffi-3.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --disable-static --with-gcc-arch=native
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/libpipeline.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=libpipeline-1.5.3.tar.gz
SRC_FOLDER=libpipeline-1.5.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/libtool.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=libtool-2.4.6.tar.xz
SRC_FOLDER=libtool-2.4.6
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

52
packages/linux.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=linux-5.8.3.tar.xz
SRC_FOLDER=linux-5.8.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
make mrproper
# generate config close to current running system
make defconfig
#make menuconfig
make
make modules_install
cp -iv arch/x86/boot/bzImage /boot/vmlinuz-5.8.3-lfs-10.0
cp -iv System.map /boot/System.map-5.8.3
cp -iv .config /boot/config-5.8.3
install -d /usr/share/doc/linux-5.8.3
cp -r Documentation/* /usr/share/doc/linux-5.8.3
# 10.3.2. Configuring Linux Module Load Order
install -v -m755 -d /etc/modprobe.d
cat > /etc/modprobe.d/usb.conf << "EOF"
# Begin /etc/modprobe.d/usb.conf
install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true
install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true
# End /etc/modprobe.d/usb.conf
EOF
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/m4.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=m4-1.4.18.tar.xz
SRC_FOLDER=m4-1.4.18
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/make.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=make-4.3.tar.gz
SRC_FOLDER=make-4.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

41
packages/man-db.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=man-db-2.9.3.tar.xz
SRC_FOLDER=man-db-2.9.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--docdir=/usr/share/doc/man-db-2.9.3 \
--sysconfdir=/etc \
--disable-setuid \
--enable-cache-owner=bin \
--with-browser=/usr/bin/lynx \
--with-vgrind=/usr/bin/vgrind \
--with-grap=/usr/bin/grap \
--with-systemdtmpfilesdir= \
--with-systemdsystemunitdir=
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

21
packages/man-pages.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
cd /sources
tar xvf man-pages-5.08.tar.xz
cd man-pages-5.08
make install
cd /sources
rm -rf man-pages-5.08
echo "Done"

31
packages/meson.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=meson-0.55.0.tar.gz
SRC_FOLDER=meson-0.55.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
python3 setup.py build
python3 setup.py install --root=dest
cp -rv dest/* /
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

37
packages/mpc.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=mpc-1.1.0.tar.gz
SRC_FOLDER=mpc-1.1.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/mpc-1.1.0
make
make html
#make check
make install
make install-html
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

38
packages/mpfr.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=mpfr-4.1.0.tar.xz
SRC_FOLDER=mpfr-4.1.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--disable-static \
--enable-thread-safe \
--docdir=/usr/share/doc/mpfr-4.1.0
make
make html
#make check
make install
make install-html
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

55
packages/ncurses.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=ncurses-6.2.tar.gz
SRC_FOLDER=ncurses-6.2
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
./configure --prefix=/usr \
--mandir=/usr/share/man \
--with-shared \
--without-debug \
--without-normal \
--enable-pc-files \
--enable-widec
make
make install
mv -v /usr/lib/libncursesw.so.6* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so
for lib in ncurses form panel menu ; do
rm -vf /usr/lib/lib${lib}.so
echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
done
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
mkdir -v /usr/share/doc/ncurses-6.2
cp -v -R doc/* /usr/share/doc/ncurses-6.2
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

45
packages/ninja.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=ninja-1.10.0.tar.gz
SRC_FOLDER=ninja-1.10.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
export NINJAJOBS=4
sed -i '/int Guess/a \
int j = 0;\
char* jobs = getenv( "NINJAJOBS" );\
if ( jobs != NULL ) j = atoi( jobs );\
if ( j > 0 ) return j;\
' src/ninja.cc
python3 configure.py --bootstrap
#TEST
#./ninja ninja_test
#./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
install -vm755 ninja /usr/bin/
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

41
packages/openssl.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=openssl-1.1.1g.tar.gz
SRC_FOLDER=openssl-1.1.1g
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./config --prefix=/usr \
--openssldir=/etc/ssl \
--libdir=lib \
shared \
zlib-dynamic
make
#make test
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
make MANSUFFIX=ssl install
mv -v /usr/share/doc/openssl /usr/share/doc/openssl-1.1.1g
cp -vfr doc/* /usr/share/doc/openssl-1.1.1g
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/patch.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=patch-2.7.6.tar.xz
SRC_FOLDER=patch-2.7.6
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

49
packages/perl.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=perl-5.32.0.tar.xz
SRC_FOLDER=perl-5.32.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
export BUILD_ZLIB=False
export BUILD_BZIP2=0
sh Configure -des \
-Dprefix=/usr \
-Dvendorprefix=/usr \
-Dprivlib=/usr/lib/perl5/5.32/core_perl \
-Darchlib=/usr/lib/perl5/5.32/core_perl \
-Dsitelib=/usr/lib/perl5/5.32/site_perl \
-Dsitearch=/usr/lib/perl5/5.32/site_perl \
-Dvendorlib=/usr/lib/perl5/5.32/vendor_perl \
-Dvendorarch=/usr/lib/perl5/5.32/vendor_perl \
-Dman1dir=/usr/share/man/man1 \
-Dman3dir=/usr/share/man/man3 \
-Dpager="/usr/bin/less -isR" \
-Duseshrplib \
-Dusethreads
make
#make test
make install
unset BUILD_ZLIB BUILD_BZIP2
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/pkg-config.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=pkg-config-0.29.2.tar.gz
SRC_FOLDER=pkg-config-0.29.2
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--with-internal-glib \
--disable-host-tool \
--docdir=/usr/share/doc/pkg-config-0.29.2
make
#make check
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

42
packages/procps-ng.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=procps-ng-3.3.16.tar.xz
SRC_FOLDER=procps-ng-3.3.16
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--exec-prefix= \
--libdir=/usr/lib \
--docdir=/usr/share/doc/procps-ng-3.3.16 \
--disable-static \
--disable-kill
make
#make check
make install
mv -v /usr/lib/libprocps.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

32
packages/psmisc.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=psmisc-23.3.tar.xz
SRC_FOLDER=psmisc-23.3
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
make install
mv -v /usr/bin/fuser /bin
mv -v /usr/bin/killall /bin
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

47
packages/python.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=Python-3.8.5.tar.xz
SRC_FOLDER=Python-3.8.5
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--with-ensurepip=yes
make
make install
chmod -v 755 /usr/lib/libpython3.8.so
chmod -v 755 /usr/lib/libpython3.so
ln -sfv pip3.8 /usr/bin/pip3
install -v -dm755 /usr/share/doc/python-3.8.5/html
tar --strip-components=1 \
--no-same-owner \
--no-same-permissions \
-C /usr/share/doc/python-3.8.5/html \
-xvf ../python-3.8.5-docs-html.tar.bz2
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

45
packages/readline.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=readline-8.0.tar.gz
SRC_FOLDER=readline-8.0
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i '/MV.*old/d' Makefile.in
sed -i '/{OLDSUFF}/c:' support/shlib-install
./configure --prefix=/usr \
--disable-static \
--with-curses \
--docdir=/usr/share/doc/readline-8.0
make SHLIB_LIBS="-lncursesw"
make SHLIB_LIBS="-lncursesw" install
mv -v /usr/lib/lib{readline,history}.so.* /lib
chmod -v u+w /lib/lib{readline,history}.so.*
ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so
install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.0
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

38
packages/sed.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=sed-4.8.tar.xz
SRC_FOLDER=sed-4.8
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --bindir=/bin
make
make html
# TEST
#chown -Rv tester .
#su tester -c "PATH=$PATH make check"
make install
install -d -m755 /usr/share/doc/sed-4.8
install -m644 doc/sed.html /usr/share/doc/sed-4.8
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

52
packages/shadow.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
# default pwd is root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=shadow-4.8.1.tar.xz
SRC_FOLDER=shadow-4.8.1
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;
sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \
-e 's:/var/spool/mail:/var/mail:' \
-i etc/login.defs
sed -i 's/1000/999/' etc/useradd
touch /usr/bin/passwd
./configure --sysconfdir=/etc \
--with-group-name-max-length=32
make
make install
pwconv
grpconv
sed -i 's/yes/no/' /etc/default/useradd
echo 'root:root' | chpasswd
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

46
packages/sysklogd.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=sysklogd-1.5.1.tar.gz
SRC_FOLDER=sysklogd-1.5.1
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c
sed -i 's/union wait/int/' syslogd.c
make
make BINDIR=/sbin install
cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
EOF
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

30
packages/sysvinit.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=sysvinit-2.97.tar.xz
SRC_FOLDER=sysvinit-2.97
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
patch -Np1 -i ../sysvinit-2.97-consolidated-1.patch
make
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

35
packages/tar.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=tar-1.32.tar.xz
SRC_FOLDER=tar-1.32
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
FORCE_UNSAFE_CONFIGURE=1 \
./configure --prefix=/usr \
--bindir=/bin
make
#make check
make install
make -C doc install-html docdir=/usr/share/doc/tar-1.32
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

56
packages/tcl.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
cd /sources
tar xvf tcl8.6.10-src.tar.gz
cd tcl8.6.10
tar -xf ../tcl8.6.10-html.tar.gz --strip-components=1
SRCDIR=$(pwd)
cd unix
./configure --prefix=/usr \
--mandir=/usr/share/man \
$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)
make
sed -e "s|$SRCDIR/unix|/usr/lib|" \
-e "s|$SRCDIR|/usr/include|" \
-i tclConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.1|/usr/lib/tdbc1.1.1|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.1/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.1/library|/usr/lib/tcl8.6|" \
-e "s|$SRCDIR/pkgs/tdbc1.1.1|/usr/include|" \
-i pkgs/tdbc1.1.1/tdbcConfig.sh
sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.0|/usr/lib/itcl4.2.0|" \
-e "s|$SRCDIR/pkgs/itcl4.2.0/generic|/usr/include|" \
-e "s|$SRCDIR/pkgs/itcl4.2.0|/usr/include|" \
-i pkgs/itcl4.2.0/itclConfig.sh
unset SRCDIR
#make test
make install
chmod -v u+w /usr/lib/libtcl8.6.so
make install-private-headers
ln -sfv tclsh8.6 /usr/bin/tclsh
cd /sources
rm -rf tcl8.6.10
echo "Done"

39
packages/texinfo.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=texinfo-6.7.tar.xz
SRC_FOLDER=texinfo-6.7
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr --disable-static
make
#make check
make install
make TEXMF=/usr/share/texmf install-tex
pushd /usr/share/info
rm -v dir
for f in *
do install-info $f dir 2>/dev/null
done
popd
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

49
packages/util-linux.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=util-linux-2.36.tar.xz
SRC_FOLDER=util-linux-2.36
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
mkdir -pv /var/lib/hwclock
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
--docdir=/usr/share/doc/util-linux-2.36 \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \
--disable-su \
--disable-setpriv \
--disable-runuser \
--disable-pylibmount \
--disable-static \
--without-python \
--without-systemd \
--without-systemdsystemunitdir
make
#chown -Rv tester .
#su tester -c "make -k check"
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

62
packages/vim.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=vim-8.2.1361.tar.gz
SRC_FOLDER=vim-8.2.1361
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
make
#chown -Rv tester .
#su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
make install
ln -sv vim /usr/bin/vi
for L in /usr/share/man/{,*/}man1/vim.1; do
ln -sv vim.1 $(dirname $L)/vi.1
done
ln -sv ../vim/vim82/doc /usr/share/doc/vim-8.2.1361
cat > /etc/vimrc << "EOF"
" Begin /etc/vimrc
" Ensure defaults are set before customizing settings, not after
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1
set nocompatible
set backspace=2
set mouse=
syntax on
if (&term == "xterm") || (&term == "putty")
set background=dark
endif
" End /etc/vimrc
EOF
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

33
packages/wget.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=wget-1.21.tar.gz
SRC_FOLDER=wget-1.21
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--sysconfdir=/etc \
--with-ssl=openssl &&
make
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

31
packages/xml-parser.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=XML-Parser-2.46.tar.gz
SRC_FOLDER=XML-Parser-2.46
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
perl Makefile.PL
make
#make test
make install
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

39
packages/xz.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=xz-5.2.5.tar.xz
SRC_FOLDER=xz-5.2.5
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/xz-5.2.5
make
#make check
make install
mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
mv -v /usr/lib/liblzma.so.* /lib
ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

34
packages/zlib.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=zlib-1.2.11.tar.xz
SRC_FOLDER=zlib-1.2.11
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
./configure --prefix=/usr
make
#make check
make install
mv -v /usr/lib/libz.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

35
packages/zstd.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SRC_FILE=zstd-1.4.5.tar.gz
SRC_FOLDER=zstd-1.4.5
cd /sources
tar xvf $SRC_FILE
cd $SRC_FOLDER
# BUILD
make
make prefix=/usr install
rm -v /usr/lib/libzstd.a
mv -v /usr/lib/libzstd.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) /usr/lib/libzstd.so
# EBC
cd /sources
rm -rf $SRC_FOLDER
echo Deleting $SRC_FOLDER
echo Done with $SRC_FILE

View File

@ -0,0 +1,23 @@
#!/bin/bash
#Chapter 7. Entering Chroot and Building Additional Temporary Tools
# 7.7. Libstdc++ from GCC-10.2.0, Pass 2
/alfs/toolchain/libstdc-pass-2.sh
# 7.8. Gettext-0.21
/alfs/toolchain/gettext.sh
# 7.9. Bison-3.7.1
/alfs/toolchain/bison.sh
# 7.10. Perl-5.32.0
/alfs/toolchain/perl.sh
# 7.11. Python-3.8.5
/alfs/toolchain/python.sh
# 7.12. Texinfo-6.7
/alfs/toolchain/texinfo.sh
# 7.13. Util-linux-2.36
/alfs/toolchain/util-linux.sh
# 7.14. Cleaning up and Saving the Temporary System
find /usr/{lib,libexec} -name \*.la -delete
rm -rf /usr/share/{info,man,doc}/*

78
scripts/build_chroot.sh Executable file
View File

@ -0,0 +1,78 @@
#!/bin/bash
# 7.5. Creating Directories
mkdir -pv /{boot,home,mnt,opt,srv}
mkdir -pv /etc/{opt,sysconfig}
mkdir -pv /lib/firmware
mkdir -pv /media/{floppy,cdrom}
mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -pv /usr/{,local/}share/man/man{1..8}
mkdir -pv /var/{cache,local,log,mail,opt,spool}
mkdir -pv /var/lib/{color,misc,locate}
ln -sfv /run /var/run
ln -sfv /run/lock /var/lock
install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp
# 7.6. Creating Essential Files and Symlinks
ln -sv /proc/self/mounts /etc/mtab
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
daemon:x:6:6:Daemon User:/dev/null:/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
EOF
cat > /etc/group << "EOF"
root:x:0:
bin:x:1:daemon
sys:x:2:
kmem:x:3:
tape:x:4:
tty:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
adm:x:16:
messagebus:x:18:
input:x:24:
mail:x:34:
kvm:x:61:
wheel:x:97:
nogroup:x:99:
users:x:999:
EOF
echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd
echo "tester:x:101:" >> /etc/group
install -o tester -d /home/tester
touch /var/log/{btmp,lastlog,faillog,wtmp}
chgrp -v utmp /var/log/lastlog
chmod -v 664 /var/log/lastlog
chmod -v 600 /var/log/btmp
echo "Done."
echo
# Chapter 7. Entering Chroot and Building Additional Temporary Tools
# 7.7 - 7.14
/alfs/scripts/build_addtemp-toolchain.sh
exit

152
scripts/build_lfs.sh Executable file
View File

@ -0,0 +1,152 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ -z ${LFS} ]
then echo "LFS is not defined. example; export LFS=/mnt/lfs"
exit
fi
if mount | grep /mnt/lfs > /dev/null; then
echo
echo "LFS mount found."
echo
else
echo
echo "No LFS partition found at /mnt/lfs."
echo
echo "Check out README.md"
echo
exit
fi
# 7.2. Changing Ownership
chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools,alfs}
case $(uname -m) in
x86_64) chown -R root:root $LFS/lib64 ;;
esac
# 7.3. Preparing Virtual Kernel File Systems
mkdir -pv $LFS/{dev,proc,sys,run}
# 7.3.1. Creating Initial Device Nodes
mknod -m 600 $LFS/dev/console c 5 1
mknod -m 666 $LFS/dev/null c 1 3
# 7.3.2. Mounting and Populating /dev
mount -v --bind /dev $LFS/dev
# 7.3.3. Mounting Virtual Kernel File Systems
mount -v --bind /dev/pts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
fi
# 7.7 - 7.14
echo "Chrooting.."
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
MAKEFLAGS=-j`nproc` \
/bin/bash --login +h -c /alfs/scripts/build_chroot.sh
umount $LFS/dev{/pts,}
umount $LFS/{sys,proc,run}
# 7.14.1. Stripping
strip --strip-debug $LFS/usr/lib/*
strip --strip-unneeded $LFS/usr/{,s}bin/*
strip --strip-unneeded $LFS/tools/bin/*
# 7.14.2. Backup
#cd $LFS &&
#tar -cJpf $HOME/lfs-temp-tools-10.0.tar.xz .
# 7.14.3. Restore
#cd $LFS &&
#rm -rf ./* &&
#tar -xpf $HOME/lfs-temp-tools-10.0.tar.xz
# (REF) 7.3.3. Mounting Virtual Kernel File Systems
mount -v --bind /dev/pts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
fi
# Building the LFS System
# Chapter 8. Installing Basic System Software
echo "Chrooting.."
chroot "$LFS" /usr/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
MAKEFLAGS=-j`nproc` \
/bin/bash --login +h -c /alfs/scripts/build_packages.sh
# 8.78. Cleaning Up
rm -f /usr/lib/lib{bfd,opcodes}.a
rm -f /usr/lib/libctf{,-nobfd}.a
rm -f /usr/lib/libbz2.a
rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
rm -f /usr/lib/libltdl.a
rm -f /usr/lib/libfl.a
rm -f /usr/lib/libz.a
find /usr/lib /usr/libexec -name \*.la -delete
find /usr -depth -name $(uname -m)-lfs-linux-gnu\* | xargs rm -rf
rm -rf /tools
userdel -r tester
# Chapter 9. System Configuration
umount $LFS/dev{/pts,}
umount $LFS/{sys,proc,run}
mount -v --bind /dev/pts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
fi
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" \
PS1='(lfs chroot) \u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
MAKEFLAGS=-j`nproc` \
/bin/bash --login -c /alfs/scripts/config_lfs.sh
# Finished
umount $LFS/{sys,proc,run}
echo
echo "Exiting chroot."
echo "LFS build completed."
echo
echo $LFS
echo
echo "Check out README.md for grub notes."
echo
echo "To enter chroot; sudo -E \$ALFS/extras/chroot.sh /dev/sdb1"
echo

116
scripts/build_packages.sh Executable file
View File

@ -0,0 +1,116 @@
#!/bin/bash
# 8.3. Man-pages-5.08
/alfs/packages/man-pages.sh
/alfs/packages/tcl.sh
/alfs/packages/expect.sh
/alfs/packages/dejagnu.sh
/alfs/packages/iana-etc.sh
/alfs/packages/glibc.sh
/alfs/packages/zlib.sh
/alfs/packages/bzip2.sh
/alfs/packages/xz.sh
/alfs/packages/zstd.sh
/alfs/packages/file.sh
/alfs/packages/readline.sh
/alfs/packages/m4.sh
/alfs/packages/bc.sh
/alfs/packages/flex.sh
/alfs/packages/binutils.sh
/alfs/packages/gmp.sh
/alfs/packages/mpfr.sh
/alfs/packages/mpc.sh
/alfs/packages/attr.sh
/alfs/packages/acl.sh
/alfs/packages/libcap.sh
/alfs/packages/shadow.sh
/alfs/packages/gcc.sh
/alfs/packages/pkg-config.sh
/alfs/packages/ncurses.sh
/alfs/packages/sed.sh
/alfs/packages/psmisc.sh
/alfs/packages/gettext.sh
/alfs/packages/bison.sh
/alfs/packages/grep.sh
/alfs/packages/bash.sh
/alfs/packages/libtool.sh
/alfs/packages/gdbm.sh
/alfs/packages/gpref.sh
/alfs/packages/expat.sh
/alfs/packages/inetutils.sh
/alfs/packages/perl.sh
/alfs/packages/xml-parser.sh
/alfs/packages/intltool.sh
/alfs/packages/autoconf.sh
/alfs/packages/automake.sh
/alfs/packages/kmod.sh
/alfs/packages/libelf.sh
/alfs/packages/libffi.sh
/alfs/packages/openssl.sh
/alfs/packages/python.sh
/alfs/packages/ninja.sh
/alfs/packages/meson.sh
/alfs/packages/coreutils.sh
/alfs/packages/check.sh
/alfs/packages/diffutils.sh
/alfs/packages/gawk.sh
/alfs/packages/findutils.sh
/alfs/packages/groff.sh
/alfs/packages/grub.sh
/alfs/packages/less.sh
/alfs/packages/gzip.sh
/alfs/packages/iproute2.sh
/alfs/packages/kbd.sh
/alfs/packages/libpipeline.sh
/alfs/packages/make.sh
/alfs/packages/patch.sh
/alfs/packages/man-db.sh
/alfs/packages/tar.sh
/alfs/packages/texinfo.sh
/alfs/packages/vim.sh
/alfs/packages/eudev.sh
/alfs/packages/procps-ng.sh
/alfs/packages/util-linux.sh
/alfs/packages/e2fsprogs.sh
/alfs/packages/sysklogd.sh
/alfs/packages/sysvinit.sh
# 8.77. Stripping Again
save_lib="ld-2.32.so libc-2.32.so libpthread-2.32.so libthread_db-1.0.so"
cd /lib
for LIB in $save_lib; do
objcopy --only-keep-debug $LIB $LIB.dbg
strip --strip-unneeded $LIB
objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
save_usrlib="libquadmath.so.0.0.0 libstdc++.so.6.0.28
libitm.so.1.0.0 libatomic.so.1.2.0"
cd /usr/lib
for LIB in $save_usrlib; do
objcopy --only-keep-debug $LIB $LIB.dbg
strip --strip-unneeded $LIB
objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
unset LIB save_lib save_usrlib
find /usr/lib -type f -name \*.a \
-exec strip --strip-debug {} ';'
find /lib /usr/lib -type f -name \*.so* ! -name \*dbg \
-exec strip --strip-unneeded {} ';'
find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \
-exec strip --strip-all {} ';'
# 8.78. Cleaning Up
rm -rf /tmp/*
exit

83
scripts/build_temp-toolchain.sh Executable file
View File

@ -0,0 +1,83 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
echo "su lfs -"
exit 255
fi
if [ -z ${LFS} ]
then echo "LFS is not defined. example; export LFS=/mnt/lfs"
exit
fi
if mount | grep /mnt/lfs > /dev/null; then
echo
echo "LFS mount found."
echo
else
echo
echo "No LFS partition found at /mnt/lfs."
echo
echo "Check out README.md"
echo
exit
fi
# Chapter 6. Cross Compiling Temporary Tools
# 6.2. M4-1.4.18
$ALFS/toolchain/m4.sh
# 6.3. Ncurses-6.2
$ALFS/toolchain/ncurses.sh
# 6.4. Bash-5.0
$ALFS/toolchain/bash.sh
# 6.5. Coreutils-8.32
$ALFS/toolchain/coreutils.sh
# 6.6. Diffutils-3.7
$ALFS/toolchain/diffutils.sh
# 6.7. File-5.39
$ALFS/toolchain/file.sh
# 6.8. Findutils-4.7.0
$ALFS/toolchain/findutils.sh
# 6.9. Gawk-5.1.0
$ALFS/toolchain/gawk.sh
# 6.10. Grep-3.4
$ALFS/toolchain/grep.sh
# 6.11. Gzip-1.10
$ALFS/toolchain/gzip.sh
# 6.12. Make-4.3
$ALFS/toolchain/make.sh
# 6.13. Patch-2.7.6
$ALFS/toolchain/patch.sh
# 6.14. Sed-4.8
$ALFS/toolchain/sed.sh
# 6.15. Tar-1.32
$ALFS/toolchain/tar.sh
# 6.16. Xz-5.2.5
$ALFS/toolchain/xz.sh
# 6.17. Binutils-2.35 - Pass 2
$ALFS/toolchain/binutils-pass-2.sh
# 6.18. GCC-10.2.0 - Pass 2
$ALFS/toolchain/gcc-pass-2.sh
echo
echo "Temp Toolchain completed."
echo

45
scripts/build_toolchain.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
echo "su lfs -"
exit 255
fi
if [ -z ${LFS} ]
then echo "LFS is not defined. example; export LFS=/mnt/lfs"
exit
fi
if mount | grep /mnt/lfs > /dev/null; then
echo
echo "LFS mount found."
echo
else
echo
echo "No LFS partition found at /mnt/lfs."
echo
echo "Check out README.md"
echo
exit
fi
# 5.2. Binutils-2.35 - Pass 1
$ALFS/toolchain/binutils-pass-1.sh
# 5.3. GCC-10.2.0 - Pass 1
$ALFS/toolchain/gcc-pass-1.sh
# 5.4. Linux-5.8.3 API Headers
$ALFS/toolchain/linux-api-headers.sh
# 5.5. Glibc-2.32
$ALFS/toolchain/glbic.sh
# 5.6. Libstdc++ from GCC-10.2.0, Pass 1
$ALFS/toolchain/libstd-pass-1.sh
echo
echo "Done"
echo

199
scripts/config_lfs.sh Executable file
View File

@ -0,0 +1,199 @@
#!/bin/bash
# 9.2.1. Installation of LFS-Bootscripts
/alfs/packages/lfs-bootscripts.sh
#9.4.1.2. Creating Custom Udev Rules
bash /lib/udev/init-net-rules.sh
# 9.5.1. Creating Network Interface Configuration Files
cd /etc/sysconfig/
cat > ifconfig.eth0 << "EOF"
ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
IP=192.168.1.2
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255
EOF
# 9.5.2. Creating the /etc/resolv.conf File
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
nameserver 8.8.8.8
# End /etc/resolv.conf
EOF
# 9.5.3. Configuring the system hostname
echo "LFS" > /etc/hostname
# 9.5.4. Customizing the /etc/hosts File
cat > /etc/hosts << "EOF"
# Begin /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 LFS
192.168.86.28 LFS
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# End /etc/hosts
EOF
# 9.6.2. Configuring Sysvinit
cat > /etc/inittab << "EOF"
# Begin /etc/inittab
id:3:initdefault:
si::sysinit:/etc/rc.d/init.d/rc S
l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
su:S016:once:/sbin/sulogin
1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
# End /etc/inittab
EOF
# 9.6.4. Configuring the System Clock
cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock
UTC=1
# Set this to any options you might need to give to hwclock,
# such as machine hardware clock type for Alphas.
CLOCKPARAMS=
# End /etc/sysconfig/clock
EOF
# 9.6.5. Configuring the Linux Console
# 9.7. The Bash Shell Startup Files
# 9.8. Creating the /etc/inputrc File
cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
set meta-flag On
set input-meta On
# Turns off 8th bit stripping
set convert-meta Off
# Keep the 8th bit for display
set output-meta On
# none, visible or audible
set bell-style none
# All of the following map the escape sequence of the value
# contained in the 1st argument to the readline specific functions
"\eOd": backward-word
"\eOc": forward-word
# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for Konsole
"\e[H": beginning-of-line
"\e[F": end-of-line
# End /etc/inputrc
EOF
# 9.9. Creating the /etc/shells File
cat > /etc/shells << "EOF"
# Begin /etc/shells
/bin/sh
/bin/bash
# End /etc/shells
EOF
# 10.2. Creating the /etc/fstab File
cat > /etc/fstab << "EOF"
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
/dev/sda1 / ext4 defaults 1 1
#/dev/sda2 swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
# End /etc/fstab
EOF
# Copy bashrc to root
cp /alfs/defaults/bashrc /root/.bashrc
# 10.3. Linux-5.8.3
/alfs/packages/linux.sh
# 10.4. Using GRUB to Set Up the Boot Process
# 11.1 The End
echo 10.0 > /etc/lfs-release
cat > /etc/lsb-release << "EOF"
DISTRIB_ID="Linux From Scratch"
DISTRIB_RELEASE="10.0"
DISTRIB_CODENAME="Windy"
DISTRIB_DESCRIPTION="Linux From Scratch"
EOF
cat > /etc/os-release << "EOF"
NAME="Linux From Scratch"
VERSION="10.0"
ID=lfs
PRETTY_NAME="Linux From Scratch 10.0"
VERSION_CODENAME="Windy"
EOF
echo
echo "Review section.."
echo "10.4. Using GRUB to Set Up the Boot Process"
echo "Not installing grub by default"
echo
exit

32
toolchain/bash.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf bash-5.0.tar.gz
cd bash-5.0
./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
cd $LFS/sources
rm -rf bash-5.0
echo "Done"

31
toolchain/binutils-pass-1.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf binutils-2.35.tar.xz
cd binutils-2.35
mkdir -v build
cd build
../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
make
make install
cd $LFS/sources
rm -rf binutils-2.35
echo "Done"

35
toolchain/binutils-pass-2.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf binutils-2.35.tar.xz
cd binutils-2.35
mkdir -v build
cd build
../configure \
--prefix=/usr \
--build=$(../config.guess) \
--host=$LFS_TGT \
--disable-nls \
--enable-shared \
--disable-werror \
--enable-64-bit-bfd
make
make DESTDIR=$LFS install
cd $LFS/sources
rm -rf binutils-2.35
echo "Done"

16
toolchain/bison.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
cd /sources/
tar xvf bison-3.7.1.tar.xz
cd bison-3.7.1
./configure --prefix=/usr \
--docdir=/usr/share/doc/bison-3.7.1
make
make install
cd /sources/
rm -rf bison-3.7.1
echo "Done"

38
toolchain/coreutils.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf coreutils-8.32.tar.xz
cd coreutils-8.32
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
--enable-install-program=hostname \
--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
cd $LFS/sources
rm -rf coreutils-8.32
echo "Done"

25
toolchain/diffutils.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf diffutils-3.7.tar.xz
cd diffutils-3.7
./configure --prefix=/usr --host=$LFS_TGT
make
make DESTDIR=$LFS install
cd $LFS/sources
rm -rf diffutils-3.7
echo "Done"

25
toolchain/file.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf file-5.39.tar.gz
cd file-5.39
./configure --prefix=/usr --host=$LFS_TGT
make
make DESTDIR=$LFS install
cd $LFS/sources
rm -rf file-5.39
echo "Done"

30
toolchain/findutils.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ "$(whoami)" != "lfs" ]; then
echo "Script must be run as user: lfs"
exit 255
fi
cd $LFS/sources
tar xvf findutils-4.7.0.tar.xz
cd findutils-4.7.0
./configure --prefix=/usr \
--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
cd $LFS/sources
rm -rf findutils-4.7.0
echo "Done"

Some files were not shown because too many files have changed in this diff Show More