Skip to content

Commit

Permalink
fix(distrib): added libudev.so.0 symlink [backport release-5.4.0] (#5167
Browse files Browse the repository at this point in the history
)

* fix(distrib): added libudev.so.0 symlink (#5164)

* fix(distrib): added libudev.so.0 symlink

Signed-off-by: Marcello Martina <[email protected]>

* revert: readded old shebang

Signed-off-by: Marcello Martina <[email protected]>

* refactor: added check for target existence

Signed-off-by: Marcello Martina <[email protected]>

---------

Signed-off-by: Marcello Martina <[email protected]>
(cherry picked from commit 1115703)

* fix(distrib): added fix to remaining profiles

Signed-off-by: Marcello Martina <[email protected]>

* chore: copyright header update

Signed-off-by: Marcello Martina <[email protected]>

---------

Signed-off-by: Marcello Martina <[email protected]>
Co-authored-by: Marcello Rinaldo Martina <[email protected]>
Co-authored-by: Marcello Martina <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2024
1 parent f26ed8b commit 678d3dd
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 9 deletions.
30 changes: 29 additions & 1 deletion kura/distrib/src/main/resources/common/customize-installation.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,9 +12,37 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if uname -m | grep -q arm ; then
destination="/usr/lib/arm-linux-gnueabihf/libudev.so.1"
link_name="/usr/lib/arm-linux-gnueabihf/libudev.so.0"
fi
if uname -m | grep -q aarch ; then
destination="/usr/lib/aarch64-linux-gnu/libudev.so.1"
link_name="/usr/lib/aarch64-linux-gnu/libudev.so.0"
fi
if uname -m | grep -q x86_64 ; then
destination="/usr/lib/x86_64-linux-gnu/libudev.so.1"
link_name="/usr/lib/x86_64-linux-gnu/libudev.so.0"
fi

if [ -f "${destination}" ] && [ ! -f "${link_name}" ]; then
echo "Setting up symlink ${link_name} -> ${destination}"
ln -sf "${destination}" "${link_name}"
fi
}

KURA_PLATFORM=$( uname -m )
sed -i "s/kura_platform/${KURA_PLATFORM}/g" "/opt/eclipse/kura/framework/kura.properties"

setup_libudev

BOARD="generic-device"

if uname -a | grep -q 'raspberry' > /dev/null 2>&1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2011, 2022 Eurotech and/or its affiliates and others
# Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/x86_64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/x86_64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/x86_64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2022, 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2022, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/x86_64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/x86_64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/x86_64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2011, 2021 Eurotech and/or its affiliates and others
# Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,8 +13,22 @@
# Cavium
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/aarch64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/aarch64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/aarch64-linux-gnu/libudev.so.1 /usr/lib/aarch64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2022, 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2022, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/aarch64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/aarch64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/aarch64-linux-gnu/libudev.so.1 /usr/lib/aarch64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
# Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/aarch64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/aarch64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/aarch64-linux-gnu/libudev.so.1 /usr/lib/aarch64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2022, 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2022, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/aarch64-linux-gnu/libudev.so.0 ] && [ -f /usr/lib/aarch64-linux-gnu/libudev.so.1 ]; then
ln -sf /usr/lib/aarch64-linux-gnu/libudev.so.1 /usr/lib/aarch64-linux-gnu/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
# Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,6 +12,18 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/arm-linux-gnueabihf/libudev.so.0 ] && [ -f /usr/lib/arm-linux-gnueabihf/libudev.so.1 ]; then
ln -sf /usr/lib/arm-linux-gnueabihf/libudev.so.1 /usr/lib/arm-linux-gnueabihf/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

#create known kura install location
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2011, 2023 Eurotech and/or its affiliates and others
# Copyright (c) 2011, 2024 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,8 +12,22 @@
# Eurotech
#

setup_libudev() {
# create soft link for libudev.so.0 to make it retrocompatible
# https://unix.stackexchange.com/questions/156776/arch-ubuntu-so-whats-the-deal-with-libudev-so-0
if [ ! -f /lib/libudev.so.0 ] && [ -f /lib/libudev.so.1 ]; then
ln -sf /lib/libudev.so.1 /lib/libudev.so.0
fi

if [ ! -f /usr/lib/arm-linux-gnueabihf/libudev.so.0 ] && [ -f /usr/lib/arm-linux-gnueabihf/libudev.so.1 ]; then
ln -sf /usr/lib/arm-linux-gnueabihf/libudev.so.1 /usr/lib/arm-linux-gnueabihf/libudev.so.0
fi
}

INSTALL_DIR=/opt/eclipse

setup_libudev

#create known kura install location
ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura

Expand Down

0 comments on commit 678d3dd

Please sign in to comment.