upd check_requirements()

This commit is contained in:
Bernhard Landauer 2019-11-17 10:55:27 +01:00
parent fee0b2cb18
commit 5c31cf102e
4 changed files with 14 additions and 7 deletions

View file

@ -123,7 +123,7 @@ usage() {
echo ' -m Set SquashFS image mode to persistence'
echo ' -c Disable clean work dir'
echo ' -f Build full ISO (extra=true)'
echo ' -d <comp> Compression used for build ISO: xz, gzip, lzma, lzo, lz4, zstd'
echo ' -d <comp> Compression used for build ISO: gzip, lzma, lz4, lzo, xz, zstd'
echo " [default: ${iso_compression}]"
echo ' -x Build images only'
echo ' -z Generate iso only'

View file

@ -55,7 +55,7 @@
# the branding; default: auto
# dist_branding="MJRO"
# compression used, possible values gzip, lzma, lzo, lz4, zstd (default)
# compression used, possible values gzip, lzma, lz4, lzo, xy, zstd (default)
# iso_compression=zstd
# unset defaults to given value

View file

@ -469,12 +469,12 @@ check_requirements(){
if ! $(is_valid_branch ${target_branch}); then
die "%s is not a valid branch!" "${target_branch}"
fi
local iso_kernel=${kernel:5:1} host_kernel=$(uname -r)
if [[ ${iso_kernel} < "4" ]] \
|| [[ ${host_kernel%%*.} < "4" ]]; then
die "The host and iso kernels must be version>=4.0!"
if ! $(is_valid_comp ${iso_compression}); then
die "%s is not a valid compression algorithm!" "${iso_compression}"
fi
local iso_kernel=${kernel:5:1}
[[ ${iso_kernel} < "4" ]] && die "ISO kernel must be version>=4.0!"
}
compress_images(){

View file

@ -768,6 +768,13 @@ is_valid_branch(){
esac
}
is_valid_comp(){
case $1 in
'gzip'|'lzma'|'lz4'|'lzo'|'xz'|'zstd') return 0 ;;
*) return 1 ;;
esac
}
run(){
if ${is_build_list}; then
for item in ${build_list[@]}; do