@@ -11,11 +11,6 @@ source $(dirname "$0")/common
1111# Major Version (eg, 8)
1212MAJ=${RLVER}
1313
14- if [[ " ${RLVER} " -eq " 9" ]]; then
15- echo " Invalid release"
16- exit 1
17- fi
18-
1914# sync all pieces of a release, including extras, nfv, etc
2015for COMPOSE in " ${NONSIG_COMPOSE[@]} " ; do
2116 echo " ${COMPOSE} : Syncing"
@@ -31,6 +26,10 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
3126 # Sort the ISO's
3227 for ARCH in " ${ARCHES[@]} " ; do
3328 for x in " ${ISO_TYPES[@]} " ; do
29+ if [[ " ${x} " != " BaseOS" ]]; then
30+ echo " ${x} ${ARCH} : Removing unnecessary boot image"
31+ /bin/rm -v " ${x} /${ARCH} /iso/Rocky-${REVISION} -20" * " ${ARCH} " * .iso
32+ fi
3433 # # Check if the ISO even exists, if not skip
3534 if ls " ${x} /${ARCH} /iso/" * .iso 1> /dev/null 2>&1 ; then
3635 echo " ${x} ${ARCH} : Moving ISO images"
@@ -42,6 +41,18 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4241 test -d " ${x} /${ARCH} /iso" && rmdir " ${x} /${ARCH} /iso"
4342 done
4443 pushd " isos/${ARCH} " || { echo " ${ARCH} : Failed to change directory" ; break ; }
44+
45+ echo " Symlinking to 'latest' if ISO exists"
46+ test -f " Rocky-${REVISION} -${ARCH} -boot.iso" && ln -s " Rocky-${REVISION} -${ARCH} -boot.iso" " Rocky-${MAJ} -latest-${ARCH} -boot.iso"
47+ test -f " Rocky-${REVISION} -${ARCH} -dvd.iso" && ln -s " Rocky-${REVISION} -${ARCH} -dvd.iso" " Rocky-${MAJ} -latest-${ARCH} -dvd.iso"
48+ test -f " Rocky-${REVISION} -${ARCH} -dvd1.iso" && ln -s " Rocky-${REVISION} -${ARCH} -dvd1.iso" " Rocky-${MAJ} -latest-${ARCH} -dvd.iso"
49+ test -f " Rocky-${REVISION} -${ARCH} -minimal.iso" && ln -s " Rocky-${REVISION} -${ARCH} -minimal.iso" " Rocky-${MAJ} -latest-${ARCH} -minimal.iso"
50+ echo " (Re)generating manifests"
51+ for file in * .iso; do
52+ xorriso -dev " ${file} " --find | tail -n+2 | tr -d " '" | cut -c2- | sort > " ${file} .manifest"
53+ done
54+
55+ # ISO checksums
4556 for file in * .iso; do
4657 printf " # %s: %s bytes\n%s\n" \
4758 " ${file} " \
@@ -50,10 +61,56 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
5061 | sudo tee -a " ${file} .CHECKSUM"
5162 done
5263 cat ./* .CHECKSUM > CHECKSUM
64+ # GPG sign the checksums
5365 popd || { echo " Could not change directory" ; break ; }
5466 done
5567 # Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
68+ for ARCH in " ${ARCHES[@]} " ; do
69+ echo " ${ARCH} : Sorting cloud images"
70+ if [ -d " images/${ARCH} " ]; then
71+ pushd " images/${ARCH} " || { echo " ${ARCH} : Failed to change directory" ; break ; }
72+ mv images/* .
73+ rmdir images
74+ test -f CHECKSUM && /bin/rm CHECKSUM
75+ # Drop vagrant from name if they are there
76+ echo " ${ARCH} : Looking for vagrant names and dropping them"
77+ for x in * ; do if [[ " ${x} " =~ " vagrant" ]]; then mv " ${x} " $( echo ${x} | sed ' s/\.vagrant\..*\(\.box\)/\1/g' ) ; fi ; done
78+ # Generate "latest" links
79+ for x in * ; do ln -s " ${x} " $( echo " ${x} " | sed -E " s/-$REVISION -[0-9]+\.[0-9]+/.latest/g ; s/\.oci//g" ) ; done
80+ # Cloud checksums
81+ for file in * ; do
82+ printf " # %s: %s bytes\n%s\n" \
83+ " ${file} " \
84+ " $( stat -c %s ${file} -L) " \
85+ " $( sha256sum --tag ${file} ) " \
86+ | sudo tee -a " ${file} .CHECKSUM"
87+ done
88+ cat ./* .CHECKSUM > CHECKSUM
89+ popd || { echo " ${ARCH} : Failed to change directory" ; break ; }
90+ fi
91+ done
5692 # Live images should probably be fine. Check anyway what we want to do. Might be a simple move.
93+ for ARCH in " ${ARCHES[@]} " ; do
94+ echo " ${ARCH} : Sorting live images"
95+ if [ -d " live/${ARCH} " ]; then
96+ pushd " live/${ARCH} " || { echo " ${ARCH} : Failed to change directory" ; break ; }
97+ mv iso/* .
98+ rmdir iso
99+ test -f CHECKSUM && /bin/rm CHECKSUM
100+ # Generate "latest" links
101+ for x in * ; do ln -s " ${x} " $( echo " ${x} " | sed -E " s/${MAJOR} \.${MINOR} /${MAJOR} /g ; s/[0-9]+\.[0-9]+/latest/g" ) ; done
102+ # live checksums
103+ for file in * ; do
104+ printf " # %s: %s bytes\n%s\n" \
105+ " ${file} " \
106+ " $( stat -c %s ${file} -L) " \
107+ " $( sha256sum --tag ${file} ) " \
108+ | sudo tee -a " ${file} .CHECKSUM"
109+ done
110+ cat ./* .CHECKSUM > CHECKSUM
111+ popd || { echo " ${ARCH} : Failed to change directory" ; break ; }
112+ fi
113+ done
57114 fi
58115 # Delete the unnecessary dirs here.
59116 for EMPTYDIR in " ${NONREPO_DIRS[@]} " ; do
0 commit comments