Skip to content

Instantly share code, notes, and snippets.

@JohnMorales
Created October 3, 2016 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnMorales/8358bebcde6472b97faee8f30d272053 to your computer and use it in GitHub Desktop.
Save JohnMorales/8358bebcde6472b97faee8f30d272053 to your computer and use it in GitHub Desktop.
mkdir /volume1/@optware
mkdir /opt
mount -o bind /volume1/@optware /opt
feed=http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
ipk_name=`wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}'`
wget $feed/$ipk_name
tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf -
mkdir -p /opt/etc/ipkg
echo "src cross $feed" > /opt/etc/ipkg/feeds.conf
sed -i -e '/PATH=/ i\
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin' -e '/PATH=/ d' /root/.profile
touch /etc/rc.local
chmod 755 /etc/rc.local
echo <<OUTPUT > /etc/rc.local
#!/bin/sh
# Optware setup
[ -x /etc/rc.optware ] && /etc/rc.optware start
OUTPUT
touch /etc/rc.optware
chmod 755 /etc/rc.optware
cat <<OUTPUT > /etc/rc.optware
#! /bin/sh
if test -z "${REAL_OPT_DIR}"; then
# next line to be replaced according to OPTWARE_TARGET
REAL_OPT_DIR=/volume1/@optware
fi
case "$1" in
start)
echo "Starting Optware."
if test -n "${REAL_OPT_DIR}"; then
if ! grep ' /opt ' /proc/mounts >/dev/null 2>&1 ; then
mkdir -p /opt
mount -o bind ${REAL_OPT_DIR} /opt
fi
fi
[ -x /opt/etc/rc.optware ] && /opt/etc/rc.optware
;;
reconfig)
;;
stop)
echo "Shutting down Optware."
;;
*)
echo "Usage: $0 {start|stop|reconfig}"
exit 1
esac
exit 0
OUTPUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment