@@ -380,6 +380,59 @@ runs:
380380 # - name: Setup tmate session
381381 # uses: mxschmitt/action-tmate@v3
382382
383+ - name : List installed packages in ${{ env.IMAGE_FILE }} cloud image
384+ if : ${{ ! contains(inputs.type, 'vagrant') }}
385+ shell : bash
386+ run : |
387+ # List installed packages in ${{ env.IMAGE_FILE }} image
388+
389+ # Partition number with root file-system
390+ case ${{ inputs.arch }} in
391+ x86_64*) partition=4 ;;
392+ aarch64*) partition=3 ;;
393+ *) false ;;
394+ esac
395+
396+ # Image file format: raw or qcow2
397+ case ${{ inputs.type }} in
398+ oci|gencloud|opennebula) format=qcow2 ;;
399+ azure) format=raw ;;
400+ *) false ;;
401+ esac
402+ rootfs_path=/mnt/rootfs
403+ sudo mkdir -p ${rootfs_path}
404+
405+ # Install qemu-utils
406+ sudo ${{ env.runner_os == 'ubuntu' && 'apt-get' || 'dnf -q' }} \
407+ -y install \
408+ ${{ env.runner_os == 'ubuntu' && 'qemu-utils' || 'qemu-img' }}
409+
410+ # Load nbd kernel module
411+ sudo modprobe nbd max_part=8
412+
413+ # Make a copy of the image file
414+ sudo cp ${{ env.IMAGE_FILE }} $(dirname ${rootfs_path})
415+
416+ # Attach the image file to the nbd device
417+ sudo qemu-nbd \
418+ --read-only \
419+ --format=${format} \
420+ --connect=/dev/nbd0 \
421+ $(dirname ${rootfs_path})/$(basename ${{ env.IMAGE_FILE }}) \
422+ && sleep 10 || false
423+
424+ # Mount need partition
425+ sudo fdisk -l /dev/nbd0
426+ sudo mount /dev/nbd0p${partition} ${rootfs_path} \
427+ && sleep 10 || false
428+
429+ # Get installed packages list
430+ sudo sh -c "rpm --dbpath=${rootfs_path}/var/lib/rpm -qa --queryformat '%{NAME}\n' | sort > ${{ env.IMAGE_FILE }}.txt"
431+
432+ [ -f ${{ env.IMAGE_FILE }}.txt ] \
433+ && echo "got_pkgs_list=true" >> $GITHUB_ENV \
434+ || echo "got_pkgs_list=false" >> $GITHUB_ENV
435+
383436 - name : Test ${{ inputs.type }} ${{ inputs.variant }} image
384437 if : inputs.run_test == 'true'
385438 shell : bash
@@ -539,7 +592,7 @@ runs:
539592 result-encoding : string
540593 script : |
541594 const summary = core.summary
542- .addRaw('**AlmaLinux OS ${{ env.RELEASE }} ${{ env.alma_arch }}** ${{ env.IMAGE_TYPE }} Image build `${{ env.TIME_STAMP }}`\n');;
595+ .addRaw('**${{ env.RELEASE_STRING }} ${{ env.alma_arch }}** ${{ env.IMAGE_TYPE }} Image build `${{ env.TIME_STAMP }}`\n');;
543596 if (process.env.upload_to_s3 === 'true') {
544597 summary
545598 .addRaw('S3 Bucket download URLs:\n')
@@ -563,7 +616,7 @@ runs:
563616 {
564617 echo 'MATTERMOST_NOTIFICATION_MESSAGE<<EOF'
565618
566- echo ":almalinux: **AlmaLinux OS ${{ env.RELEASE }} ${{ env.alma_arch }}** ${{ env.IMAGE_TYPE }} Image build \`${{ env.TIME_STAMP }}\`, by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
619+ echo ":almalinux: **${{ env.RELEASE_STRING }} ${{ env.alma_arch }}** ${{ env.IMAGE_TYPE }} Image build \`${{ env.TIME_STAMP }}\`, by the GitHub [Action](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
567620 if [ "${{ inputs.store_as_artifact }}" = "true" -a "${{ inputs.upload_to_s3 }}" = "false" ]; then
568621 echo "- CHECKSUM(SHA256) [zipped]: [${{ env.IMAGE_NAME }}.sha256sum](${{ steps.checksum-artifact.outputs.artifact-url }})"
569622 echo "- Image [zipped]: [${{ env.IMAGE_NAME }}](${{ steps.image-artifact.outputs.artifact-url }})"
0 commit comments