Skip to content

Commit

Permalink
Use oibaf and v4l2 in desktops only
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed May 11, 2024
1 parent 1977a47 commit baeaee6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 10 additions & 5 deletions extensions/mesa-oibaf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,30 @@ function extension_prepare_config__oibaf() {
return 0
fi

[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0

# Add to the image suffix.
EXTRA_IMAGE_SUFFIXES+=("-oibaf") # global array
}

function post_install_kernel_debs__oibaf() {

if [[ "${DISTRIBUTION}" != "Ubuntu" ]]; then
display_alert "oibaf" "${EXTENSION} extension only works with Ubuntu, skipping" "debug"
return 0
fi

[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0

display_alert "Adding oibaf PPAs" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard add-apt-repository ppa:oibaf/graphics-drivers --yes --no-update

display_alert "Pinning oibaf PPAs" "${EXTENSION}" "info"
cat > "${SDCARD}"/etc/apt/preferences.d/mesa-oibaf-graphics-drivers-pin <<EOF
Package: *
Pin: release o=LP-PPA-oibaf-graphics-drivers
Pin-Priority: 1001
EOF
cat <<- EOF > "${SDCARD}"/etc/apt/preferences.d/mesa-oibaf-graphics-drivers-pin
Package: *
Pin: release o=LP-PPA-oibaf-graphics-drivers
Pin-Priority: 1001
EOF

display_alert "Updating sources list, after oibaf PPAs" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard_apt_get_update
Expand Down
2 changes: 2 additions & 0 deletions extensions/v4l2loopback-dkms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ function extension_finish_config__build_v4l2loopback_dkms_kernel_module() {
display_alert "Kernel version has no working headers package" "skipping v4l2loopback-dkms for kernel v${KERNEL_MAJOR_MINOR}" "warn"
return 0
fi
[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0
declare -g INSTALL_HEADERS="yes"
display_alert "Forcing INSTALL_HEADERS=yes; for use with v4l2loopback-dkms" "${EXTENSION}" "debug"
}

function post_install_kernel_debs__build_v4l2loopback_dkms_kernel_module() {
[[ "${INSTALL_HEADERS}" != "yes" ]] || [[ "${KERNEL_HAS_WORKING_HEADERS}" != "yes" ]] && return 0
[[ "${BUILD_DESKTOP}" != "yes" ]] && return 0
display_alert "Install v4l2loopback-dkms packages, will build kernel module in chroot" "${EXTENSION}" "info"
declare -g if_error_detail_message="v4l2loopback-dkms build failed, extension 'v4l2loopback-dkms'"
declare -ag if_error_find_files_sdcard=("/var/lib/dkms/v4l2loopback*/*/build/*.log")
Expand Down

0 comments on commit baeaee6

Please sign in to comment.