Setting Up Library Paths via Script
With the whole package contents in place, you need to make sure that Chromium will be able to find its libraries and other needed files. There is a pre-fabricated script for this.
- Log into Local Terminal as - root.
- Change into the - /custom/chromium-browserdirectory.
- Enter the command - ls -l.
- You will see that instead of a single script as in the previous example there are the - etc/and- usr/directories. They include many libraries and other files that Chromium will need to run.
 However, it expects these directories not within the- /custom/chromium-browser/directory, but in the filesystem root, where system directories such as- /usrare located. The Initialization Script for the Custom Partition will fix this by setting up symbolic links, so that for example- /custom/chromium-browser/usr/lib/library.sowill appear to be in- /usr/lib/library.so, where Chromium expects it.
- Use the GNU nano editor to create the file - custompart-chromium-browserand put the following contents into it - alternatively, edit the file elsewhere and copy it into- /custom/chromium-browser/:CODE- #!/bin/sh ACTION="custompart-chromium-browser_${1}" # mount point path MP=$(get custom_partition.mountpoint) # custom partition path CP="${MP}/chromium-browser" # output to systemlog with ID amd tag LOGGER="logger -it ${ACTION}" echo "Starting" | $LOGGER case "$1" in init) # Initial permissions chown -R root:root "${CP}" | $LOGGER chmod 755 "${MP}" | $LOGGER # Linking files and folders on proper path find "${CP}" | while read LINE do DEST=$(echo -n "${LINE}" | sed -e "s|${CP}||g") if [ ! -z "${DEST}" -a ! -e "${DEST}" ]; then # Remove the last slash, if it is a dir [ -d $LINE ] && DEST=$(echo "${DEST}" | sed -e "s/\/$//g") | $LOGGER if [ ! -z "${DEST}" ]; then ln -sv "${LINE}" "${DEST}" | $LOGGER fi fi done ldconfig ;; stop) killall -q -SIGTERM chromium-browser sleep 1 killall -q -SIGKILL chromium-browser ;; esac echo "Finished" | $LOGGER exit 0Use this as a script template for your Custom Partitions, replacing all instances of- chromium-browserwith the directory name of your CP.
- Make the script executable with the following command: - chmod a+x custompart-chromium-browser
- Run the script: - ./custompart-chromium-browser init
 It should run and finish without any errors.
 The library paths are set up now.
