Skip to main content
Skip table of contents

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.

  1. Log into Local Terminal as root.

  2. Change into the /custom/chromium-browser directory.

  3. Enter the command ls -l.

  4. 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 /usr are 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.so will appear to be in /usr/lib/library.so, where Chromium expects it.

  5. Use the GNU nano editor to create the file custompart-chromium-browser and 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 0
    Use this as a script template for your Custom Partitions, replacing all instances of chromium-browser with the directory name of your CP.

  6. Make the script executable with the following command:
    chmod a+x custompart-chromium-browser

  7. Run the script:
    ./custompart-chromium-browser init
    It should run and finish without any errors.
    The library paths are set up now.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.