@@ -22,7 +22,7 @@ chroot_log="$log_path"/$chroot_name.log
2222install_one_toolchain_rpm () {
2323 error_msg_tail=" Inspect $chroot_log for more info. Did you hydrate the toolchain?"
2424
25- echo " Adding RPM to worker chroot: $1 ." | tee -a " $chroot_log "
25+ echo " Adding RPM to worker chroot: $1 ." | tee -a " $chroot_log "
2626
2727 full_rpm_path=$( find " $rpm_path " -name " $1 " -type f 2>> " $chroot_log " )
2828 if [ ! $? -eq 0 ] || [ -z " $full_rpm_path " ]
@@ -55,7 +55,7 @@ while read -r package || [ -n "$package" ]; do
5555done < " $packages "
5656
5757TEMP_DB_PATH=/temp_db
58- echo " Setting up a clean RPM database before the Berkeley DB -> SQLite conversion under '$TEMP_DB_PATH '." | tee -a " $chroot_log "
58+ echo " Setting up a clean RPM database before the Berkeley DB -> SQLite conversion under '$TEMP_DB_PATH '." | tee -a " $chroot_log "
5959chroot " $chroot_builder_folder " mkdir -p " $TEMP_DB_PATH "
6060chroot " $chroot_builder_folder " rpm --initdb --dbpath=" $TEMP_DB_PATH "
6161
@@ -64,16 +64,23 @@ while read -r package || [ -n "$package" ]; do
6464 full_rpm_path=$( find " $rpm_path " -name " $package " -type f 2>> " $chroot_log " )
6565 cp $full_rpm_path $chroot_builder_folder /$package
6666
67- echo " Adding RPM DB entry to worker chroot: $package ." | tee -a " $chroot_log "
67+ echo " Adding RPM DB entry to worker chroot: $package ." | tee -a " $chroot_log "
6868
6969 chroot " $chroot_builder_folder " rpm -i -v --nodeps --noorder --force --dbpath=" $TEMP_DB_PATH " --justdb " $package " & >> " $chroot_log "
7070 chroot " $chroot_builder_folder " rm $package
7171done < " $packages "
7272
73- echo " Overwriting old RPM database with the results of the conversion." | tee -a " $chroot_log "
73+ echo " Overwriting old RPM database with the results of the conversion." | tee -a " $chroot_log "
7474chroot " $chroot_builder_folder " rm -rf /var/lib/rpm
7575chroot " $chroot_builder_folder " mv " $TEMP_DB_PATH " /var/lib/rpm
7676
77+ echo " Importing CBL-Mariner GPG keys." | tee -a " $chroot_log "
78+ for gpg_key in $( chroot " $chroot_builder_folder " rpm -q -l mariner-repos-shared | grep " rpm-gpg" )
79+ do
80+ echo " Importing GPG key: $gpg_key " | tee -a " $chroot_log "
81+ chroot " $chroot_builder_folder " rpm --import " $gpg_key "
82+ done
83+
7784HOME=$ORIGINAL_HOME
7885
7986# In case of Docker based build do not add the below folders into chroot tarball
0 commit comments