Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions build_n_install.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
#!/bin/bash
set -euo pipefail
run_install() {

if [ -f /boot/firmware/extlinux/extlinux.conf ] ; then
if [ "$EUID" -ne 0 ] ; then
echo "DeviceTrees: Install ,password required for sudo..."
sudo "$@"
else
"$@"
fi
}
make clean
if [ -f /sys/devices/soc0/family ] ; then
make clean
soc_family=$(cat /sys/devices/soc0/family || true)
case "${soc_family}" in
soc_family="$(cat /sys/devices/soc0/family )"
else
soc_family=""
fi
if[ -f /boot/firmware/extlinux/extlinux.conf ]; then
case "$soc_family" in
AM62X|J721E|J722S)
make -j4 all_arm64
echo "DeviceTrees: Built"
if ! id | grep -q root; then
echo "DeviceTrees: Install, Password required for sudo..."
sudo make install_arm64
echo "DeviceTrees: Installed"
else
make install_arm64
echo "DeviceTrees: Installed"
fi
run_install make install_arm64
echo "DeviceTrees: Installed"
;;
*)
make -j4
echo "DeviceTrees: Built"
;;
esac
else
make clean
make -j4
echo "DeviceTrees: Built"
fi
else
if [ -f /sys/devices/soc0/family ] ; then
make clean
soc_family=$(cat /sys/devices/soc0/family || true)
case "${soc_family}" in
AM33xx)
make -j4 all_arm
echo "DeviceTrees: Built"
if ! id | grep -q root; then
echo "DeviceTrees: Install, Password required for sudo..."
sudo make install_arm
echo "DeviceTrees: Installed"
else
make install_arm
echo "DeviceTrees: Installed"
fi
;;
esac
else
else
make clean
case "$soc_family" in
AM33xx)
make -j4 all_arm
echo "DeviceTrees: Built"
run_installed make install_arm
echo "DeviceTrees: Installed"
;;
*)
make -j4
echo "DeviceTrees: Built"
fi
;;
esac
fi