lfs-buildscripts/CH03-get-sources.sh

156 lines
7.8 KiB
Bash
Raw Normal View History

2024-10-02 04:38:19 +08:00
#!/bin/bash
2024-10-03 09:17:14 +08:00
LFS=/mnt/newlfs
2024-10-02 04:38:19 +08:00
source versions.sh
GLSOURCES="${LFS}/sources"
2024-10-06 11:46:48 +08:00
CWD="`pwd`"
2024-10-02 04:38:19 +08:00
[ ! -d ${GLSOURCES} ] && mkdir ${GLSOURCES}
function getSource {
URL="`echo $1 |xargs`"
EXPECTED="`echo $2 |xargs`"
FILE="`echo $3 |xargs`"
echo "Retrieving ${FILE}"
tries=0
while [ ${tries} -lt 4 ]; do
if [ ! -f ${FILE} ]; then
wget ${URL}
fi
CHECK="`sha256sum ${FILE} |awk ' { print $1 } ' `"
if [ "${CHECK}" == "${EXPECTED}" ]; then
return
else
rm -f ${FILE}
sleep 3
fi
tries=$(expr ${tries} + 1)
done
myfail "failed to retrieve ${URL}"
}
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-07 07:10:08 +08:00
[ -f ${HOME}/lfs-sources.tar ] && tar -xpf ${HOME}/lfs-sources.tar
2024-10-07 01:55:01 +08:00
2024-10-02 04:38:19 +08:00
getSource "${acl_dnl}" "${acl_sha256}" "${acl_tarball}"
getSource "${attr_dnl}" "${attr_sha256}" "${attr_tarball}"
getSource "${autoconf_dnl}" "${autoconf_sha256}" "${autoconf_tarball}"
getSource "${automake_dnl}" "${automake_sha256}" "${automake_tarball}"
getSource "${bash_dnl}" "${bash_sha256}" "${bash_tarball}"
getSource "${bc_dnl}" "${bc_sha256}" "${bc_tarball}"
getSource "${binutils_dnl}" "${binutils_sha256}" "${binutils_tarball}"
getSource "${bison_dnl}" "${bison_sha256}" "${bison_tarball}"
getSource "${bzip2_dnl}" "${bzip2_sha256}" "${bzip2_tarball}"
getSource "${bzip2_patch_dnl}" "${bzip2_patch_sha256}" "${bzip2_patch_file}"
getSource "${check_dnl}" "${check_sha256}" "${check_tarball}"
getSource "${coreutils_dnl}" "${coreutils_sha256}" "${coreutils_tarball}"
getSource "${coreutils_patch_dnl}" "${coreutils_patch_sha256}" "${coreutils_patch_file}"
2024-10-05 06:46:05 +08:00
getSource "${cracklib_dnl}" "${cracklib_sha256}" "${cracklib_tarball}"
getSource "${cracklib_words_english_dnl}" "${cracklib_words_english_sha256}" "${cracklib_words_english_tarball}"
2024-10-10 15:19:11 +08:00
getSource "${curl_dnl}" "${curl_sha256}" "${curl_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${dbus_dnl}" "${dbus_sha256}" "${dbus_tarball}"
2024-10-05 04:11:43 +08:00
getSource "${dejagnu_dnl}" "${dejagnu_sha256}" "${dejagnu_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${diffutils_dnl}" "${diffutils_sha256}" "${diffutils_tarball}"
getSource "${e2fsprogs_dnl}" "${e2fsprogs_sha256}" "${e2fsprogs_tarball}"
getSource "${elfutils_dnl}" "${elfutils_sha256}" "${elfutils_tarball}"
getSource "${expat_dnl}" "${expat_sha256}" "${expat_tarball}"
getSource "${expect_dnl}" "${expect_sha256}" "${expect_tarball}"
getSource "${expect_patch_dnl}" "${expect_patch_sha256}" "${expect_patch_file}"
getSource "${file_dnl}" "${file_sha256}" "${file_tarball}"
getSource "${findutils_dnl}" "${findutils_sha256}" "${findutils_tarball}"
getSource "${flex_dnl}" "${flex_sha256}" "${flex_tarball}"
getSource "${flit_core_dnl}" "${flit_core_sha256}" "${flit_core_tarball}"
getSource "${gawk_dnl}" "${gawk_sha256}" "${gawk_tarball}"
getSource "${gcc_dnl}" "${gcc_sha256}" "${gcc_tarball}"
getSource "${gdbm_dnl}" "${gdbm_sha256}" "${gdbm_tarball}"
getSource "${gettext_dnl}" "${gettext_sha256}" "${gettext_tarball}"
getSource "${glibc_dnl}" "${glibc_sha256}" "${glibc_tarball}"
getSource "${glibc_patch_dnl}" "${glibc_patch_sha256}" "${glibc_patch_file}"
getSource "${gmp_dnl}" "${gmp_sha256}" "${gmp_tarball}"
getSource "${gperf_dnl}" "${gperf_sha256}" "${gperf_tarball}"
2024-10-09 16:48:22 +08:00
getSource "${gpm_dnl}" "${gpm_sha256}" "${gpm_tarball}"
getSource "${gpm_patch_dnl}" "${gpm_patch_sha256}" "${gpm_patch_file}"
2024-10-02 04:38:19 +08:00
getSource "${grep_dnl}" "${grep_sha256}" "${grep_tarball}"
getSource "${groff_dnl}" "${groff_sha256}" "${groff_tarball}"
getSource "${grub_dnl}" "${grub_sha256}" "${grub_tarball}"
getSource "${gzip_dnl}" "${gzip_sha256}" "${gzip_tarball}"
getSource "${iana_etc_dnl}" "${iana_etc_sha256}" "${iana_etc_tarball}"
getSource "${inetutils_dnl}" "${inetutils_sha256}" "${inetutils_tarball}"
getSource "${intltool_dnl}" "${intltool_sha256}" "${intltool_tarball}"
getSource "${iproute2_dnl}" "${iproute2_sha256}" "${iproute2_tarball}"
getSource "${jinja2_dnl}" "${jinja2_sha256}" "${jinja2_tarball}"
getSource "${kbd_dnl}" "${kbd_sha256}" "${kbd_tarball}"
getSource "${kbd_patch_dnl}" "${kbd_patch_sha256}" "${kbd_patch_file}"
getSource "${kmod_dnl}" "${kmod_sha256}" "${kmod_tarball}"
getSource "${less_dnl}" "${less_sha256}" "${less_tarball}"
getSource "${libcap_dnl}" "${libcap_sha256}" "${libcap_tarball}"
getSource "${libffi_dnl}" "${libffi_sha256}" "${libffi_tarball}"
2024-10-10 12:26:41 +08:00
getSource "${libidn2_dnl}" "${libidn2_sha256}" "${libidn2_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${libpipeline_dnl}" "${libpipeline_sha256}" "${libpipeline_tarball}"
2024-10-10 12:26:41 +08:00
getSource "${libpsl_dnl}" "${libpsl_sha256}" "${libpsl_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${libressl_dnl}" "${libressl_sha256}" "${libressl_tarball}"
2024-10-10 15:19:11 +08:00
getSource "${libtasn1_dnl}" "${libtasn1_sha256}" "${libtasn1_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${libtool_dnl}" "${libtool_sha256}" "${libtool_tarball}"
2024-10-10 12:26:41 +08:00
getSource "${libunistring_dnl}" "${libunistring_sha256}" "${libunistring_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${libxcrypt_dnl}" "${libxcrypt_sha256}" "${libxcrypt_tarball}"
getSource "${linux_lts_dnl}" "${linux_lts_sha256}" "${linux_lts_tarball}"
2024-10-13 07:37:18 +08:00
getSource "${linux_firmware_dnl}" "${linux_firmware_sha256}" "${linux_firmware_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${lz4_dnl}" "${lz4_sha256}" "${lz4_tarball}"
getSource "${m4_dnl}" "${m4_sha256}" "${m4_tarball}"
getSource "${make_dnl}" "${make_sha256}" "${make_tarball}"
2024-10-10 17:08:23 +08:00
getSource "${makeca_dnl}" "${makeca_sha256}" "${makeca_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${mandb_dnl}" "${mandb_sha256}" "${mandb_tarball}"
getSource "${man_pages_dnl}" "${man_pages_sha256}" "${man_pages_tarball}"
getSource "${markupsafe_dnl}" "${markupsafe_sha256}" "${markupsafe_tarball}"
getSource "${meson_dnl}" "${meson_sha256}" "${meson_tarball}"
getSource "${mpc_dnl}" "${mpc_sha256}" "${mpc_tarball}"
getSource "${mpfr_dnl}" "${mpfr_sha256}" "${mpfr_tarball}"
getSource "${ncurses_dnl}" "${ncurses_sha256}" "${ncurses_tarball}"
getSource "${ninja_dnl}" "${ninja_sha256}" "${ninja_tarball}"
2024-10-08 02:17:47 +08:00
getSource "${openssl_dnl}" "${openssl_sha256}" "${openssl_tarball}"
2024-10-10 15:19:11 +08:00
getSource "${p11kit_dnl}" "${p11kit_sha256}" "${p11kit_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${patch_dnl}" "${patch_sha256}" "${patch_tarball}"
getSource "${perl_dnl}" "${perl_sha256}" "${perl_tarball}"
getSource "${pkgconf_dnl}" "${pkgconf_sha256}" "${pkgconf_tarball}"
getSource "${procps_dnl}" "${procps_sha256}" "${procps_tarball}"
getSource "${psmisc_dnl}" "${psmisc_sha256}" "${psmisc_tarball}"
getSource "${python_dnl}" "${python_sha256}" "${python_tarball}"
getSource "${pythondoc_dnl}" "${pythondoc_sha256}" "${pythondoc_tarball}"
getSource "${readline_dnl}" "${readline_sha256}" "${readline_tarball}"
getSource "${sed_dnl}" "${sed_sha256}" "${sed_tarball}"
getSource "${setuptools_dnl}" "${setuptools_sha256}" "${setuptools_tarball}"
getSource "${shadow_dnl}" "${shadow_sha256}" "${shadow_tarball}"
getSource "${systemd_dnl}" "${systemd_sha256}" "${systemd_tarball}"
getSource "${systemd_man_dnl}" "${systemd_man_sha256}" "${systemd_man_tarball}"
2024-10-09 16:48:22 +08:00
getSource "${systemd_units_dnl}" "${systemd_units_sha256}" "${systemd_units_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${tar_dnl}" "${tar_sha256}" "${tar_tarball}"
getSource "${tcl_dnl}" "${tcl_sha256}" "${tcl_tarball}"
getSource "${tcl_doc_dnl}" "${tcl_doc_sha256}" "${tcl_doc_tarball}"
getSource "${texinfo_dnl}" "${texinfo_sha256}" "${texinfo_tarball}"
getSource "${tzdata_dnl}" "${tzdata_sha256}" "${tzdata_tarball}"
getSource "${util_linux_dnl}" "${util_linux_sha256}" "${util_linux_tarball}"
getSource "${vim_dnl}" "${vim_sha256}" "${vim_tarball}"
2024-10-10 12:26:41 +08:00
getSource "${wget_dnl}" "${wget_sha256}" "${wget_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${wheel_dnl}" "${wheel_sha256}" "${wheel_tarball}"
getSource "${xml_parser_dnl}" "${xml_parser_sha256}" "${xml_parser_tarball}"
2024-10-02 12:32:00 +08:00
getSource "${xz_dnl}" "${xz_sha256}" "${xz_tarball}"
2024-10-02 04:38:19 +08:00
getSource "${zlib_dnl}" "${zlib_sha256}" "${zlib_tarball}"
getSource "${zstd_dnl}" "${zstd_sha256}" "${zstd_tarball}"
2024-10-07 01:55:01 +08:00
cp ${CWD}/CH8Build/libressl-${libressl_version}-cnf-name.patch .
2024-10-10 17:08:23 +08:00
cp ${CWD}/CH8Build/make-ca-${makeca_version}-libressl.patch .
2024-10-10 17:50:07 +08:00
cp ${CWD}/CH8Build/certdata-dist.txt .
2024-10-02 04:38:19 +08:00
2024-10-07 07:10:08 +08:00
rm -f ${HOME}/lfs-sources.tar
2024-10-07 08:40:59 +08:00
tar -cpf ${HOME}/lfs-sources.tar .
2024-10-07 07:10:08 +08:00
echo "Sources backed-up as ${HOME}/lfs-sources.tar"
2024-10-02 04:38:19 +08:00
2024-10-07 01:55:01 +08:00
popd > /dev/null 2>&1
2024-10-02 04:38:19 +08:00