[Why] for multi version support, cgz file for cci-makepkg need change dir layout, and change cci-depends dir layout together to easily update scheduler code
path: /srv/initrd/pkg/${os_mount}/${os}/${os_arch}/${os_version}/ => /srv/initrd/pkg/${os_mount}/${os}/${os_arch}/${os_version}/${pkgname}/
filename: cci-makepkg ${pkgver}-${pkgrel}.cgz latest.cgz -> ${pkgver}-${pkgrel}.cgz
filename: cci-depends ${benchmark}.cgz latest.cgz -> ${benchmark}.cgz
E.g. output: cci-depends $ tree iperf ├── iperf.cgz └── latest.cgz -> iperf.cgz
output: cci-makepkg $ tree sar ├── git-1.cgz └── latest.cgz -> git-1.cgz
Signed-off-by: Wang Yong wangyong0117@qq.com --- distro/aliyun | 7 +++---- distro/clear | 7 +++---- distro/debian | 8 +++----- tests/cci-depends | 4 ++-- tests/cci-makepkg | 13 ++++++------- 5 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/distro/aliyun b/distro/aliyun index 79656f0e4..a6ca49968 100755 --- a/distro/aliyun +++ b/distro/aliyun @@ -80,7 +80,6 @@ yum_download() yum_pack() { local target_dir=/opt/rpms - local date=$(date +"%Y%m%d")
local downloaded_rpms=$(find /var/ -type f -name "*.rpm")
@@ -90,10 +89,10 @@ yum_pack()
mv $downloaded_rpms $target_dir
- find $target_dir | cpio --quiet -o -H newc --owner=root.root | gzip -n -9 >$pack_to/${BM_NAME}_$date.cgz + find $target_dir | cpio --quiet -o -H newc --owner=root.root | gzip -n -9 >$pack_to/${BM_NAME}.cgz
- ln -sf ${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return - chown .lkp $pack_to/${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return + ln -sf ${BM_NAME}.cgz $pack_to/latest.cgz || return + chown .lkp $pack_to/${BM_NAME}.cgz $pack_to/latest.cgz || return echo package installed to $pack_to/${BM_NAME}.cgz
ls $target_dir/*.rpm > $pack_to/.${BM_NAME}.packages diff --git a/distro/clear b/distro/clear index f21de89c3..3b562aac6 100755 --- a/distro/clear +++ b/distro/clear @@ -121,7 +121,6 @@ list_bundles_files()
pack_bundles_files() { - local date=$(date +"%Y%m%d") # allow empty ls $tmpdir | grep -q ".list$" >/dev/null || { echo "empty PACKAGE_LIST for $BM_NAME" @@ -130,10 +129,10 @@ pack_bundles_files()
cat $tmpdir/*.list | sort | uniq | cpio --quiet -o -H newc --owner=root.root | - gzip -n -9 >$pack_to/${BM_NAME}_$date.cgz || return + gzip -n -9 >$pack_to/${BM_NAME}.cgz || return
- ln -sf ${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return - chown .lkp $pack_to/${BM_NAME}_$date.cgz $pack_to/${BM_NAME}.cgz || return + ln -sf ${BM_NAME}.cgz $pack_to/latest.cgz || return + chown .lkp $pack_to/${BM_NAME}.cgz $pack_to/latest.cgz || return
echo package installed to $pack_to/${BM_NAME}.cgz } diff --git a/distro/debian b/distro/debian index 13c4e983a..270f77e01 100755 --- a/distro/debian +++ b/distro/debian @@ -99,8 +99,6 @@ fixup_perf()
pack() { - local date=$(date +"%Y%m%d") - [[ $(type -t fixup_$BM_NAME) = 'function' ]] && fixup_$BM_NAME
{ @@ -112,12 +110,12 @@ pack() cat $LKP_SRC/distro/$DISTRO/$BM_NAME-allowlist } | cpio --quiet -o -H newc --owner=root.root | - gzip -n -9 > $pack_to/${BM_NAME}_$date.cgz || return + gzip -n -9 > $pack_to/${BM_NAME}.cgz || return
- ln -sf ${BM_NAME}_$date.cgz \ + ln -sf ${BM_NAME}.cgz \ $pack_to/${BM_NAME}.cgz || return
- chown .lkp $pack_to/${BM_NAME}_$date.cgz \ + chown .lkp $pack_to/${BM_NAME}.cgz \ $pack_to/${BM_NAME}.cgz || return
echo package installed to $pack_to/${BM_NAME}.cgz diff --git a/tests/cci-depends b/tests/cci-depends index 36923ea4d..1c840a4ee 100755 --- a/tests/cci-depends +++ b/tests/cci-depends @@ -18,7 +18,7 @@ DEPS_MNT=/initrd/deps && mkdir -p "$DEPS_MNT" DISTRO=${os}
[[ "$os_mount" = "cifs" ]] && os_mount="nfs" -pack_to=${DEPS_MNT}/${os_mount}/${os}/${os_arch}/${os_version} +pack_to=${DEPS_MNT}/${os_mount}/${os}/${os_arch}/${os_version}/${benchmark}
pack_arch=$os_arch [[ "$benchmark" = "${benchmark##*.}" ]] || @@ -38,7 +38,7 @@ umask 002 }
check_shared_package "$benchmark" && { - ln -sf $BM_NAME.cgz $pack_to/$benchmark.cgz + ln -sf latest.cgz $pack_to/$benchmark.cgz echo "create symlink for shared package: $benchmark -> $BM_NAME"
exit 0 diff --git a/tests/cci-makepkg b/tests/cci-makepkg index 9d5082629..115136f61 100755 --- a/tests/cci-makepkg +++ b/tests/cci-makepkg @@ -26,7 +26,7 @@ mkdir -p "$PKG_MNT" export DISTRO=${os}
[[ "$os_mount" = "cifs" ]] && os_mount="nfs" -pack_to=${os_mount}/${os}/${os_arch}/${os_version} +pack_to=${os_mount}/${os}/${os_arch}/${os_version}/${benchmark}
. $LKP_SRC/distro/${DISTRO} . $LKP_SRC/lib/install.sh @@ -65,8 +65,8 @@ update_shared_pkg() [ "$bm_name" = "$benchmark" ] && return
# benchmark is a symlink - ln -sf "$bm_link" "$sync_dest/${benchmark}.cgz" || return - echo "update shared pkg link ${benchmark}.cgz -> $bm_link" + ln -sf latest.cgz "$sync_dest/${benchmark}.cgz" || return + echo "update shared pkg link ${benchmark}.cgz -> ${bm_name}/${cgz_name}" }
distro_install_depends lkp-dev @@ -82,11 +82,10 @@ distro_install_depends ${benchmark}-dev build_depends_pkg -i $benchmark $TMP
sync_dest="$PKG_MNT/$pack_to" -date=$(date +"%Y%m%d") pkgver=$(get_pkg_info pkgver) pkgrel=$(get_pkg_info pkgrel) bm_name=$(check_shared_pkg) -cgz_name="${bm_name}-${pkgver:-0}-${pkgrel:-0}_${date}.cgz" +cgz_name="${pkgver:-0}-${pkgrel:-0}.cgz"
setup_proxy
@@ -98,8 +97,8 @@ update_softlink() { [ -e "$sync_dest/$cgz_name" ] || return
- ln -sf "$(basename $(realpath $sync_dest/$cgz_name))" "$sync_dest/${bm_name}.cgz" || return - echo "create package: $sync_dest/${bm_name}.cgz -> $(realpath $sync_dest/$cgz_name)" + ln -sf "$(basename $(realpath $sync_dest/$cgz_name))" "$sync_dest/latest.cgz" || return + echo "create package: $sync_dest/latest.cgz -> $(realpath $sync_dest/$cgz_name)"
update_shared_pkg "${bm_name}.cgz"