[Why] We use the container in compass-ci repo to generate rootfs from a qcow2, it will generate the follow two soft links: - {rootfs_dir}/boot/vmlinuz # for vmlinuz file - {rootfs_dir}/initrd.lkp # for initrd file
So we can use the below two soft links to get the absolute path of vmlinuz and initrd.
[Addition] URL of qcow2rootfs: - https://gitee.com/wu_fengguang/compass-ci/tree/master/container/qcow2rootfs
Signed-off-by: Yu Chuan 13186087857@163.com --- tests/iso2rootfs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 05274164f8c1..9c71b8427d90 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -375,8 +375,12 @@ test_rootfs() log_info "starting test rootfs ..." local test_script="${CGZ_PATH}/kvm.sh"
- local kernel_path=$(realpath "${ROOTFS_DES_DIR}"/boot/vmlinuz*|grep -v rescue) - local initrd_lkp_path=$(realpath "${ROOTFS_DES_DIR}"/boot/initramfs.lkp*) + local kernel_path=$(realpath "${ROOTFS_DES_DIR}"/boot/vmlinuz) + local initrd_lkp_path=$(realpath "${ROOTFS_DES_DIR}"/initrd.lkp) + + [ -f "$kernel_path" ] || die "cannot find kernel of rootfs: $kernel_path" + [ -f "$initrd_lkp_path" ] || die "cannot find initrd_lkp of rootfs: $initrd_lkp_path" + local root_path case ${rootfs_protocol} in "nfs")