Skip to content

Commit

Permalink
Fix formatting in scripts by running lib/tools/shellfmt.sh version …
Browse files Browse the repository at this point in the history
…3.8.0
  • Loading branch information
ColorfulRhino authored and igorpecovnik committed Jun 25, 2024
1 parent 7f8576f commit 3cca9dc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 33 deletions.
20 changes: 10 additions & 10 deletions extensions/mesa-vpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ function post_install_kernel_debs__3d() {

display_alert "Pinning amazingfated's rk3588 PPAs" "${EXTENSION}" "info"
cat <<- EOF > "${SDCARD}"/etc/apt/preferences.d/amazingfated-rk3588-panfork-pin
Package: *
Pin: release o=LP-PPA-liujianfeng1994-panfork-mesa
Pin-Priority: 1001
Package: *
Pin: release o=LP-PPA-liujianfeng1994-panfork-mesa
Pin-Priority: 1001
EOF

sed -i "s/noble/jammy/g" "${SDCARD}"/etc/apt/sources.list.d/liujianfeng1994-ubuntu-panfork-mesa-"${RELEASE}".*
Expand All @@ -67,9 +67,9 @@ function post_install_kernel_debs__3d() {

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

fi
Expand All @@ -88,17 +88,17 @@ function post_install_kernel_debs__3d() {

display_alert "Pinning amazingfated's multimedia PPAs" "${EXTENSION}" "info"
cat <<- EOF > "${SDCARD}"/etc/apt/preferences.d/amazingfated-rk3588-rockchip-multimedia-pin
Package: *
Pin: release o=LP-PPA-liujianfeng1994-rockchip-multimedia
Pin-Priority: 1001
Package: *
Pin: release o=LP-PPA-liujianfeng1994-rockchip-multimedia
Pin-Priority: 1001
EOF
fi

display_alert "Updating sources list, after oibaf PPAs" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard_apt_get_update

display_alert "Installing 3D extension packages" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard_apt_get_install --allow-downgrades "${pkgs[@]}"
do_with_retries 3 chroot_sdcard_apt_get_install --allow-downgrades "${pkgs[@]}"

display_alert "Upgrading Mesa packages" "${EXTENSION}" "info"
do_with_retries 3 chroot_sdcard_apt_get dist-upgrade
Expand Down
16 changes: 8 additions & 8 deletions lib/functions/artifacts/artifact-armbian-base-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ function compile_armbian-base-files() {
# Create preinst file if not exists (Debian)
if [[ ! -e "${destination}"/DEBIAN/preinst ]]; then
cat <<- EOD >> "${destination}"/DEBIAN/preinst
#!/bin/sh
set -e
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
#!/bin/sh
set -e
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
EOD
chmod 0755 "${destination}"/DEBIAN/preinst
else
cat <<- EOD >> "${destination}"/DEBIAN/preinst
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
# Start of automatically added by ${VENDOR}
rm -f /etc/dpkg/origins/default # reset default link
# End of automatically added by ${VENDOR}
EOD
fi

Expand Down
23 changes: 11 additions & 12 deletions lib/functions/configuration/main-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ function set_git_build_repo_url_and_commit_vars() {

function check_filesystem_compatibility_on_host() {
if [[ -f "/proc/filesystems" ]]; then
# Check if the filesystem is listed in /proc/filesystems
if ! grep -q "\<$ROOTFS_TYPE\>" /proc/filesystems; then # ensure exact match with \<...\>
# Check if the filesystem is listed in /proc/filesystems
if ! grep -q "\<$ROOTFS_TYPE\>" /proc/filesystems; then # ensure exact match with \<...\>
# Try modprobing the fs module since it doesn't show up in /proc/filesystems if it's an unloaded module versus built-in
if ! modprobe "$ROOTFS_TYPE"; then
exit_with_error "Filesystem type unsupported by build host:" "$ROOTFS_TYPE"
Expand Down Expand Up @@ -599,8 +599,8 @@ function check_filesystem_compatibility_on_host() {

# Check if required configurations are set
if [ -n "$build_host_kernel_config" ]; then
if ! grep -q '^CONFIG_F2FS_FS_XATTR=y$' "$build_host_kernel_config" || \
! grep -q '^CONFIG_F2FS_FS_SECURITY=y$' "$build_host_kernel_config"; then
if ! grep -q '^CONFIG_F2FS_FS_XATTR=y$' "$build_host_kernel_config" ||
! grep -q '^CONFIG_F2FS_FS_SECURITY=y$' "$build_host_kernel_config"; then
exit_with_error "Required kernel configurations for f2fs filesystem not enabled." "Please enable CONFIG_F2FS_FS_XATTR and CONFIG_F2FS_FS_SECURITY in your kernel configuration." "err"
fi
fi
Expand All @@ -611,18 +611,17 @@ function check_filesystem_compatibility_on_host() {
return 0
}

function pre_install_distribution_specific__disable_cnf_apt_hook(){
function pre_install_distribution_specific__disable_cnf_apt_hook() {
if [[ $(dpkg --print-architecture) != "${ARCH}" && -f "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found ]]; then #disable command-not-found (60% build-time saved under qemu)
display_alert "Disabling command-not-found during build-time to speed up image creation" "${BOARD}:${RELEASE}-${BRANCH}" "info"
run_host_command_logged mv "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found.disabled
fi
display_alert "Disabling command-not-found during build-time to speed up image creation" "${BOARD}:${RELEASE}-${BRANCH}" "info"
run_host_command_logged mv "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found.disabled
fi
}


function post_post_debootstrap_tweaks__restore_cnf_apt_hook(){
function post_post_debootstrap_tweaks__restore_cnf_apt_hook() {
if [ -f "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found.disabled ]; then # (re-enable command-not-found after building rootfs if it's been disabled)
display_alert "Enabling command-not-found after build-time " "${BOARD}:${RELEASE}-${BRANCH}" "info"
run_host_command_logged mv "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found.disabled "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found
display_alert "Enabling command-not-found after build-time " "${BOARD}:${RELEASE}-${BRANCH}" "info"
run_host_command_logged mv "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found.disabled "${SDCARD}"/etc/apt/apt.conf.d/50command-not-found
fi

}
6 changes: 3 additions & 3 deletions lib/functions/rootfs/distro-specific.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function create_sources_list_and_deploy_repo_key() {
EOF
;;

sid|unstable) # sid is permanent unstable development and has no such thing as updates or security
sid | unstable) # sid is permanent unstable development and has no such thing as updates or security
cat <<- EOF > "${basedir}"/etc/apt/sources.list
deb http://${DEBIAN_MIRROR} $release main contrib non-free non-free-firmware
#deb-src http://${DEBIAN_MIRROR} $release main contrib non-free non-free-firmware
Expand Down Expand Up @@ -204,8 +204,8 @@ function create_sources_list_and_deploy_repo_key() {
[[ -n $LOCAL_MIRROR ]] && echo "deb ${SIGNED_BY}http://$LOCAL_MIRROR $RELEASE ${components[*]}" > "${basedir}"/etc/apt/sources.list.d/armbian.list

# disable repo if DISTRIBUTION_STATUS==eos, or if SKIP_ARMBIAN_REPO==yes, or if when==image-early.
if [[ "${when}" == "image-early" || \
"$(cat "${SRC}/config/distributions/${RELEASE}/support")" == "eos" || \
if [[ "${when}" == "image-early" ||
"$(cat "${SRC}/config/distributions/${RELEASE}/support")" == "eos" ||
"${SKIP_ARMBIAN_REPO}" == "yes" ]]; then
display_alert "Disabling Armbian repo" "${ARCH}-${RELEASE} :: skip:${SKIP_ARMBIAN_REPO:-"no"} when:${when}" "info"
mv "${SDCARD}"/etc/apt/sources.list.d/armbian.list "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled
Expand Down

0 comments on commit 3cca9dc

Please sign in to comment.