- mount_image "${image}" "${image_dir}"
- apt_repos_pkgs_image "${repos_pkgs[@]:4:4}"
- cleanup_mounts
- ln -sf "${image_dir}/${image}" "${image_dir}/${image%.*}_vcp.img"
+ echo "[INFO] Lookup cache / build patched VCP image for md5sum: ${_h}"
+ _tmp="${vcp_image%.*}.${_h}.img"
+ if [ -f "$(readlink -f "${image_dir}/${_tmp}")" ]; then
+ echo "[INFO] Patched VCP image found"
+ else
+ echo "[INFO] Patching VCP image ..."
+ cp "${image_dir}/${image}" "${image_dir}/${_tmp}"
+ __kernel_modules "${image_dir}"
+ mount_image "${_tmp}" "${image_dir}"
+ apt_repos_pkgs_image "${repos_pkgs[@]:4:4}"
+ cleanup_mounts
+ fi
+ ln -sf "${image_dir}/${_tmp}" "${image_dir}/${vcp_image}"