https://wiki.qnap.com/mediawiki/index.php?title=Install_Optware_IPKG&feed=atom&action=historyInstall Optware IPKG - Revision history2024-03-29T06:38:23ZRevision history for this page on the wikiMediaWiki 1.39.3https://wiki.qnap.com/mediawiki/index.php?title=Install_Optware_IPKG&diff=1510&oldid=prevJim DeLaHunt: Describe Optware as withdrawn.2019-01-28T05:52:26Z<p>Describe Optware as withdrawn.</p>
<a href="https://wiki.qnap.com/mediawiki/index.php?title=Install_Optware_IPKG&diff=1510&oldid=29">Show changes</a>Jim DeLaHunthttps://wiki.qnap.com/mediawiki/index.php?title=Install_Optware_IPKG&diff=29&oldid=prevAdmin: 1 revision imported2015-06-16T06:52:26Z<p>1 revision imported</p>
<p><b>New page</b></p><div>By installing [[Optware IPKG]], you open the door to installing many other software packages by many different developers. [[QNAP]] supplies [[Ipkg]] as a [[QPKG]] plugin on many of their products. This is probably the easiest way to install for most. We also give instructions on manual install. <br />
<br />
== Simplified installation using QPKG ==<br />
<br />
This is the simplified installation method using the [[QPKG]] update system firmware page with an <tt>Optware_Ipkg.qpkg</tt> file. <br />
<br />
#First update your firmware to the latest build. <br />
#In the device's [[Administration interface]], select ''''App Center''''. In the App Center window, search for "Optware" using the search box at the top left, or click on the "Developer Tools" item in the left pane. An icon "Optware IPKG" appears. Click on the icon, and the App Center will install it.<br />
<br />
=== Installation in firmware 3.2x ===<br />
<br />
If you are using Firmware before version 4.x, your Administration Interface might not have an 'App Center'. The following instructions are appropriate for firmware 3.2.x, and may be appropriate for firmware as late as 3.8.x. (No editor of this article has checked on 3.6.x through 3.8.x yet.) <br />
<br />
#*For firmware version 3.2x, select the ''''System Tools'''' -&gt; ''''QPKG'''' page, click on ''''Get QPKG'''' button. <br />
#*If nothing is listed you must get the package from the appropriate download page on the QNAP website. <br />
#Download ''''Optware IPKG'''' package that matches your model. <br />
#If the archive ends with a <tt>.zip</tt> extension, then unzip the downloaded archive to get a file with a <tt>.qpkg</tt> extension. <br />
#If you're behind a proxy, put this in the <tt>/root/.wgetrc</tt> or in the <tt>/etc/wgetrc</tt> or in both:<br />
<br />
:http_proxy = http://proxy.domain.com:3128 <br />
:use_proxy = on<br />
<br />
The install will fail if you don't do that. <br />
<br />
#Now install the qpkg file. Go to the ''''Installation'''' tab. Click the '''Browse''' button, and select the qpkg file. Click the OK button. A progress bar appears, then a confirmation dialog that the installation was successful. <br />
#*Alternative: install it (.qpkg file) via the ''''System Update'''' under your ''''System Tools'''' page. <br />
#If you get this error (check your mails!):<br />
<br />
Optware 0.99.163 installation failed. /share/MD0_DATA/optware existed. Please remove it first. <br />
<br />
ssh on the NAS and issue this command (use with care!!): <br />
<br />
rm -rf /share/MD0_DATA/.qpkg/Optware<br />
<br />
#Return to the ''''QPKG Installed'''' tab. An icon with a penguin, and caption "Optware", should now be visible. <br />
#Click the Optware icon or caption. A dialog "QPKG Plugins - QPKG - Optware" appears. At the bottom, it has buttons "Enable", "Disable", and "Remove". <br />
#Click the "Enable" button. There is a pause, then the device gives you an alert box to confirm IPKG is enabled. <br />
#Now [[Ssh]] into the admin account on your NAS device. <br />
#As of April 2010, [[TS-219P]] [[Firmware]] 3.2.5 build 0409T has two bugs which require you to patch an initialisation file, <tt>/etc/init.d/Optware.sh</tt>. Follow the instructions in sections '''[[#Running_.2Fopt.2Fetc.2Finit.d.2F.2A_on_startup]]''' and '''[[#Fix_the_.24PATH_in_.2Fetc.2Fprofile]]''' below. <br />
#Log out, and restart the NAS device to get the patches enforced. <br />
#Confirm that ipkg is available. Ssh in again, and type: <tt># ipkg --version</tt>. A message like <tt>ipkg version 0.99.163</tt> appears. ipkg is now installed.<br />
<br />
Continue to the article [[Using IPKG]] for instructions on what to do next. <br />
<br />
<br> <br />
<br />
=== Running /opt/etc/init.d/* on startup ===<br />
<br />
Some, but not all, ipkg packages install startup scripts into <tt>/opt/etc/init.d/</tt>. These are to be run as part of system startup. As of April 2010, [[TS-219P]] [[Firmware]] 3.2.5 build 0409T does not run the scripts in this directory. This section explains how to patch the firmware to add this startup action. <br />
<br />
The Optware [[QPKG]] creates an initialisation script and stores it in a QPKG Optware directory on your main data share. When the QNAP NAS device starts up, it adds a link to this script from <tt>/etc/rcS.d/</tt>. The name of this link is something like <tt>QS100Optware</tt>, where 100 is a sequence number that depends on how many QPKG packages you installed and in what order. This is what these files look like in [[TS-219P]] [[Firmware]] 3.2.5 build 0409T: <br />
<pre># ls -lFh /etc/init.d/*Optware* /etc/rcS.d/*Optware* /share/MD0_DATA/.qpkg/Optware/*Optware*<br />
lrwxrwxrwx 1 admin administ 40 Apr 19 16:02 /etc/init.d/Optware.sh -&gt; /share/MD0_DATA/.qpkg/Optware/Optware.sh*<br />
lrwxrwxrwx 1 admin administ 40 Apr 19 16:02 /etc/rcS.d/QS100Optware -&gt; /share/MD0_DATA/.qpkg/Optware/Optware.sh*<br />
-rwxr-xr-x 1 admin administ 1.9k Feb 21 21:10 /share/MD0_DATA/.qpkg/Optware/Optware.sh*<br />
</pre> <br />
Edit the install script. It's fine to get to it via one of its [[Symlink]]s: <br />
<br />
vi /etc/init.d/Optware.sh<br />
<br />
Look towards the end of the file for content like this: <br />
<pre>case "$1" in<br />
start)<br />
...[elided]...<br />
# adding Ipkg apps into system path ...<br />
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1&gt;&gt;/dev/null 2&gt;&gt;/dev/null<br />
[ $? -ne 0 ] &amp;&amp; /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin &gt;&gt; /etc/profile<br />
<br />
;;<br />
stop)<br />
...[elided]...<br />
</pre> <br />
We will add a block of code just before the <tt>;; stop)</tt> lines. The portion of the file now looks like the following: <br />
<pre>case "$1" in<br />
start)<br />
...[elided]...<br />
# adding Ipkg apps into system path ...<br />
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1&gt;&gt;/dev/null 2&gt;&gt;/dev/null<br />
[ $? -ne 0 ] &amp;&amp; /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin &gt;&gt; /etc/profile<br />
<br />
# Patch per http://wiki.qnap.com/wiki/Install_Optware_IPKG<br />
/bin/echo "Run Optware/ipkg /opt/etc/init.d/*"<br />
source /etc/profile<br />
# Start all init scripts in /opt/etc/init.d<br />
# executing them in numerical order.<br />
# 11-May-2015 edit: added semi-colon to for-do statement otherwise script throws an error<br />
#<br />
for i in /opt/etc/init.d/S??*; do<br />
# Ignore dangling symlinks (if any).<br />
#[&nbsp;! -f "$i" ] &amp;&amp; continue<br />
<br />
case "$i" in<br />
*.sh)<br />
# Source shell script for speed.<br />
(<br />
trap - INT QUIT TSTP<br />
set start<br />
. $i<br />
)<br />
&nbsp;;;<br />
*)<br />
# No sh extension, so fork subprocess.<br />
$i start<br />
&nbsp;;; <br />
esac <br />
done <br />
# End patch<br />
<br />
;;<br />
stop)<br />
...[elided]...<br />
</pre> <br />
Save the file and quit the editor. <br />
<br />
Now, restart the [[QNAP]] [[NAS]] device. All Optware packages which need to run at startup time, should run automatically. <br />
<br />
Because this code runs whatever scripts are in the <tt>/opt/etc/init.d/</tt> directory, you do not need to modify it when you add or remove Optware packages. However, there's a likelihood that future QNAP firmware releases may overwrite Optware.sh. This would require you to reapply this patch. <br />
<br />
For further information: <br />
<br />
*[http://forum.qnap.com/viewtopic.php?f=85&t=18977 Forum post "[EXPLAIN) autorun.sh and Optware ipkg server prog."] (Sept-Dec 2009)<br />
<br />
=== Fix the $PATH in /etc/profile ===<br />
<br />
The code that sets up the Optware environment should extend the $PATH environment variable, adding the Optware bin directories to the head of the path where they can preempt any equivalents that come with the QNAP firmware. It should also preserve the original path, with any modifications which other software made. As of April 2010, [[TS-219P]] [[Firmware]] 3.2.5 build 0409T does not do this correctly. <br />
<br />
[note] In July 2010, firmware 3.4.3, we do not need to modify the "Optware.sh" as below. <br />
<br />
There is a simple fix, to the same Optware.sh file we edited in the previous section. <br />
<br />
Edit the file: <br />
<br />
vi /etc/init.d/Optware.sh<br />
<br />
Look for the section of code which mentions <tt>/opt/bin</tt>. Replace it so that this part of the file looks like: <br />
<pre> # adding Ipkg apps into system path ...<br />
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1&gt;&gt;/dev/null 2&gt;&gt;/dev/null<br />
# Bug fix for following: put IPKG first, per http://forum.qnap.com/viewtopic.php?f=124&amp;t=15663<br />
# was [ $? -ne 0 ] &amp;&amp; /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin &gt;&gt; /etc/profile<br />
[ $? -ne 0 ] &amp;&amp; /bin/echo "export PATH=/opt/bin:/opt/sbin:\$PATH" &gt;&gt; /etc/profile<br />
</pre> <br />
Save the file and quit the editor. <br />
<br />
Now, restart the [[QNAP]] [[NAS]] device. In the admin shell, check the $PATH environment variable. /opt/bin and /opt/sbin should come before /bin and /usr/bin. For instance: <br />
<pre># echo $PATH<br />
/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin<br />
</pre> <br />
For further information: <br />
<br />
*[http://forum.qnap.com/viewtopic.php?f=124&t=15663 Forum thread "[REQUEST) IPKG paths must come first in $PATH"] (June-Dec 2009) mentions both the problem with the order of path elements and the missing "\" before "$PATH". <br />
*[http://forum.qnap.com/viewtopic.php?f=85&t=23284&start=0 Forum thread "[FIX) Optware.sh PATH Bug...."] (Dec 2009-April 2010) Another report of the missing "\" before "$PATH".<br />
<br />
=== Troubleshooting ===<br />
<br />
*Installing the package requires that the target device has internet access otherwise the installation will fail about 60% of the way through. <br />
*After a failed install you will not be able to reattempt the installation until you manually delete the <tt>Optware</tt> directory under <tt>/share/MD0_DATA/.qpkg</tt>. Failure to do this will result in an error message in the system log stating the package is already installed. <br />
*If you perform an installation through QPKG, get an installation successful alert, but ipkg doesn't appear in the ''''QPKG Installed'''' tab, check to see if you installed a file with a <tt>.zip</tt> extension. QPKG cannot install ZIP archives. You must unzip the archive, and there should be a file with a <tt>.qpkg</tt> installation inside. You must install this .qpkg file. <br />
*If you install an Optware package, and it runs right after installation but fails to restart automatically when the server restarts, then check to see that the patch in [[#Running_.2Fopt.2Fetc.2Finit.d.2F.2A_on_startup]] above has been completed correctly.<br />
<br />
== Migrating from the previous installation (either automatic script or manual) ==<br />
<br />
For migration from previous install (automatic/manual)&nbsp;to the QPKG'ed install, please see below: <br />
<br />
<br> <br />
<br />
*umount all the mounts for your original IPKG install<br />
<pre># umount /share/MD0_DATA/optware/dev<br />
# umount /share/MD0_DATA/optware/proc<br />
# umount /share/MD0_DATA/optware/proc/bus/usb<br />
# umount /share/MD0_DATA/optware/mnt/ext/Qmultimedia<br />
# umount /share/MD0_DATA/optware/mnt/ext/Qdownload<br />
# umount /share/MD0_DATA/optware/mnt/ext/Qweb<br />
# umount /share/MD0_DATA/optware/mnt/ext/Qusb<br />
# umount /share/MD0_DATA/optware/mnt/ext/Public</pre> <br />
*remove all the Ipkg-related entries in autorun.sh<br />
<pre># mount /dev/mtdblock5 /tmp/config<br />
# vi /tmp/config/autorun.sh</pre> <br />
*remove these entries:<br />
<pre># Internet access... <br />
cp /etc/resolv.conf /share/MD0_DATA/optware/etc<br />
cp /etc/hostname /share/MD0_DATA/optware/etc<br />
# Timezone... <br />
cp /etc/TZ /share/MD0_DATA/optware/etc<br />
# User/Group management... <br />
cp /etc/config/passwd /etc/config/group /etc/config/shadow /share/MD0_DATA/optware/etc<br />
# sym-link /share/MD0_DATA/optware/opt to /opt<br />
rm -rf /opt<br />
ln -sf /share/MD0_DATA/optware/opt /opt<br />
# Mount directories into chroot<br />
mount -o bind /dev /share/MD0_DATA/optware/dev<br />
mount -o bind /proc /share/MD0_DATA/optware/proc<br />
mount -o bind /proc/bus/usb /share/MD0_DATA/optware/proc/bus/usb<br />
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qmultimedia<br />
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qdownload<br />
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qusb<br />
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qweb<br />
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Public<br />
# adding Ipkg apps into system path ...<br />
export PATH=/opt/bin:/opt/sbin:$PATH </pre> <br />
*save then close<br />
<br />
&nbsp; <br />
<br />
*rename /share/MD0_DATA/optware<br />
<pre>mv /share/MD0_DATA/optware /share/MD0_DATA/optware.foo</pre> <br />
*Install QPKGed IPKG according to the guide&nbsp;''''Automatic installation via QPKG'''' above (but do not enable it yet, or disable it if it was enabled after the install)<br />
<br />
&nbsp; <br />
<br />
*copy the IPKG start script to the old IPKG directory<br />
<pre># cp -af /share/MD0_DATA/optware/Optware-ipkg.sh /share/MD0_DATA/optware.foo/Optware-ipkg.sh</pre> <br />
*Now remove the optware directory you've just install (Warning! make sure Optware_Ipkg is not enabled! or no mounts is present on any of the directories under the newly installed ipkg location, eg, /share/MD0_DATA/optware/mnt/ext/Public or /share/MD0_DATA/optware/share/Public, etc... Failed to do so will wipe all your data under /share/Public, /share/Qdownload, /share/Qmultimedia, /share/Qusb and /share/Qweb on your hard drive. you can check this by 'df' and see if any mount points are made under these locations.)<br />
<pre># rm -rf /share/MD0_DATA/optware</pre> <br />
*Rename the old IPKG folder name back<br />
<pre># mv /share/MD0_DATA/optware.foo /share/MD0_DATA/optware </pre> <br />
*Now you may enable/disable your previous ipkg install from your QPKG admin page and use them as normal.<br />
<br />
<br><br> <br />
<br />
== Manual installation<br> ==<br />
<br />
This is the manual installation method.<br> <br />
<br />
<br> <br />
<br />
==== Create the required directories on the NAS<br> ====<br />
<br />
----<br />
<pre># mkdir -p /share/MD0_DATA/optware/opt</pre><pre># mkdir /share/MD0_DATA/optware/ipkglib<br />
</pre> <br />
<br> <br />
<br />
Note:<br> <br />
<br />
*For NAS running RAID (2 disks or above)<br><br />
<pre># cd /; ln -sf /share/MD0_DATA/optware/ipkglib /usr/lib/ipkg</pre> <br />
*For NAS running single disk (1 disk only)<br><br />
<pre># cd /; ln -sf /share/HDA_DATA/optware/ipkglib /usr/lib/ipkg</pre> <br />
<br> <br />
<br />
==== Create a symbolic link to /opt<br> ====<br />
<br />
----<br />
<br />
<br>Create a symbolic link to the Optware installation directory<br> <br />
<pre># rm -rf /opt</pre><pre># cd /; ln -sf /share/MD0_DATA/optware/opt /opt</pre> <br />
<br> <br />
<br />
Check if /opt is symlinked to /share/MD0_DATA/optware/opt (or /share/HDA_DATA/optware/opt)<br> <br />
<pre># cd /<br />
# ls -la</pre> <br />
<br>You should see&nbsp;: <br />
<pre>opt -&gt; /share/MD0_DATA/optware/opt/ <br />
</pre> <br />
or<br> <br />
<pre>opt -&gt; /share/HDA_DATA/optware/opt/<br />
</pre> <br />
<br> <br />
<br />
==== <br>Download and the ipkg file package ====<br />
<br />
----<br />
<br />
<br> <br />
<br />
First, go to optware installation directory to avoid messing up free space on root partition then downloading the package<br> <br />
<pre># cd /share/MD0_DATA/big-disk <br />
# wget http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk <br />
# tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -</pre> <br />
<u>'''Note'''</u> <br />
<br />
For PowerPC based devices (TS101/201) you should use <nowiki>http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable/ipkg-opt_0.99.163-10_powerpc.ipk</nowiki> instead. <br />
<br />
*For QNAP TS-459 Pro+ you should use this path for wget -&nbsp;[http://ipkg.nslu2-linux.org/feeds/optware/ts509/cross/unstable/ http://ipkg.nslu2-linux.org/feeds/optware/ts509/cross/unstable/]<br />
<br />
Replace the filename for the ipkg file as appropriate in the command. <br />
<br />
<br>Edit /opt/etc/ipkg.conf<br> <br />
<pre># vi /opt/etc/ipkg.conf</pre> <br />
Add the line<br> <br />
<pre>src cs05q3armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable</pre> <br />
Save and close with ESC and&nbsp;:wq and enter<br><br>Update the package list&nbsp;: <br />
<pre># /opt/bin/ipkg update</pre> <br />
<br>You should see&nbsp;: <br />
<pre>[/] # /opt/bin/ipkg update <br />
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable/Packages <br />
Updated list of available packages in /opt/lib/ipkg/lists/cs05q3armel <br />
Successfully terminated.</pre> <br />
<br>If there are errors or you do not see Downloading info that means that either you did not edit ipkg.conf mentioned before or hm. <br />
<br />
<br> <br />
<br />
==== Install applications (mc in this example) ====<br />
<br />
----<br />
<br />
<br> <br />
<br />
Change to optware directory cause this ipkg left some strange files which makes / partition to small, i dont know if its an error or something <br />
<pre># cd /share/MD0_DATA/optware <br />
# /opt/bin/ipkg update <br />
# /opt/bin/ipkg install slang <br />
# /opt/bin/ipkg install mc --tmp-dir=/share/MD0_DATA/</pre> <br />
<br> <br />
<br />
And then to run mc <br />
<pre>/opt/bin/mc</pre> <br />
<br> <br />
<br />
==== Preserve the configurations on reboot ====<br />
<br />
----<br />
<br />
<br> <br />
<br />
Create the autorun.sh file <br />
<pre># mount /dev/mtdblock5 -t ext2 /tmp/config <br />
# cd /tmp/config <br />
# vi autorun.sh</pre> <br />
<br>Add to the following lines to the file then save and close <br />
<pre>rm -rf /opt<br />
ln -sf /share/MD0_DATA/optware/opt /opt<br />
echo "export PATH=$PATH:/opt/bin:/opt/sbin" &gt;&gt; /etc/profile</pre> <br />
<br> <br />
<br />
Make autorun.sh executable and do not forget to unmount&nbsp;!<br> <br />
<pre># chmod +x autorun.sh<br />
# cd /<br />
# umount /dev/mtdblock5<br />
<br />
</pre> <br />
'''Note''', for TS101/201 users, you should use '''/dev/mtdblock4''' instead of '''/dev/mtdblock5'''.<br> <br />
<br />
<br> <br />
<br />
== Scripted Manual Installation ==<br />
<br />
'''Note''', this script is a starting point for your own scripts, but thought it might be useful. YMMV, please modify it to your liking and send me an email telling me about your cool improvements.<br> '''Note''', Currently supports arm systems with RAID only, installs coreutils ipkg <br />
<br />
'''qnap_install_coreutils.sh''' <br />
<pre>#!/bin/bash<br />
clear<br />
echo "Coreutils setup script"<br />
echo "by Jim Barstow &lt;barstow@dynedge.com&gt;"<br />
echo<br />
start_time=`date "+%F&nbsp;%r"`<br />
echo "Coreutils setup started at ${start_time}"<br />
<br />
echo -n "Checking for RAID mount point... "<br />
if [&nbsp;! -d "/share/MD0_DATA/" ]; then<br />
echo "FAIL: RAID mount point not found."<br />
exit 1<br />
else<br />
opt_mountpoint="/share/MD0_DATA"<br />
echo "OK"<br />
fi<br />
<br />
echo -n "Creating required directories... "<br />
if [&nbsp;! -d "${opt_mountpoint}/optware/opt" ]; then<br />
mkdir -p ${opt_mountpoint}/optware/opt<br />
fi<br />
if [&nbsp;! -d "${opt_mountpoint}/optware/ipkglib" ]; then<br />
mkdir ${opt_mountpoint}/optware/ipkglib<br />
fi<br />
if [ -d "${opt_mountpoint}/optware/opt/" -a -d "${opt_mountpoint}/optware/ipkglib" ]; then<br />
echo "OK"<br />
else<br />
echo "FAIL: required directories could not be created."<br />
exit 1<br />
fi<br />
<br />
echo -n "Symlinking ipkg to /usr/lib/ipkg... "<br />
cd /; ln -sf ${opt_mountpoint}/optware/ipkglib /usr/lib/ipkg<br />
echo "OK"<br />
<br />
echo -n "Symlinking /opt... "<br />
if [ -d "/opt" ]; then<br />
mv /opt /opt.bak<br />
rm -rf /opt<br />
fi<br />
cd /; ln -sf ${opt_mountpoint}/optware/opt /opt<br />
echo "OK"<br />
<br />
echo -n "Updating path to include /opt/bin... "<br />
export PATH=/opt/bin:$PATH<br />
echo "OK"<br />
<br />
echo -n "Verifying/Creating sources location... "<br />
if [&nbsp;! -d "${opt_mountpoint}/opt_sources/" ]; then<br />
mkdir ${opt_mountpoint}/opt_sources<br />
fi<br />
if [&nbsp;! -d "${opt_mountpoint}/opt_sources/" ]; then<br />
echo "FAIL: sources location could not be created."<br />
exit 1<br />
else<br />
echo "OK"<br />
fi<br />
<br />
echo -n "Verifying system type is ARM... "<br />
sys_type=`uname -m`<br />
if [[ "${sys_type}"=="armv5tel" ]]; then<br />
echo "OK"<br />
else<br />
echo "FAIL: got system type ${sys_type}."<br />
exit 1<br />
fi<br />
<br />
echo -n "Downloading ipkg source... "<br />
cd ${opt_mountpoint}/opt_sources/<br />
wget -q http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk<br />
if [ -f "${opt_mountpoint}/opt_sources/ipkg-opt_0.99.163-10_arm.ipk" ]; then<br />
echo "OK"<br />
else<br />
echo "FAIL: could not download ipkg source."<br />
exit 1<br />
fi<br />
<br />
echo -n "Extracting ipkg source... "<br />
tar -xOzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzf -<br />
echo "OK"<br />
<br />
echo -n "Configuring ipkg... "<br />
ipkg_src=`cat /opt/etc/ipkg.conf | grep "src cs05q3armel"`<br />
if [ -z "$ipkg_src" ]; then<br />
echo "src cs05q3armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable" &gt;&gt;/opt/etc/ipkg.conf<br />
echo "OK"<br />
else<br />
echo "OK"<br />
fi<br />
<br />
echo -n "Updating ipkg... "<br />
/opt/bin/ipkg update -V0<br />
echo "OK"<br />
<br />
echo -n "Installing coreutils... "<br />
cd ${opt_mountpoint}/optware<br />
/opt/bin/ipkg update -V0<br />
/opt/bin/ipkg install -V0 coreutils<br />
echo "OK"<br />
<br />
echo -n "Symlinking coreutils-nohup to /usr/bin/nohup... "<br />
ln -sf /opt/bin/coreutils-nohup /usr/bin/nohup<br />
if [ -f "/usr/bin/nohup" ]; then<br />
echo "OK"<br />
else<br />
echo "FAIL: could not symlink /usr/bin/nohup."<br />
exit 1<br />
fi<br />
<br />
end_time=`date "+%F&nbsp;%r"`<br />
echo "Coreutils setup completed at ${end_time}"<br />
<br />
<br />
<br />
</pre> <br />
<br> <br />
<br />
[[Category:QPKG]] [[Category:Optware_IPKG|Optware_IPKG]]</div>Admin