Skip to content

Commit

Permalink
fix: Add check to install linux-modules-extra-<KERNEL_VER> on arm64 r…
Browse files Browse the repository at this point in the history
…esources (#7)

Co-authored-by: George Kitsos <[email protected]>
  • Loading branch information
gkitsos01 and George Kitsos authored Oct 2, 2024
1 parent 5e90179 commit e69b3fe
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>$LOGFILE 2>&1

# Find Resource Architecture
ARCH_COMMAND=$(sudo arch)
AMD_ARCH="x86_64"
ARM_ARCH="aarch64"

if [ "$ARCH_COMMAND" = "$AMD_ARCH" ]; then
ARCHITECTURE="amd64"
elif [ "$ARCH_COMMAND" = "$ARM_ARCH" ]; then
ARCHITECTURE="arm64"
fi

# A function to print a message to the stdout as well as as the LOGFILE
log_print(){
level=$1
Expand Down Expand Up @@ -187,6 +198,16 @@ if [ "$ACTION" == "CREATE" ]; then

sudo apt-get update

# Check if the architecture is arm64
if [ "$ARCHITECTURE" = "arm64" ]; then
KERNEL_VERSION=$(uname -r)
LINUX_MODULE="linux-modules-extra-${KERNEL_VERSION}"
log_print INFO "onm-bootstrap($PID): Architecture is $ARCHITECTURE. Installing... $LINUX_MODULE"

Check_lock
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y $LINUX_MODULE
fi

log_print INFO "onm-bootstrap($PID): Installing wireguard and resolvconf..."

Check_lock
Expand Down

0 comments on commit e69b3fe

Please sign in to comment.