I have 4 Partitions on a disk.
mmcblk0p1 has the boot configuration.
mmcblk0p2 has a Debian Os. ( Let's name OS1 )
mmcblk0p3 has another Debian Os. ( Let's name OS2 )
mmcblk0p4 is persistent storage.
I am using connman as a network manager. Now all my networks that are connected are stored in /var/lib/connman/ directory. I want this directory to be available for both the OS1 and OS2. So my wifi Configuration from One Os can be available in Another OS.
I created a Shared_Memory directory and mounted the persistent partition on /root/Shared_Memory. I created a var directory in Shared_Memory directory and under var I created a lib directory. I created soft links between the persistent storage and /var/lib/connman/ directory as follows:
Quote:
cp -a /var/lib/connman /root/Shared_Memory/var/lib/connman
rm -r /var/lib/connman
ln -s /root/Shared_Memory/var/lib/connman /var/lib/connman
|
But then I faced the issue in the booting from the Partition. ( I was unable to boot from the Partition in which I made the changes )
So I mounted the Shared partition on my /home/debian path by creating a directory Shared_Memory.
Quote:
mount /dev/mmcblk0p4 /home/debian/Shared_Memory
|
And added in the /etc/fstab for making the mount permanent:-
/dev/mmcblk0p4 /home/debian/Shared_Memory ext4 defaults 0 2
I again created var directory under Shared_Memory and lib directory under var in Shared_Memory.
I repeated the above procedure on the /home/debian/Shared_Memory/var/lib directory and I was able to boot in the Partition.
But when I tried to connect a network using connman I was unable to connect to the Network.
So after searching for some time, I came across the /run/connman/resolv.conf file and when any network is connected using connman then all the nameserver and IP-address are stored there by default.
I found that /etc/resolv.conf is symlinked to the /run/connman/resolv.conf. And when I am trying to connect the network this breaks the Symbolic link at /etc/resolv.conf.
I found that configuration for the Symbolic link is stored under /etc/init.d/connman. I updated this line in the connman script from /etc/init.d/:
Quote:
mkdir -p /home/debian/Shared_Mem/run/connman
ln -sf /home/debian/Shared_Mem/run/connman/resolv.conf /etc/
|
I have restarted the service as follows:
Quote:
sudo chmod +x connman
sudo update-rc.d connman defaults
sudo service connman restart
|
After this, I have rebooted the system and then When I checked the /run/ directory It had a connman directory under it then I checked the Shared_Memory directory and under /run/ it has a connman directory.
Now when I try to connect the network the resolv.conf ( This is created dynamically whenever a network is connected ) is created at /run/connman/ But according to my understanding it should be created at this path /home/debian/Shared_Mem/run/connman/resolv.conf
How can I create a symbolic link for /var/lib/connman directory and /run/connman/resolv.conf so that it will connect to the network?