oplik ts1用途

Diario de la marina ( April 19, 1959 )From QNAPedia
By installing , you open the door to installing many other software packages by many different developers.
plugin on many of their products. This is probably the easiest way to install for most. We also give instructions on manual install.
This is the simplified installation method using the
update system firmware page with an Optware_Ipkg.qpkg file.
First update your firmware to the latest build.
In the device's , select the 'System Tools' -& 'QPKG' page, click on 'Get QPKG' button.
If nothing is listed you must get the package from the appropriate download page on the QNAP website.
Download 'Optware IPKG' package that matches your model.
If the archive ends with a .zip extension, then unzip the downloaded archive to get a file with a .qpkg extension.
If you're behind a proxy, put this in the /root/.wgetrc or /etc/wgetrc or both file&:
&http_proxy =
&use_proxy = on
The install will fail if you don't do that.
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.
Alternative: install it (.qpkg file) via the 'System Update' under your 'System Tools' page.
If you get this error (check your mails&!)&:
Optware 0.99.163 installation failed. /share/MD0_DATA/optware existed. Please remove it first.
ssh on the NAS and issue this command (use with care&!!)&:
rm -rf /share/MD0_DATA/.qpkg/Optware
Return to the 'QPKG Installed' tab. An icon with a penguin, and caption "Optware", should now be visible.
Click the Optware icon or caption. A dialog "QPKG Plugins - QPKG - Optware" appears. At the bottom, it has buttons "Enable", "Disable", and "Remove".
Click the "Enable" button. There is a pause, then the device gives you an alert box to confirm IPKG is enabled.
into the admin account on your NAS device.
As of April 2010,
3.2.5 build 0409T has two bugs which require you to patch an initialisation file, /etc/init.d/Optware.sh. Follow the instructions in sections
Log out, and restart the NAS device to get the patches enforced.
Confirm that ipkg is available. Ssh in again, and type: # ipkg --version. A message like ipkg version 0.99.163 appears. ipkg is now installed.
Continue to the article
for instructions on what to do next.
Some, but not all, ipkg packages install startup scripts into /opt/etc/init.d/. These are to be run as part of system startup. As of April 2010,
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.
The Optware
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 /etc/rcS.d/. The name of this link is something like QS100Optware, 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
3.2.5 build 0409T:
# ls -lFh /etc/init.d/*Optware* /etc/rcS.d/*Optware* /share/MD0_DATA/.qpkg/Optware/*Optware*
lrwxrwxrwx
40 Apr 19 16:02 /etc/init.d/Optware.sh -& /share/MD0_DATA/.qpkg/Optware/Optware.sh*
lrwxrwxrwx
40 Apr 19 16:02 /etc/rcS.d/QS100Optware -& /share/MD0_DATA/.qpkg/Optware/Optware.sh*
-rwxr-xr-x
1.9k Feb 21 21:10 /share/MD0_DATA/.qpkg/Optware/Optware.sh*
Edit the install script. It's fine to get to it via one of its :
vi /etc/init.d/Optware.sh
Look towards the end of the file for content like this:
case &$1& in
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep &PATH& | /bin/grep &/opt/bin& 1&&/dev/null 2&&/dev/null
[ $? -ne 0 ] && /bin/echo &export PATH=$PATH&:/opt/bin:/opt/sbin && /etc/profile
...[elided]...
We will add a block of code just before the ;; stop) lines. The portion of the file now looks like the following:
case &$1& in
...[elided]...
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep &PATH& | /bin/grep &/opt/bin& 1&&/dev/null 2&&/dev/null
[ $? -ne 0 ] && /bin/echo &export PATH=$PATH&:/opt/bin:/opt/sbin && /etc/profile
# Patch per /wiki/Install_Optware_IPKG
/bin/echo &Run Optware/ipkg /opt/etc/init.d/*&
source /etc/profile
# Start all init scripts in /opt/etc/init.d
# executing them in numerical order.
for i in /opt/etc/init.d/S??*&;do
# Ignore dangling symlinks (if any).
#[&! -f &$i& ] && continue
case &$i& in
# Source shell script for speed.
trap - INT QUIT TSTP
# No sh extension, so fork subprocess.
# End patch
...[elided]...
Save the file and quit the editor.
Now, restart the
device. All Optware packages which need to run at startup time, should run automatically.
Because this code runs whatever scripts are in the /opt/etc/init.d/ 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.
For further information:
(Sept-Dec 2009)
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,
3.2.5 build 0409T does not do this correctly.
[note] In July 2010, firmware 3.4.3, we do not need to modify the "Optware.sh" as below.
There is a simple fix, to the same Optware.sh file we edited in the previous section.
Edit the file:
vi /etc/init.d/Optware.sh
Look for the section of code which mentions /opt/bin. Replace it so that this part of the file looks like:
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep &PATH& | /bin/grep &/opt/bin& 1&&/dev/null 2&&/dev/null
# Bug fix for following: put IPKG first, per /viewtopic.php?f=124&t=15663
# was [ $? -ne 0 ] && /bin/echo &export PATH=$PATH&:/opt/bin:/opt/sbin && /etc/profile
[ $? -ne 0 ] && /bin/echo &export PATH=/opt/bin:/opt/sbin:\$PATH& && /etc/profile
Save the file and quit the editor.
Now, restart the
device. In the admin shell, check the $PATH environment variable. /opt/bin and /opt/sbin should come before /bin and /usr/bin. For instance:
# echo $PATH
/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin
For further information:
(June-Dec 2009) mentions both the problem with the order of path elements and the missing "\" before "$PATH".
(Dec 2009-April 2010) Another report of the missing "\" before "$PATH".
Installing the package requires that the target device has internet access otherwise the installation will fail about 60% of the way through.
After a failed install you will not be able to reattempt the installation until you manually delete the Optware directory under /share/MD0_DATA/.qpkg. Failure to do this will result in an error message in the system log stating the package is already installed.
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 .zip extension. QPKG cannot install ZIP archives. You must unzip the archive, and there should be a file with a .qpkg installation inside. You must install this .qpkg file.
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
above has been completed correctly.
For migration from previous install (automatic/manual)&to the QPKG'ed install, please see below:
umount all the mounts for your original IPKG install
# umount /share/MD0_DATA/optware/dev
# umount /share/MD0_DATA/optware/proc
# umount /share/MD0_DATA/optware/proc/bus/usb
# umount /share/MD0_DATA/optware/mnt/ext/Qmultimedia
# umount /share/MD0_DATA/optware/mnt/ext/Qdownload
# umount /share/MD0_DATA/optware/mnt/ext/Qweb
# umount /share/MD0_DATA/optware/mnt/ext/Qusb
# umount /share/MD0_DATA/optware/mnt/ext/Public
remove all the Ipkg-related entries in autorun.sh
# mount /dev/mtdblock5 /tmp/config
# vi /tmp/config/autorun.sh
remove these entries:
# Internet access...
cp /etc/resolv.conf /share/MD0_DATA/optware/etc
cp /etc/hostname /share/MD0_DATA/optware/etc
# Timezone...
cp /etc/TZ /share/MD0_DATA/optware/etc
# User/Group management...
cp /etc/config/passwd /etc/config/group /etc/config/shadow /share/MD0_DATA/optware/etc
# sym-link /share/MD0_DATA/optware/opt to /opt
rm -rf /opt
ln -sf /share/MD0_DATA/optware/opt /opt
# Mount directories into chroot
mount -o bind /dev /share/MD0_DATA/optware/dev
mount -o bind /proc /share/MD0_DATA/optware/proc
mount -o bind /proc/bus/usb /share/MD0_DATA/optware/proc/bus/usb
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qmultimedia
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qdownload
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qusb
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Qweb
mount -o bind /share/MD0_DATA/Qmultimedia /share/MD0_DATA/optware/mnt/ext/Public
# adding Ipkg apps into system path ...
export PATH=/opt/bin:/opt/sbin:$PATH
save then close
rename /share/MD0_DATA/optware
mv /share/MD0_DATA/optware /share/MD0_DATA/optware.foo
Install QPKGed IPKG according to the guide&'Automatic installation via QPKG' above (but do not enable it yet, or disable it if it was enabled after the install)
copy the IPKG start script to the old IPKG directory
# cp -af /share/MD0_DATA/optware/Optware-ipkg.sh /share/MD0_DATA/optware.foo/Optware-ipkg.sh
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.)
# rm -rf /share/MD0_DATA/optware
Rename the old IPKG folder name back
# mv /share/MD0_DATA/optware.foo /share/MD0_DATA/optware
Now you may enable/disable your previous ipkg install from your QPKG admin page and use them as normal.
This is the manual installation method.
# mkdir -p /share/MD0_DATA/optware/opt# mkdir /share/MD0_DATA/optware/ipkglib
For NAS running RAID (2 disks or above)
# cd /; ln -sf /share/MD0_DATA/optware/ipkglib /usr/lib/ipkg
For NAS running single disk (1 disk only)
# cd /; ln -sf /share/HDA_DATA/optware/ipkglib /usr/lib/ipkg
Create a symbolic link to the Optware installation directory
# rm -rf /opt# cd /; ln -sf /share/MD0_DATA/optware/opt /opt
Check if /opt is symlinked to /share/MD0_DATA/optware/opt (or /share/HDA_DATA/optware/opt)
You should see&:
opt -& /share/MD0_DATA/optware/opt/
opt -& /share/HDA_DATA/optware/opt/
First, go to optware installation directory to avoid messing up free space on root partition then downloading the package
# cd /share/MD0_DATA/big-disk
# wget http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
# tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf -
For PowerPC based devices (TS101/201) you should use http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable/ipkg-opt_0.99.163-10_powerpc.ipk instead.
For QNAP TS-459 Pro+ you should use this path for wget -&
Replace the filename for the ipkg file as appropriate in the command.
Edit /opt/etc/ipkg.conf
# vi /opt/etc/ipkg.conf
Add the line
src cs05q3armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable
Save and close with ESC and&:wq and enterUpdate the package list&:
# /opt/bin/ipkg update
You should see&:
[/] # /opt/bin/ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable/Packages
Updated list of available packages in /opt/lib/ipkg/lists/cs05q3armel
Successfully terminated.
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.
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
# cd /share/MD0_DATA/optware
# /opt/bin/ipkg update
# /opt/bin/ipkg install slang
# /opt/bin/ipkg install mc --tmp-dir=/share/MD0_DATA/
And then to run mc
/opt/bin/mc
Create the autorun.sh file
# mount /dev/mtdblock5 -t ext2 /tmp/config
# cd /tmp/config
# vi autorun.sh
Add to the following lines to the file then save and close
rm -rf /opt
ln -sf /share/MD0_DATA/optware/opt /opt
echo &export PATH=$PATH:/opt/bin:/opt/sbin& && /etc/profile
Make autorun.sh executable and do not forget to unmount&!
# chmod +x autorun.sh
# umount /dev/mtdblock5
Note, for TS101/201 users, you should use /dev/mtdblock4 instead of /dev/mtdblock5.
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. Note, Currently supports arm systems with RAID only, installs coreutils ipkg
qnap_install_coreutils.sh
#!/bin/bash
echo &Coreutils setup script&
echo &by Jim Barstow &&&
start_time=`date &+%F&%r&`
echo &Coreutils setup started at ${start_time}&
echo -n &Checking for RAID mount point... &
if [&! -d &/share/MD0_DATA/& ]; then
echo &FAIL: RAID mount point not found.&
opt_mountpoint=&/share/MD0_DATA&
echo -n &Creating required directories... &
if [&! -d &${opt_mountpoint}/optware/opt& ]; then
mkdir -p ${opt_mountpoint}/optware/opt
if [&! -d &${opt_mountpoint}/optware/ipkglib& ]; then
mkdir ${opt_mountpoint}/optware/ipkglib
if [ -d &${opt_mountpoint}/optware/opt/& -a -d &${opt_mountpoint}/optware/ipkglib& ]; then
echo &FAIL: required directories could not be created.&
echo -n &Symlinking ipkg to /usr/lib/ipkg... &
cd /; ln -sf ${opt_mountpoint}/optware/ipkglib /usr/lib/ipkg
echo -n &Symlinking /opt... &
if [ -d &/opt& ]; then
mv /opt /opt.bak
rm -rf /opt
cd /; ln -sf ${opt_mountpoint}/optware/opt /opt
echo -n &Updating path to include /opt/bin... &
export PATH=/opt/bin:$PATH
echo -n &Verifying/Creating sources location... &
if [&! -d &${opt_mountpoint}/opt_sources/& ]; then
mkdir ${opt_mountpoint}/opt_sources
if [&! -d &${opt_mountpoint}/opt_sources/& ]; then
echo &FAIL: sources location could not be created.&
echo -n &Verifying system type is ARM... &
sys_type=`uname -m`
if [[ &${sys_type}&==&armv5tel& ]]; then
echo &FAIL: got system type ${sys_type}.&
echo -n &Downloading ipkg source... &
cd ${opt_mountpoint}/opt_sources/
wget -q http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
if [ -f &${opt_mountpoint}/opt_sources/ipkg-opt_0.99.163-10_arm.ipk& ]; then
echo &FAIL: could not download ipkg source.&
echo -n &Extracting ipkg source... &
tar -xOzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzf -
echo -n &Configuring ipkg... &
ipkg_src=`cat /opt/etc/ipkg.conf | grep &src cs05q3armel&`
if [ -z &$ipkg_src& ]; then
echo &src cs05q3armel http://ipkg.nslu2-linux.org/feeds/optware/cs05q3armel/cross/stable& &&/opt/etc/ipkg.conf
echo -n &Updating ipkg... &
/opt/bin/ipkg update -V0
echo -n &Installing coreutils... &
cd ${opt_mountpoint}/optware
/opt/bin/ipkg update -V0
/opt/bin/ipkg install -V0 coreutils
echo -n &Symlinking coreutils-nohup to /usr/bin/nohup... &
ln -sf /opt/bin/coreutils-nohup /usr/bin/nohup
if [ -f &/usr/bin/nohup& ]; then
echo &FAIL: could not symlink /usr/bin/nohup.&
end_time=`date &+%F&%r&`
echo &Coreutils setup completed at ${end_time}&
Personal tools
EnglishDeutschItaliano日本語???РусскийDanskSvenska?Norsk (bokm?l)?SuomiFran?ais?中文(台灣)??中文(中国大陆)?PolskiEspa?ol
This page was last modified on 27 February 2014, at 13:05.
This page has been accessed 363,875 times.

我要回帖

更多关于 壳聚糖用途 的文章

 

随机推荐