Skip to content

Commit

Permalink
lkp qemu: use local modules.cgz for lkp qemu if needed
Browse files Browse the repository at this point in the history
if "-m /path/to/modules.cgz" is specified, use this modules.cgz directly
instead of downloading from web

Signed-off-by: Li Zhijian <[email protected]>
Signed-off-by: Philip Li <[email protected]>
  • Loading branch information
zhijianli88 authored and rli9 committed Jun 20, 2018
1 parent b982735 commit e75a06d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/kexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,31 @@ initrd_is_correct()
gzip -dc $file | cpio -t >/dev/null
}

# for lkp qemu, it will set LKP_LOCAL_RUN=1
use_local_modules_initrds()
{
[ "$LKP_LOCAL_RUN" = "1" ] && [ "$modules_initrd" ] && {
# lkp qemu will create a link to modules.cgz under $CACHE_DIR
# ls -al /root/.lkp/cache/modules.cgz
# lrwxrwxrwx 1 root root 21 Jun 19 08:13 /root/.lkp/cache/modules.cgz -> /lkp-qemu/modules.cgz
local local_modules=$CACHE_DIR/$(basename $modules_initrd)
[ -e $local_modules ] || return
initrds="$local_modules "
echo "use local modules: $local_modules"
unset modules_initrd
}
}

download_initrd()
{
local _initrd
local initrds

echo "downloading initrds ..."
set_job_state "wget_initrd"

use_local_modules_initrds

for _initrd in $(echo $initrd $tbox_initrd $job_initrd $lkp_initrd $bm_initrd $modules_initrd $linux_headers_initrd $audio_sof_initrd $syzkaller_initrd $linux_selftests_initrd $linux_perf_initrd | tr , ' ')
do
_initrd=$(echo $_initrd | sed 's/^\///')
Expand Down
1 change: 1 addition & 0 deletions lkp-exec/qemu
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ validate_options()
need_module="$(get_job_env $job_script 'need_modules')" || return
[[ "$need_module" = "true" ]] && {
[[ ! $opt_modules ]] && echo "kernel module is required, please specify it with '-m'" && return 1
[[ ! -e $opt_modules ]] && echo "$opt_modules is not existed" && return 1
}

return 0
Expand Down

0 comments on commit e75a06d

Please sign in to comment.