#!/bin/bash
# Author: Steven Shiau <steven _at_ nchc org tw>
# License: GPL

# Prepare drbl/clonezilla runtime programs and dir
echo "Preparing Clonezilla program..."
tar -xzf /live_media/pkg/opt_drbl.tgz -C /
if [ -e /live_media/pkg/custom-ocs ]; then
  # We do not put custom-ocs in /opt/drbl/sbin/, we put it in /opt/local/sbin/ so that when we use clonezilla live to create a custom clonezilla live, it won't be put in the custom clonezilla live. It should be put by ocs-iso, not in the tarball.
  mkdir -p /opt/local/sbin/
  cp -f /live_media/pkg/custom-ocs /opt/local/sbin/
  chmod 755 /opt/local/sbin/custom-ocs
fi
cp -a /live_media/etc/ocs /etc/
mkdir -p /opt/drbl/lib/; ln -fs /live_media/pkg/unifont.bgf /opt/drbl/lib/unifont.bgf
