|
|
@ -1,8 +1,8 @@ |
|
|
|
#!/bin/bash |
|
|
|
#----------------------------------------------------------------------------- |
|
|
|
# Title: ch6.sh |
|
|
|
# Date: 2020-05-30 |
|
|
|
# Version: 1.0 |
|
|
|
# Date: 2020-05-31 |
|
|
|
# Version: 2.0 |
|
|
|
# Author: chris@cromer.cl |
|
|
|
# Options: |
|
|
|
#----------------------------------------------------------------------------- |
|
|
@ -22,23 +22,21 @@ |
|
|
|
# You should have received a copy of the GNU General Public License |
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
|
|
#----------------------------------------------------------------------------- |
|
|
|
# Dedicated to Elizabeth my cat of 20 years, Euthanasia on 2019-05-16 |
|
|
|
#----------------------------------------------------------------------------- |
|
|
|
set -o errexit # exit if error...insurance ;) |
|
|
|
set -o nounset # exit if variable not initalized |
|
|
|
set +h # disable hashall |
|
|
|
#----------------------------------------------------------------------------- |
|
|
|
# Master variables |
|
|
|
PRGNAME=${0##*/} # script name minus the path |
|
|
|
TOPDIR=${PWD} # parent directory |
|
|
|
PARENT=/usr/src/LFS-RPM # rpm build directory |
|
|
|
LOGS=LOGS # build logs directory |
|
|
|
INFOS=INFO # rpm info log directory |
|
|
|
SPECS=SPECS # rpm spec file directory |
|
|
|
PROVIDES=PROVIDES # rpm provides log directory |
|
|
|
REQUIRES=REQUIRES # rpm requires log directory |
|
|
|
RPMS=RPMS # rpm binary package directory |
|
|
|
LOGPATH=${TOPDIR}/LOGS # path to log directory |
|
|
|
PRGNAME=${0##*/} # script name minus the path |
|
|
|
TOPDIR=${PWD} # parent directory |
|
|
|
PARENT=/usr/src/LFS-RPM # rpm build directory |
|
|
|
LOGS=LOGS # build logs directory |
|
|
|
INFOS=INFO # rpm info log directory |
|
|
|
SPECS=SPECS # rpm spec file directory |
|
|
|
PROVIDES=PROVIDES # rpm provides log directory |
|
|
|
REQUIRES=REQUIRES # rpm requires log directory |
|
|
|
RPMS=RPMS # rpm binary package directory |
|
|
|
LOGPATH=${TOPDIR}/LOGS # path to log directory |
|
|
|
LC_ALL=POSIX |
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin |
|
|
|
export LC_ALL PATH |
|
|
@ -109,7 +107,7 @@ function _build { |
|
|
|
rpmbuild -ba ${RPM_SPEC} >> ${_log} 2>&1 && msg_success || msg_failure |
|
|
|
_status |
|
|
|
[ "F" == ${RPM_EXISTS} ] && die "ERROR: Binary Missing: ${RPM_BINARY}" |
|
|
|
rpm -qilp ${RPMS}/${RPM_ARCH}/${RPM_BINARY} > ${INFOS}/${RPM_NAME} 2>&1 || true |
|
|
|
rpm -qilp ${RPMS}/${RPM_ARCH}/${RPM_BINARY} > ${INFOS}/${RPM_NAME} 2>&1 || true |
|
|
|
rpm -qp --provides ${RPMS}/${RPM_ARCH}/${RPM_BINARY} > ${PROVIDES}/${RPM_NAME} 2>&1 || true |
|
|
|
rpm -qp --requires ${RPMS}/${RPM_ARCH}/${RPM_BINARY} > ${REQUIRES}/${RPM_NAME} 2>&1 || true |
|
|
|
return |
|
|
@ -197,16 +195,13 @@ function _symlinks { |
|
|
|
ln -vsf /tools/bin/{env,install,perl,printf} /usr/bin >> "${_log}" 2>&1 |
|
|
|
ln -vsf /tools/lib/libgcc_s.so{,.1} /usr/lib >> "${_log}" 2>&1 |
|
|
|
ln -vsf /tools/lib/libstdc++.{a,so{,.6}} /usr/lib >> "${_log}" 2>&1 |
|
|
|
install -vdm755 /usr/lib/pkgconfig >> "${_log}" 2>&1 |
|
|
|
ln -vsf bash /bin/sh >> "${_log}" 2>&1 |
|
|
|
msg_success |
|
|
|
return |
|
|
|
} |
|
|
|
function _glibc { |
|
|
|
ln -sf /tools/lib/gcc /usr/lib |
|
|
|
ln -sf ../lib/ld-linux-x86-64.so.2 /lib64 |
|
|
|
ln -sf ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3 |
|
|
|
rm -f /usr/include/limits.h |
|
|
|
_build |
|
|
|
_install |
|
|
|
/sbin/locale-gen |
|
|
@ -255,13 +250,6 @@ function _adjust { |
|
|
|
touch ${_log} |
|
|
|
return |
|
|
|
} |
|
|
|
function _bc { |
|
|
|
ln -sf /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6 |
|
|
|
ln -sf libncursesw.so.6 /usr/lib/libncurses.so |
|
|
|
_build |
|
|
|
_install |
|
|
|
return |
|
|
|
} |
|
|
|
function _gcc { |
|
|
|
_build |
|
|
|
_install |
|
|
@ -321,92 +309,93 @@ function _gcc { |
|
|
|
[ -e "${PROVIDES}" ] || install -vdm 755 "${PROVIDES}" |
|
|
|
[ -e "${REQUIRES}" ] || install -vdm 755 "${REQUIRES}" |
|
|
|
[ -e "${RPMS}" ] || install -vdm 755 "${RPMS}" |
|
|
|
LIST+="filesystem " # 6.5. Creating Directories |
|
|
|
LIST+="symlinks " # 6.6. Creating Essential Files and Symlinks |
|
|
|
LIST+="linux-api-headers " # 6.7. Linux-4.20.12 API Headers |
|
|
|
LIST+="man-pages " # 6.8. Man-pages-4.16 |
|
|
|
LIST+="glibc " # 6.9. Glibc-2.29 |
|
|
|
LIST+="tzdata " # 6.9.2.2. Adding time zone data |
|
|
|
LIST+="adjust " # 6.10. Adjusting the Toolchain |
|
|
|
LIST+="zlib " # 6.11. Zlib-1.2.11 |
|
|
|
LIST+="file " # 6.12. File-5.36 |
|
|
|
LIST+="readline " # 6.13. Readline-8.0 |
|
|
|
LIST+="m4 " # 6.14. M4-1.4.18 |
|
|
|
LIST+="bc " # 6.15. Bc-1.07.1 |
|
|
|
LIST+="binutils " # 6.16. Binutils-2.32 |
|
|
|
LIST+="gmp " # 6.17. GMP-6.1.2 |
|
|
|
LIST+="mpfr " # 6.18. MPFR-4.0.2 |
|
|
|
LIST+="mpc " # 6.19. MPC-1.1.0 |
|
|
|
LIST+="shadow " # 6.20. Shadow-4.6 |
|
|
|
LIST+="gcc " # 6.21. GCC-8.2.0 |
|
|
|
LIST+="bzip2 " # 6.22. Bzip2-1.0.6 |
|
|
|
LIST+="pkg-config " # 6.23. Pkg-config-0.29.2 |
|
|
|
LIST+="ncurses " # 6.24. Ncurses-6.1 |
|
|
|
LIST+="attr " # 6.25. Attr-2.4.48 |
|
|
|
LIST+="acl " # 6.26. Acl-2.2.53 |
|
|
|
LIST+="libcap " # 6.27. Libcap-2.26 |
|
|
|
LIST+="sed " # 6.28. Sed-4.7 |
|
|
|
LIST+="psmisc " # 6.29. Psmisc-23.2 |
|
|
|
LIST+="iana-etc " # 6.30. Iana-Etc-2.30 |
|
|
|
LIST+="bison " # 6.31. Bison-3.3.2 |
|
|
|
LIST+="flex " # 6.32. Flex-2.6.4 |
|
|
|
LIST+="grep " # 6.33. Grep-3.3 |
|
|
|
LIST+="bash " # 6.34. Bash-5.0 |
|
|
|
LIST+="libtool " # 6.35. Libtool-2.4.6 |
|
|
|
LIST+="gdbm " # 6.36. GDBM-1.18.1 |
|
|
|
LIST+="gperf " # 6.37. Gperf-3.1 |
|
|
|
LIST+="expat " # 6.38. Expat-2.2.6 |
|
|
|
LIST+="inetutils " # 6.39. Inetutils-1.9.4 |
|
|
|
LIST+="perl " # 6.40. Perl-5.28.1 |
|
|
|
LIST+="XML-Parser " # 6.41. XML::Parser-2.44 |
|
|
|
LIST+="intltool " # 6.42. Intltool-0.51.0 |
|
|
|
LIST+="autoconf " # 6.43. Autoconf-2.69 |
|
|
|
LIST+="automake " # 6.44. Automake-1.16.1 |
|
|
|
LIST+="xz " # 6.45. Xz-5.2.4 |
|
|
|
LIST+="kmod " # 6.46. Kmod-26 |
|
|
|
LIST+="gettext " # 6.47. Gettext-0.19.8.1 |
|
|
|
LIST+="libelf " # 6.48. Libelf from Elfutils-0.176 |
|
|
|
LIST+="libffi " # 6.49. Libffi-3.2.1 |
|
|
|
LIST+="openssl " # 6.50. OpenSSL-1.1.1a |
|
|
|
LIST+="python3 " # 6.51. Python-3.7.2 |
|
|
|
LIST+="ninja " # 6.52. Ninja-1.9.0 |
|
|
|
LIST+="meson " # 6.53. Meson-0.49.2 |
|
|
|
LIST+="coreutils " # 6.54. Coreutils-8.30 |
|
|
|
LIST+="check " # 6.55. Check-0.12.0 |
|
|
|
LIST+="diffutils " # 6.56. Diffutils-3.7 |
|
|
|
LIST+="gawk " # 6.57. Gawk-4.2.1 |
|
|
|
LIST+="findutils " # 6.58. Findutils-4.6.0 |
|
|
|
LIST+="groff " # 6.59. Groff-1.22.4 |
|
|
|
LIST+="grub " # 6.60. GRUB-2.02 |
|
|
|
LIST+="less " # 6.61. Less-530 |
|
|
|
LIST+="gzip " # 6.62. Gzip-1.10 |
|
|
|
LIST+="iproute2 " # 6.63. IPRoute2-4.20.0 |
|
|
|
LIST+="kbd " # 6.64. Kbd-2.0.4 |
|
|
|
LIST+="libpipeline " # 6.65. Libpipeline-1.5.1 |
|
|
|
LIST+="make " # 6.66. Make-4.2.1 |
|
|
|
LIST+="patch " # 6.67. Patch-2.7.6 |
|
|
|
LIST+="man-db " # 6.68. Man-DB-2.8.5 |
|
|
|
LIST+="tar " # 6.69. Tar-1.31 |
|
|
|
LIST+="texinfo " # 6.70. Texinfo-6.5 |
|
|
|
LIST+="vim " # 6.71. Vim-8.1 |
|
|
|
LIST+="procps-ng " # 6.72. Procps-ng-3.3.15 |
|
|
|
LIST+="util-linux " # 6.73. Util-linux-2.33.1 |
|
|
|
LIST+="e2fsprogs " # 6.74. E2fsprogs-1.44.5 |
|
|
|
LIST+="sysklogd " # 6.75. Sysklogd-1.5.1 |
|
|
|
LIST+="sysvinit " # 6.76. Sysvinit-2.93 |
|
|
|
LIST+="eudev " # 6.77. Eudev-3.2.7 |
|
|
|
LIST+="filesystem " # Creating Directories |
|
|
|
LIST+="symlinks " # Creating Essential Files and Symlinks |
|
|
|
LIST+="linux-api-headers " # Linux-5.5.3 API Headers |
|
|
|
LIST+="man-pages " # Man-pages-5.05 |
|
|
|
LIST+="glibc " # Glibc-2.31 |
|
|
|
LIST+="tzdata " # Adding time zone data |
|
|
|
LIST+="adjust " # Adjusting the Toolchain |
|
|
|
LIST+="zlib " # Zlib-1.2.11 |
|
|
|
LIST+="bzip2 " # Bzip2-1.0.8 |
|
|
|
LIST+="xz " # Xz-5.2.4 |
|
|
|
LIST+="file " # File-5.38 |
|
|
|
LIST+="readline " # Readline-8.0 |
|
|
|
LIST+="m4 " # M4-1.4.18 |
|
|
|
LIST+="bc " # Bc-2.5.3 |
|
|
|
LIST+="binutils " # Binutils-2.34 |
|
|
|
LIST+="gmp " # GMP-6.2.0 |
|
|
|
LIST+="mpfr " # MPFR-4.0.2 |
|
|
|
LIST+="mpc " # MPC-1.1.0 |
|
|
|
LIST+="attr " # Attr-2.4.48 |
|
|
|
LIST+="acl " # Acl-2.2.53 |
|
|
|
LIST+="shadow " # Shadow-4.8.1 |
|
|
|
LIST+="gcc " # GCC-9.2.0 |
|
|
|
LIST+="pkg-config " # Pkg-config-0.29.2 |
|
|
|
LIST+="ncurses " # Ncurses-6.2 |
|
|
|
LIST+="libcap " # Libcap-2.31 |
|
|
|
LIST+="sed " # Sed-4.8 |
|
|
|
LIST+="psmisc " # Psmisc-23.2 |
|
|
|
LIST+="iana-etc " # Iana-Etc-2.30 |
|
|
|
LIST+="bison " # Bison-3.5.2 |
|
|
|
LIST+="flex " # Flex-2.6.4 |
|
|
|
LIST+="grep " # Grep-3.4 |
|
|
|
LIST+="bash " # Bash-5.0 |
|
|
|
LIST+="libtool " # Libtool-2.4.6 |
|
|
|
LIST+="gdbm " # GDBM-1.18.1 |
|
|
|
LIST+="gperf " # Gperf-3.1 |
|
|
|
LIST+="expat " # Expat-2.2.9 |
|
|
|
LIST+="inetutils " # Inetutils-1.9.4 |
|
|
|
LIST+="perl " # Perl-5.30.1 |
|
|
|
LIST+="XML-Parser " # XML::Parser-2.46 |
|
|
|
LIST+="intltool " # Intltool-0.51.0 |
|
|
|
LIST+="autoconf " # Autoconf-2.69 |
|
|
|
LIST+="automake " # Automake-1.16.1 |
|
|
|
LIST+="kmod " # Kmod-26 |
|
|
|
LIST+="gettext " # Gettext-0.20.1 |
|
|
|
LIST+="libelf " # Libelf from Elfutils-0.178 |
|
|
|
LIST+="libffi " # Libffi-3.3 |
|
|
|
LIST+="openssl " # OpenSSL-1.1.1d |
|
|
|
LIST+="python3 " # Python-3.8.1 |
|
|
|
LIST+="ninja " # Ninja-1.10.0 |
|
|
|
LIST+="meson " # Meson-0.53.1 |
|
|
|
LIST+="coreutils " # Coreutils-8.31 |
|
|
|
LIST+="check " # Check-0.14.0 |
|
|
|
LIST+="diffutils " # Diffutils-3.7 |
|
|
|
LIST+="gawk " # Gawk-5.0.1 |
|
|
|
LIST+="findutils " # Findutils-4.7.0 |
|
|
|
LIST+="groff " # Groff-1.22.4 |
|
|
|
LIST+="grub " # GRUB-2.04 |
|
|
|
LIST+="less " # Less-551 |
|
|
|
LIST+="gzip " # Gzip-1.10 |
|
|
|
LIST+="zstd " # Zstd-1.4.4 |
|
|
|
LIST+="iproute2 " # IPRoute2-5.5.0 |
|
|
|
LIST+="kbd " # Kbd-2.2.0 |
|
|
|
LIST+="libpipeline " # Libpipeline-1.5.2 |
|
|
|
LIST+="make " # Make-4.3 |
|
|
|
LIST+="patch " # Patch-2.7.6 |
|
|
|
LIST+="man-db " # Man-DB-2.9.0 |
|
|
|
LIST+="tar " # Tar-1.32 |
|
|
|
LIST+="texinfo " # Texinfo-6.7 |
|
|
|
LIST+="vim " # Vim-8.2.0190 |
|
|
|
LIST+="procps-ng " # Procps-ng-3.3.15 |
|
|
|
LIST+="util-linux " # Util-linux-2.35.1 |
|
|
|
LIST+="e2fsprogs " # E2fsprogs-1.45.5 |
|
|
|
LIST+="sysklogd " # Sysklogd-1.5.1 |
|
|
|
LIST+="sysvinit " # Sysvinit-2.96 |
|
|
|
LIST+="eudev " # Eudev-3.2.9 |
|
|
|
# Chapter 7 |
|
|
|
LIST+="lfs-bootscripts " # lfs-bootscripts |
|
|
|
LIST+="cpio " # cpio |
|
|
|
LIST+="cpio " # cpio |
|
|
|
LIST+="mkinitramfs " # mkinitramfs |
|
|
|
LIST+="linux " # 8.3. Linux-4.20.12 |
|
|
|
LIST+="linux " # Linux-5.5.3 |
|
|
|
# ADDONS |
|
|
|
LIST+="popt " # popt |
|
|
|
LIST+="rpm " # rpm |
|
|
|
LIST+="wget " # wget |
|
|
|
LIST+="popt " # popt |
|
|
|
LIST+="rpm " # rpm |
|
|
|
LIST+="wget " # wget |
|
|
|
LIST+="linux-firmware " # linux-firmware |
|
|
|
LIST+="python2 " # python2 |
|
|
|
LIST+="base " # lfs base packages meta package |
|
|
|
LIST+="python2 " # python2 |
|
|
|
LIST+="base " # lfs base packages meta package |
|
|
|
for i in ${LIST};do |
|
|
|
case ${i} in |
|
|
|
symlinks) _log="${LOGS}/symlinks" |
|
|
@ -430,13 +419,6 @@ for i in ${LIST};do |
|
|
|
_adjust |
|
|
|
fi |
|
|
|
;; |
|
|
|
bc) _params "${SPECS}/${i}.spec" |
|
|
|
if [ "T" = "${RPM_EXISTS}" ]; then |
|
|
|
msg "Skipping: ${i}" |
|
|
|
else |
|
|
|
_bc |
|
|
|
fi |
|
|
|
;; |
|
|
|
gcc) _params "${SPECS}/${i}.spec" |
|
|
|
if [ "T" = "${RPM_EXISTS}" ]; then |
|
|
|
msg "Skipping: ${i}" |
|
|
@ -444,17 +426,6 @@ for i in ${LIST};do |
|
|
|
_gcc |
|
|
|
fi |
|
|
|
;; |
|
|
|
util-linux) _params "${SPECS}/${i}.spec" |
|
|
|
if [ "T" = "${RPM_EXISTS}" ]; then |
|
|
|
msg "Skipping: ${i}" |
|
|
|
else |
|
|
|
[ -e /usr/include/blkid ] && rm -rf /usr/include/blkid |
|
|
|
[ -e /usr/include/libmount ] && rm -rf /usr/include/libmount |
|
|
|
[ -e /usr/include/uuid ] && rm -rf /usr/include/uuid |
|
|
|
_build |
|
|
|
_install |
|
|
|
fi |
|
|
|
;; |
|
|
|
*) _params "${SPECS}/${i}.spec" |
|
|
|
if [ "T" = "${RPM_EXISTS}" ]; then |
|
|
|
msg "Skipping: ${i}" |
|
|
|