Support FreeBSD 14-CURRENT

This commit is contained in:
longpanda 2023-04-02 13:17:20 +08:00
parent cff3a01289
commit b9e82bcf16
4 changed files with 17 additions and 50 deletions

View File

@ -413,10 +413,9 @@ function ventoy_get_ghostbsd_ver {
}
function ventoy_get_furybsd_ver {
if regexp "13\.[0-9]" "$2"; then
set vt_freebsd_ver=13.x
else
set vt_freebsd_ver=12.x
set vt_freebsd_ver=12.x
if regexp --set 1:vtFuryVer "(14|13)\.[0-9]" "$2"; then
set vt_freebsd_ver=${vtFuryVer}.x
fi
}
@ -425,12 +424,8 @@ function ventoy_get_freenas_ver {
if [ -e (loop)/FreeNAS-MANIFEST ]; then
vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver
if regexp "^13\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=13.x
elif regexp "^12\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=12.x
elif regexp "^11\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=11.x
if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then
set vt_freebsd_ver=${vtNasVer}.x
fi
fi
}
@ -440,12 +435,8 @@ function ventoy_get_truenas_ver {
if [ -e (loop)/TrueNAS-MANIFEST ]; then
vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver
if regexp "^13\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=13.x
elif regexp "^12\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=12.x
elif regexp "^11\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=11.x
if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then
set vt_freebsd_ver=${vtTNasVer}.x
fi
fi
}
@ -477,44 +468,20 @@ function ventoy_freebsd_proc {
ventoy_get_truenas_ver "$1" "${chosen_path}"
elif vt_strstr "$vt_volume_id" "FURYBSD"; then
ventoy_get_furybsd_ver "$1" "${chosen_path}"
elif regexp "^13_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=13.x
elif regexp "^12_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=12.x
elif regexp "^11_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=11.x
elif regexp "^10_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=10.x
elif regexp "^9_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=9.x
elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
set vt_freebsd_ver=${vtBsdVerNum}.x
elif [ -d (loop)/usr/midnightbsd-dist ]; then
ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
set vtFreeBsdDistro=MidnightBSD
elif [ -e (loop)/bin/freebsd-version ]; then
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
if regexp "\"13\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=13.x
elif regexp "\"12\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=12.x
elif regexp "\"11\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=11.x
elif regexp "\"10\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=10.x
elif regexp "\"9\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=9.x
if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
set vt_freebsd_ver=${vtBsdVerNum}.x
fi
elif [ -e (loop)/README.TXT ]; then
vt_1st_line (loop)/README.TXT vt_freebsd_line1
if regexp "FreeBSD 13\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=13.x
elif regexp "FreeBSD 12\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=12.x
elif regexp "FreeBSD 11\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=11.x
elif regexp "FreeBSD 10\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=10.x
elif regexp "FreeBSD 9\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=9.x
if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
set vt_freebsd_ver=${vtBsdVerNum}.x
fi
elif vt_strstr "${chosen_path}" "MidnightBSD"; then
set vt_freebsd_ver=9.x
@ -543,7 +510,7 @@ function ventoy_freebsd_proc {
fi
if [ "$vt_freebsd_ver" = "xx" ]; then
set vt_freebsd_ver=13.x
set vt_freebsd_ver=14.x
fi
fi

Binary file not shown.