build-guest: update RPM lists + misc fixes

* build-guest:
  - remove check for $EGID == cgts
  - warn on missing packages
  - parse long command line options
* rootfs-setup.sh: don't fail when rsyslog is not installed
* rpm-install-list*.txt: remove non-existent packages

Story: 2009108
Task: 42968

Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
Change-Id: I53cc88ddaf0d9a2bd9fd09a31ba8922d1c526d8a
This commit is contained in:
Davlet Panech 2021-08-03 12:43:37 -04:00
parent 5679a9d147
commit 0f1e54c8be
4 changed files with 24 additions and 39 deletions

View File

@ -13,20 +13,7 @@
BUILD_GUEST_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )" BUILD_GUEST_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source "${BUILD_GUEST_DIR}/image-utils.sh" source "${BUILD_GUEST_DIR}/image-utils.sh"
# Remind folks then need to be in the correct group to run mock commands PROGNAME=$(basename "$0")
# Note: cgts is our current alias for the mock group. Should probably be
# renamed as stx-build in a future update
NEED_GROUP=cgts
CURRENT_GID=$(id -g)
NEED_GID=$(getent group $NEED_GROUP | cut -d: -f3)
if [ $CURRENT_GID != $NEED_GID ]; then
echo "This command must be run using group '$NEED_GROUP'."
echo "Please run:"
echo " newgrp $NEED_GROUP"
echo ""
echo "Then try again."
exit 1
fi
# NOTE: TMP_DIR must end in '/' # NOTE: TMP_DIR must end in '/'
# NOTE: /tmp/ is now tmpfs like. Can't be trusted across multiple mock commands # NOTE: /tmp/ is now tmpfs like. Can't be trusted across multiple mock commands
@ -190,7 +177,24 @@ function create_rootfs {
printf " Error -- Failed to install RPM packages\n"; printf " Error -- Failed to install RPM packages\n";
exit 1 exit 1
fi fi
# Make sure all requested packages are installed
MISSING=$(
$MOCK -r $GUEST_CFG --chroot -- rpm -q --whatprovides ${INC_RPM_LIST} ${TIS_RPM_LIST} \
| tee /tmp/dpanech.log \
| sed -n 's/^no package provides //p' \
| sort -u
)
if [ -n "$MISSING" ]; then
printf "=====\n"
printf "WARNING: The following RPMs requested in .inc files are missing or could not be installed:\n"
for zz in $MISSING ; do
echo " [$zz]"
done
#echo $MISSING | tr ' ' '\n' | sed 's/^/\t/'
printf "=====\n"
fi
# Remove RPMs that are not required in image (pruned package list) # Remove RPMs that are not required in image (pruned package list)
# NOTE: these are automatically installed from the mock init not # NOTE: these are automatically installed from the mock init not
# through dependencies. # through dependencies.
@ -264,7 +268,7 @@ function build_image {
ROOTFS_EXCLUDE=rootfs-exclude.txt ROOTFS_EXCLUDE=rootfs-exclude.txt
$MOCK -r $GUEST_CFG --copyin $GUEST_BUILD_DIR/$ROOTFS_EXCLUDE $TMP_DIR $MOCK -r $GUEST_CFG --copyin $GUEST_BUILD_DIR/$ROOTFS_EXCLUDE $TMP_DIR
$MOCK -r $GUEST_CFG --chroot -- tar -cf $TMP_DIR$ROOTFS_TAR -X $TMP_DIR$ROOTFS_EXCLUDE --numeric-owner / $MOCK -r $GUEST_CFG --chroot -- tar -cf $TMP_DIR$ROOTFS_TAR -X $TMP_DIR$ROOTFS_EXCLUDE --exclude=$TMP_DIR$ROOTFS_TAR --numeric-owner /
$MOCK -r $GUEST_CFG --copyout $TMP_DIR$ROOTFS_TAR $GUEST_DIR $MOCK -r $GUEST_CFG --copyout $TMP_DIR$ROOTFS_TAR $GUEST_DIR
$MOCK -r $GUEST_CFG --chroot -- rm -f $TMP_DIR$ROOTFS_TAR $MOCK -r $GUEST_CFG --chroot -- rm -f $TMP_DIR$ROOTFS_TAR
@ -330,7 +334,7 @@ VERBOSE=0
BUILD_MODE='std' BUILD_MODE='std'
# read the options # read the options
TEMP=`getopt -o h --long clean --long rt --long std --long verbose -n 'test.sh' -- "$@"` TEMP=`getopt -o h --long clean,rt,std,verbose,help -n "$PROGNAME" -- "$@"` || exit 1
eval set -- "$TEMP" eval set -- "$TEMP"
# extract options and their arguments into variables. # extract options and their arguments into variables.

View File

@ -76,7 +76,9 @@ fi
yum clean all yum clean all
# update /etc/rsyslog.conf to have OmitLocalLogging off # update /etc/rsyslog.conf to have OmitLocalLogging off
sed -i 's#OmitLocalLogging on#OmitLocalLogging off#g' /etc/rsyslog.conf if [ -f /etc/rsyslog.conf ]; then
sed -i 's#OmitLocalLogging on#OmitLocalLogging off#g' /etc/rsyslog.conf
fi
# select correct kernel and initrd # select correct kernel and initrd
if [ "$BUILD_MODE" == "rt" ]; then if [ "$BUILD_MODE" == "rt" ]; then

View File

@ -10,7 +10,6 @@ bash
bind-libs-lite bind-libs-lite
bind-license bind-license
binutils binutils
bonnie++
bridge-utils bridge-utils
btrfs-progs btrfs-progs
bzip2-libs bzip2-libs
@ -19,9 +18,7 @@ centos-logos
centos-release centos-release
checkpolicy checkpolicy
chkconfig chkconfig
chrony
cloud-init cloud-init
cloud-utils-growpart
coreutils coreutils
cpio cpio
cracklib cracklib
@ -45,7 +42,6 @@ diffutils
dmidecode dmidecode
dnsmasq dnsmasq
dracut dracut
dracut-config-generic
dracut-config-rescue dracut-config-rescue
dracut-network dracut-network
e2fsprogs e2fsprogs
@ -90,7 +86,6 @@ iperf3
iproute iproute
iptables iptables
iputils iputils
iwl7265-firmware
jansson jansson
jbigkit-libs jbigkit-libs
json-c json-c
@ -221,8 +216,6 @@ policycoreutils-python
polkit polkit
polkit-pkla-compat polkit-pkla-compat
popt popt
postfix
ppp
procps-ng procps-ng
pth pth
pygobject3-base pygobject3-base
@ -232,7 +225,6 @@ python
python-backports python-backports
python-backports-ssl_match_hostname python-backports-ssl_match_hostname
python-chardet python-chardet
python-cheetah
python-configobj python-configobj
python-decorator python-decorator
python-iniparse python-iniparse
@ -241,7 +233,6 @@ python-jsonpatch
python-jsonpointer python-jsonpointer
python-kitchen python-kitchen
python-libs python-libs
python-markdown
python-perf python-perf
python-pillow python-pillow
python-prettytable python-prettytable
@ -294,7 +285,6 @@ vim-minimal
virt-what virt-what
wget wget
which which
wpa_supplicant
xz xz
xz-libs xz-libs
yum yum

View File

@ -10,7 +10,6 @@ bash
bind-libs-lite bind-libs-lite
bind-license bind-license
binutils binutils
bonnie++
bridge-utils bridge-utils
btrfs-progs btrfs-progs
bzip2-libs bzip2-libs
@ -19,9 +18,7 @@ centos-logos
centos-release centos-release
checkpolicy checkpolicy
chkconfig chkconfig
chrony
cloud-init cloud-init
cloud-utils-growpart
coreutils coreutils
cpio cpio
cracklib cracklib
@ -45,7 +42,6 @@ diffutils
dmidecode dmidecode
dnsmasq dnsmasq
dracut dracut
dracut-config-generic
dracut-config-rescue dracut-config-rescue
dracut-network dracut-network
e2fsprogs e2fsprogs
@ -90,7 +86,6 @@ iperf3
iproute iproute
iptables iptables
iputils iputils
iwl7265-firmware
jansson jansson
jbigkit-libs jbigkit-libs
json-c json-c
@ -221,8 +216,6 @@ policycoreutils-python
polkit polkit
polkit-pkla-compat polkit-pkla-compat
popt popt
postfix
ppp
procps-ng procps-ng
pth pth
pygobject3-base pygobject3-base
@ -232,7 +225,6 @@ python
python-backports python-backports
python-backports-ssl_match_hostname python-backports-ssl_match_hostname
python-chardet python-chardet
python-cheetah
python-configobj python-configobj
python-decorator python-decorator
python-iniparse python-iniparse
@ -241,7 +233,6 @@ python-jsonpatch
python-jsonpointer python-jsonpointer
python-kitchen python-kitchen
python-libs python-libs
python-markdown
python-perf python-perf
python-pillow python-pillow
python-prettytable python-prettytable
@ -266,7 +257,6 @@ rpm-build-libs
rpm-libs rpm-libs
rpm-python rpm-python
rsync rsync
rsyslog
sed sed
setup setup
shadow-utils shadow-utils
@ -292,7 +282,6 @@ vim-enhanced
virt-what virt-what
wget wget
which which
wpa_supplicant
xz xz
xz-libs xz-libs
yum yum