#!/bin/sh # # $Id: getpackages-anaconda,v 1.3 2019/09/29 13:54:11 kabe Exp $ yum_conf=/tmp/g$$.yum.conf cat << 'EOF' > $yum_conf [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=0 plugins=1 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release reposdir= [c7-media] name=CentOS-$releasever - Media baseurl=file:///media/cdrom gpgcheck=0 enabled=1 EOF trap 'rm /tmp/g'"$$"'.*; trap - 0 1 2 15; exit' 0 1 2 15 ANACONDA_PKGS="" installpkg () { for i in $@; do echo Querying for package $i >&2 Q=`repoquery -c $yum_conf --qf '%{NAME}' "$i"` if [ -n "$Q" ]; then ANACONDA_PKGS="$ANACONDA_PKGS $Q" else echo installpkg $i failed: No 'package(s)' available to install >&2 # continue fi done } # packages required for anaconda, extracted from # /usr/share/lorax/runtime-install.tmpl ## anaconda package installpkg anaconda anaconda-widgets ## anaconda deps that aren't in the RPM installpkg tmux installpkg firstboot installpkg iscsi-initiator-utils ## Other available payloads installpkg rpm-ostree ## kernel and firmware installpkg kernel #%if basearch != "s390x": installpkg *-firmware #%endif ## arch-specific packages (bootloaders etc.) #%if basearch == "aarch64": # installpkg efibootmgr grub2-efi-aa64-cdboot grubby shim-aa64 # installpkg grub2-tools grub2-tools-minimal grub2-tools-extra #%endif #%if basearch in ("arm", "armhfp"): # installpkg kernel-lpae kernel-tegra # installpkg uboot-tools #%endif #%if basearch == "i386": installpkg kernel-PAE gpart #%endif #%if basearch == "x86_64": # installpkg grub2-tools-efi # installpkg shim-x64 grub2-efi-x64-cdboot #%endif #%if basearch in ("i386", "x86_64"): installpkg biosdevname memtest86+ syslinux installpkg grub2-tools grub2-tools-minimal grub2-tools-extra installpkg efibootmgr installpkg shim-ia32 grub2-efi-ia32-cdboot #%endif #%if basearch in ("ppc", "ppc64", "ppc64le"): # installpkg fbset hfsutils kernel-bootwrapper ppc64-utils # installpkg grub2-tools grub2-tools-minimal grub2-tools-extra # installpkg grub2-${basearch} #%endif #%if basearch == "s390x": # installpkg lsscsi s390utils-base s390utils-cmsfs-fuse s390utils-hmcdrvfs #%endif ## yay, plymouth installpkg plymouth ## extra dracut modules installpkg anaconda-dracut dracut-network dracut-config-generic dracut-fips ## redhat-upgrade-dracut handles upgrades on RHEL installpkg redhat-upgrade-dracut redhat-upgrade-dracut-plymouth #log "Looking for extra redhat-upgrade-dracut packages..." #installpkg *-redhat-upgrade-dracut installpkg redhat-release-eula ## rpcbind or portmap needed by dracut nfs module installpkg rpcbind ## required for dracut installpkg kbd kbd-misc ## required for anaconda-dracut (img-lib etc.) installpkg tar xz curl ## basic system stuff installpkg systemd-sysv systemd-units installpkg rsyslog ## xorg/GUI packages #%if basearch != "s390x": installpkg xorg-x11-drivers xorg-x11-server-Xorg #%endif installpkg xorg-x11-server-utils xorg-x11-xauth installpkg dbus-x11 metacity gsettings-desktop-schemas installpkg nm-connection-editor installpkg at-spi at-spi2-atk pyatspi installpkg gnome-python2-gconf installpkg gobject-introspection installpkg librsvg2 installpkg polkit-desktop-policy installpkg gnome-keyring installpkg python-imaging ## filesystem tools installpkg btrfs-progs xfsprogs gfs2-utils installpkg python-volume_key volume_key installpkg system-storage-manager installpkg device-mapper-persistent-data installpkg xfsdump ## SELinux support installpkg selinux-policy-targeted audit libsemanage-python ## network tools/servers installpkg python-ethtool ethtool openssh-server nfs-utils installpkg tigervnc-server-minimal #%if basearch != "s390x": installpkg tigervnc-server-module #%endif installpkg net-tools installpkg bridge-utils installpkg nmap-ncat ## ntp packages installpkg ntp ## hardware utilities/libraries installpkg pciutils usbutils ipmitool installpkg mt-st smartmontools #%if basearch != "s390x": installpkg hdparm #%endif installpkg libmlx4 rdma installpkg rng-tools ## translations & language packs installpkg yum-langpacks ## fonts & themes installpkg bitmap-fangsongti-fonts installpkg dejavu-sans-fonts dejavu-sans-mono-fonts installpkg kacst-farsi-fonts installpkg kacst-qurn-fonts installpkg lklug-fonts installpkg lohit-*-fonts installpkg madan-fonts installpkg nhn-nanum-gothic-fonts installpkg smc-meera-fonts installpkg thai-scalable-waree-fonts installpkg vlgothic-fonts installpkg wqy-microhei-fonts installpkg sil-abyssinica-fonts installpkg xorg-x11-fonts-misc installpkg gnome-themes-standard gnome-icon-theme-legacy ## branding & logos installpkg gnome-themes-standard ## debugging/bug reporting tools installpkg gdb-gdbserver installpkg libreport-plugin-bugzilla libreport-plugin-reportuploader ## extra tools not required by anaconda installpkg vim-minimal strace lsof dump xz less eject installpkg wget rsync rsh bind-utils ftp mtr installpkg spice-vdagent installpkg gdisk hexedit sg3_utils ## yum plugins installpkg yum-langpacks ## RHEL packages installpkg subscription-manager ## addons installpkg kexec-tools-anaconda-addon installpkg oscap-anaconda-addon set -x # recursive resolve dependent packages for each package for i in $ANACONDA_PKGS; do repoquery -c $yum_conf --qf '%{NAME}' --requires --resolve --recursive $i >> /tmp/g$$.2 done # sort and collect packages echo $ANACONDA_PKGS | tr ' ' '\012' | sort -u - /tmp/g$$.2 > /tmp/g$$.3 # convert into "cp *.rpm ${DESTDIR}" #while read i; do # repoquery -c $yum_conf --qf 'cp -p %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm ${DESTDIR}' >> /tmp/g$$.9 #done < /tmp/g$$.3 repoquery -c $yum_conf --qf 'cp -p %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm ${DESTDIR}' `< /tmp/g$$.3` >> /tmp/g$$.9 cat /tmp/g$$.9 #trap rm /tmp/g$$.*