Skip to content

一些QNAP的脚本

TS216

mount -t ext2 /dev/mmcblk0p5 /tmp/config

swap off

swapoff -a echo 20 >/proc/sys/vm/swappiness swapon /dev/md321

Disconnecting md9

sudo mdadm -D /dev/md9 sudo mdadm /dev/md9 --fail /dev/sdb1 sudo mdadm /dev/md9 --fail /dev/sda1

Disconnecting md13

sudo mdadm -D /dev/md13 sudo mdadm /dev/md13 --fail /dev/sdb4 sudo mdadm /dev/md13 --fail /dev/sda4

QNAP TS-453Bmini r8156 Realtek USB 2.5G

usb device id

qnap#lsusb 0bda:8156 Realtek Semiconductor Corp

check gcc version

qnap#cat /proc/version Linux version 4.14.24-qnap (root@U16BuildServer45) (gcc version 4.9.2 (toolchain config: [gcc-4.9.2 binutils-2.25 glibc-2.21]))

install ubuntu 16 vm

apt install libelf-dev make gcc-4.9 ln -s /usr/bin/gcc-4.9 /usr/bin/gcc

Download QTS GPL from https://sourceforge.net/projects/qosgpl/ Download realtek linux driver https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software cp r8152-2.14.0/r8152.c GPL_QTS/src/linux-4.14/drivers/net/usb/ cp r8152-2.14.0/compatibility.h GPL_QTS/src/linux-4.14/drivers/net/usb/ cd GPL_QTS/src/linux-4.14 ;make modules SUBDIRS=drivers/net/usb/ cp usbnet.ko and r8152.ko to qnap

#!/usr/bin/env bash echo "start autorun">/var/log/autorun.log /sbin/rmmod r8152 /sbin/rmmod usbnet sleep 3 /sbin/insmod /share/CACHEDEV4_DATA/data/usbnet.ko /sbin/insmod /share/CACHEDEV4_DATA/data/r8152.ko echo "done autorun" >> /var/log/autorun.log exit 0

enable autorun.sh

mount $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config vi /tmp/config/autorun.sh TS216 mount -t ext2 /dev/mmcblk0p5 /tmp/config

qnap fix screen error

export TERM=xterm-xfree86 ls /usr/share/terminfo/x

qnap enable git /opt/etc/init.d/S22git.sh

#!/bin/sh ENABLED=yes echo "Asia/Shanghai" > /etc/timezone if [ -f /usr/bin/git ]; then exit 0 fi ln -s /opt/bin/git /usr/bin/git ln -s /opt/bin/git-receive-pack /usr/bin/git-receive-pack ln -s /opt/bin/git-shell /usr/bin/git-shell ln -s /opt/bin/git-upload-archive /usr/bin/git-upload-archive ln -s /opt/bin/git-upload-pack /usr/bin/git-upload-pack

QTransmission

/share/CACHEDEV7_DATA/.qpkg/QTransmission ./QTransmission.sh stop "watch-dir": "/share/share/download/bt", "watch-dir-enabled": true,