0

We are installing IOT Edge runtime to a Linux device running Debian 10. We are following the below article with minor modification for Debian as mentioned here.

Install Azure IoT Edge | Microsoft Docs

Our hardware vendor is requesting to change the default installation directory of IOT Edge runtime and requesting not to install anything on the root.

Is it a suggested practice and if yes is it possible to do the same? Also, is it possible to change the installation directory for MOBY runtime too as we will have to change that too.

Hemant
  • 1
  • 1
    Also see [Running apt-get for another partition/directory?](https://stackoverflow.com/questions/3954584/running-apt-get-for-another-partition-directory) which is for Ubuntu, but should also work for Debian 10. It also includes `apt-get`-specific alternatives to chroot'ing. – Arnavion Mar 25 '21 at 07:09

1 Answers1

0

The package will install files relative to /. You want to make the package installer (and whatever it installs) think that / is not really / but some directory of your choice, ie a fake root. The general method of working with a fake root is to create a chroot. In your case, you can create a chroot and install the packages inside it.

An explanation of what a chroot is and how to use it is too long for one SO answer; you can look around on this site or the internet to learn about that.

Note that you'll also have to run the services manually rather than relying on systemd, since the systemd service files will not be installed to the outer system's systemd unit directories but within the chroot, where the outer systemd will not look.

Lastly, you'll have to run the services from within the chroot too, so that binaries in the chroot'd /bin can find libraries in the chroot'd /lib, find their configuration in the chroot'd /etc/, etc.

Arnavion
  • 3,627
  • 1
  • 24
  • 31
  • 1) Does EDGE team suggest the above practice? 2) We will be having remote devices where we will not have great SSH connections, so when the device re-starts we need to restart the service ourselves? 3) Do we follow the same for Moby too? – Hemant Mar 26 '21 at 05:37