|
2 | 2 | # Linux Deploy Component |
3 | 3 | # (c) Anton Skshidlevsky <meefik@gmail.com>, GPLv3 |
4 | 4 |
|
| 5 | +# 31 doesn't support while rpm2cpio in busybox doesn't support zstd |
5 | 6 | [ -n "${SUITE}" ] || SUITE="30" |
6 | 7 |
|
7 | 8 | if [ -z "${ARCH}" ] |
|
14 | 15 | esac |
15 | 16 | fi |
16 | 17 |
|
17 | | -[ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://dl.fedoraproject.org/pub/archive/" |
| 18 | +[ -n "${SOURCE_PATH}" ] || SOURCE_PATH="http://192.168.1.10/pub/fedoraproject.org" |
18 | 19 |
|
19 | 20 | dnf_install() |
20 | 21 | { |
21 | 22 | local packages="$@" |
22 | 23 | [ -n "${packages}" ] || return 1 |
23 | 24 | (set -e |
24 | | - chroot_exec -u root dnf --nogpgcheck -y install ${packages} |
25 | | - chroot_exec -u root dnf clean packages |
| 25 | + chroot_exec -u root dnf -y install ${packages} |
26 | 26 | exit 0) |
27 | 27 | return $? |
28 | 28 | } |
29 | 29 |
|
30 | | -yum_repository() |
31 | | -{ |
32 | | - find "${CHROOT_DIR}/etc/yum.repos.d/" -name '*.repo' | while read f; do sed -i 's/^enabled=.*/enabled=0/g' "${f}"; done |
33 | | - local repo_file="${CHROOT_DIR}/etc/yum.repos.d/fedora-${SUITE}-${ARCH}.repo" |
34 | | - local repo_url |
35 | | - if [ "${ARCH}" = "i386" ] |
36 | | - then repo_url="${SOURCE_PATH%/}/fedora-secondary/releases/${SUITE}/Everything/${ARCH}/os" |
37 | | - else repo_url="${SOURCE_PATH%/}/fedora/linux/releases/${SUITE}/Everything/${ARCH}/os" |
38 | | - fi |
39 | | - echo "[fedora-${SUITE}-${ARCH}]" > "${repo_file}" |
40 | | - echo "name=Fedora ${SUITE} - ${ARCH}" >> "${repo_file}" |
41 | | - echo "failovermethod=priority" >> "${repo_file}" |
42 | | - echo "baseurl=${repo_url}" >> "${repo_file}" |
43 | | - echo "enabled=1" >> "${repo_file}" |
44 | | - echo "metadata_expire=7d" >> "${repo_file}" |
45 | | - echo "gpgcheck=0" >> "${repo_file}" |
46 | | - chmod 644 "${repo_file}" |
47 | | -} |
48 | | - |
49 | 30 | do_install() |
50 | 31 | { |
51 | 32 | is_archive "${SOURCE_PATH}" && return 0 |
52 | 33 |
|
53 | 34 | msg ":: Installing ${COMPONENT} ... " |
54 | 35 |
|
55 | | - local core_packages="acl alternatives audit-libs basesystem bash brotli bzip2-libs ca-certificates coreutils cracklib crypto-policies cryptsetup-libs curl cyrus-sasl-lib dbus dbus-tools dbus-broker dbus-common device-mapper device-mapper-libs dnf dnf-data dnf-yum elfutils-default-yama-scope elfutils-libelf elfutils-libs expat fedora-gpg-keys fedora-release fedora-release-container fedora-repos file-libs filesystem gawk gdbm-libs generic-release generic-release-common glib2 glibc glibc-common glibc-minimal-langpack gmp gnupg2 gnutls gpgme grep gzip ima-evm-utils iptables-libs json-c keyutils-libs kmod-libs krb5-libs libacl libarchive libargon2 libassuan libattr libblkid libcap libcap-ng libcom_err libcomps libcurl libcurl-minimal libdb libdb-utils libdnf libfdisk libffi libgcc libgcrypt libgomp libgpg-error libidn2 libksba libmetalink libmodulemd libmodulemd1 libmount libnghttp2 libnsl2 libpcap libpsl libpwquality librepo libreport-filesystem libseccomp libselinux libsemanage libsepol libsigsegv libsmartcols libsolv libssh libsss_idmap libsss_nss_idmap libstdc++ libtasn1 libtirpc libunistring libusbx libutempter libuuid libverto libxcrypt libxml2 libyaml libzstd lua-libs lz4-libs mpfr ncurses ncurses-base ncurses-libs nettle npth openldap openssl openssl-libs p11-kit p11-kit-trust pam pcre pcre2 popt publicsuffix-list-dafsa python3 python3-dnf python3-gpg python3-hawkey python3-libcomps python3-libdnf python3-libs python3-rpm python-pip-wheel python-setuptools-wheel qrencode-libs readline rootfiles rpm rpm-build-libs rpm-libs rpm-sign-libs sed setup shadow-utils sqlite-libs sssd-client sudo systemd systemd-libs systemd-pam systemd-rpm-macros tss2 tzdata util-linux vim-minimal xz-libs zchunk-libs zlib" |
| 36 | + local core_packages="acl alternatives audit-libs basesystem bash brotli bzip2-libs ca-certificates coreutils coreutils-common cracklib crypto-policies cryptsetup-libs curl cyrus-sasl-lib dbus dbus-broker dbus-common device-mapper device-mapper-libs dnf dnf-data dnf-yum elfutils-default-yama-scope elfutils-libelf elfutils-libs expat fedora-gpg-keys fedora-release fedora-release-common fedora-repos file-libs filesystem findutils gawk gdbm-libs glib2 glibc glibc-common glibc-minimal-langpack gmp gnupg2 gnutls gpgme grep gzip ima-evm-utils iptables-libs json-c keyutils-libs kmod-libs krb5-libs libacl libarchive libargon2 libassuan libattr libblkid libcap libcap-ng libcom_err libcomps libcurl libdb libdb-utils libdnf libfdisk libffi libgcc libgcrypt libgpg-error libidn2 libksba libmetalink libmodulemd1 libmount libnghttp2 libnsl2 libpcap libpsl libpwquality librepo libreport-filesystem libseccomp libselinux libsemanage libsepol libsigsegv libsmartcols libsolv libssh libsss_idmap libsss_nss_idmap libstdc++ libtasn1 libtirpc libunistring libusbx libutempter libuuid libverto libxcrypt libxml2 libyaml libzstd lua-libs lz4-libs mpfr ncurses ncurses-base ncurses-libs nettle npth openldap openssl-libs p11-kit p11-kit-trust pam pcre pcre2 popt publicsuffix-list-dafsa python3 python3-dnf python3-gpg python3-hawkey python3-libcomps python3-libdnf python3-libs python3-rpm python-pip-wheel python-setuptools-wheel qrencode-libs readline rootfiles rpm rpm-build-libs rpm-libs rpm-sign-libs sed setup shadow-utils sqlite-libs sssd-client sudo systemd systemd-libs systemd-pam systemd-rpm-macros tar tzdata util-linux vim-minimal xz-libs zchunk-libs zlib" |
56 | 37 |
|
57 | 38 | local repo_url |
58 | 39 | if [ "${ARCH}" = "i386" ] |
@@ -111,28 +92,31 @@ do_install() |
111 | 92 |
|
112 | 93 | component_exec core/mnt core/net |
113 | 94 |
|
114 | | - # msg -n "Updating repository ... " |
115 | | - # yum_repository |
116 | | - # is_ok "fail" "done" |
| 95 | + # TODO: Remove this before creating PR |
| 96 | + msg -n "Replacing urls to local mirror ..." |
| 97 | + chroot_exec /usr/bin/find /etc/yum.repos.d/ -name "*.repo" -type f -exec /usr/bin/sed -i 's/#baseurl=https\?:\/\/download.fedoraproject.org\/pub/baseurl=http:\/\/192.168.1.10\/pub\/fedoraproject.org/g' {} \; |
| 98 | + is_ok "fail" "done" |
117 | 99 |
|
118 | | - msg -n "Setting up dnf excludes ... " |
119 | | - chroot_exec /bin/echo "\nkernel* dosfstools e2fsprogs fuse-libs gnupg2-smime libss pinentry shared-mime-info trousers xkeyboard-config grubby glibc-langpack-en cracklib-dicts" > /etc/dnf/dnf.conf |
120 | | - s_ok "fail" "done" |
| 100 | + # TODO: Remove this before creating PR |
| 101 | + msg -n "Disabling metalink ..." |
| 102 | + chroot_exec /usr/bin/find /etc/yum.repos.d/ -name "*.repo" -type f -exec /usr/bin/sed -i 's/metalink=/#metalink=/g' {} \; |
| 103 | + is_ok "fail" "done" |
121 | 104 |
|
122 | | - msg "Installing minimal environment: " |
123 | | - dnf_install @minimal-environment --exclude=kernel,dosfstools,e2fsprogs,fuse-libs,gnupg2-smime,libss,pinentry,shared-mime-info,trousers,xkeyboard-config,grubby,glibc-langpack-en,cracklib-dicts |
124 | | - is_ok || return 1 |
| 105 | + msg -n "Setting dnf excludes ..." |
| 106 | + echo "exclude=kernel* *-firmware grubby" >> "${CHROOT_DIR}"/etc/dnf/dnf.conf |
| 107 | + is_ok "fail" "done" |
| 108 | + |
| 109 | + # TODO: Think about it before creating PR |
| 110 | + msg -n "Upgrading packages ..." |
| 111 | + chroot_exec -u root dnf -y upgrade --refresh |
| 112 | + is_ok "fail" "done" |
125 | 113 |
|
126 | 114 | if [ -n "${EXTRA_PACKAGES}" ]; then |
127 | 115 | msg "Installing extra packages: " |
128 | 116 | dnf_install ${EXTRA_PACKAGES} |
129 | 117 | is_ok || return 1 |
130 | 118 | fi |
131 | 119 |
|
132 | | - msg -n "Cleaning up dnf cache ... " |
133 | | - chroot_exec dnf clean all |
134 | | - s_ok "fail" "done" |
135 | | - |
136 | 120 | return 0 |
137 | 121 | } |
138 | 122 |
|
|
0 commit comments