diff --git a/build-tools/build-guest b/build-tools/build-guest index 4f5391d1..42d31815 100755 --- a/build-tools/build-guest +++ b/build-tools/build-guest @@ -13,20 +13,7 @@ BUILD_GUEST_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )" source "${BUILD_GUEST_DIR}/image-utils.sh" -# Remind folks then need to be in the correct group to run mock commands -# 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 +PROGNAME=$(basename "$0") # NOTE: TMP_DIR must end in '/' # 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"; exit 1 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) # NOTE: these are automatically installed from the mock init not # through dependencies. @@ -264,7 +268,7 @@ function build_image { ROOTFS_EXCLUDE=rootfs-exclude.txt $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 --chroot -- rm -f $TMP_DIR$ROOTFS_TAR @@ -330,7 +334,7 @@ VERBOSE=0 BUILD_MODE='std' # 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" # extract options and their arguments into variables. diff --git a/build-tools/build_guest/rootfs-setup.sh b/build-tools/build_guest/rootfs-setup.sh index 5af65666..40a51f62 100755 --- a/build-tools/build_guest/rootfs-setup.sh +++ b/build-tools/build_guest/rootfs-setup.sh @@ -76,7 +76,9 @@ fi yum clean all # 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 if [ "$BUILD_MODE" == "rt" ]; then diff --git a/build-tools/build_guest/rpm-install-list-rt.txt b/build-tools/build_guest/rpm-install-list-rt.txt index 83e82e81..521d55c9 100644 --- a/build-tools/build_guest/rpm-install-list-rt.txt +++ b/build-tools/build_guest/rpm-install-list-rt.txt @@ -10,7 +10,6 @@ bash bind-libs-lite bind-license binutils -bonnie++ bridge-utils btrfs-progs bzip2-libs @@ -19,9 +18,7 @@ centos-logos centos-release checkpolicy chkconfig -chrony cloud-init -cloud-utils-growpart coreutils cpio cracklib @@ -45,7 +42,6 @@ diffutils dmidecode dnsmasq dracut -dracut-config-generic dracut-config-rescue dracut-network e2fsprogs @@ -90,7 +86,6 @@ iperf3 iproute iptables iputils -iwl7265-firmware jansson jbigkit-libs json-c @@ -221,8 +216,6 @@ policycoreutils-python polkit polkit-pkla-compat popt -postfix -ppp procps-ng pth pygobject3-base @@ -232,7 +225,6 @@ python python-backports python-backports-ssl_match_hostname python-chardet -python-cheetah python-configobj python-decorator python-iniparse @@ -241,7 +233,6 @@ python-jsonpatch python-jsonpointer python-kitchen python-libs -python-markdown python-perf python-pillow python-prettytable @@ -294,7 +285,6 @@ vim-minimal virt-what wget which -wpa_supplicant xz xz-libs yum diff --git a/build-tools/build_guest/rpm-install-list.txt b/build-tools/build_guest/rpm-install-list.txt index a1da53dc..61200f8b 100644 --- a/build-tools/build_guest/rpm-install-list.txt +++ b/build-tools/build_guest/rpm-install-list.txt @@ -10,7 +10,6 @@ bash bind-libs-lite bind-license binutils -bonnie++ bridge-utils btrfs-progs bzip2-libs @@ -19,9 +18,7 @@ centos-logos centos-release checkpolicy chkconfig -chrony cloud-init -cloud-utils-growpart coreutils cpio cracklib @@ -45,7 +42,6 @@ diffutils dmidecode dnsmasq dracut -dracut-config-generic dracut-config-rescue dracut-network e2fsprogs @@ -90,7 +86,6 @@ iperf3 iproute iptables iputils -iwl7265-firmware jansson jbigkit-libs json-c @@ -221,8 +216,6 @@ policycoreutils-python polkit polkit-pkla-compat popt -postfix -ppp procps-ng pth pygobject3-base @@ -232,7 +225,6 @@ python python-backports python-backports-ssl_match_hostname python-chardet -python-cheetah python-configobj python-decorator python-iniparse @@ -241,7 +233,6 @@ python-jsonpatch python-jsonpointer python-kitchen python-libs -python-markdown python-perf python-pillow python-prettytable @@ -266,7 +257,6 @@ rpm-build-libs rpm-libs rpm-python rsync -rsyslog sed setup shadow-utils @@ -292,7 +282,6 @@ vim-enhanced virt-what wget which -wpa_supplicant xz xz-libs yum