Kod: Markera allt
configure: error: no acceptable C compiler found in $PATH
Kod: Markera allt
sudo apt-get install gcc
Kod: Markera allt
sudo yum install gcc
Kod: Markera allt
sudo apt-get install gcc
Kod: Markera allt
preprocessor "/lib/cpp" fails sanity check
Kod: Markera allt
apt-get install g++
Kod: Markera allt
root@ha:~# lsusb
...
Bus 002 Device 003: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter
...
Kod: Markera allt
/opt/owfs/bin/owfs -u --allow_other --usb_regulartime /mnt/owfs
Kod: Markera allt
#!/bin/sh
/opt/owfs/bin/owfs -u --allow_other --usb_regulartime /mnt/owfs
Kod: Markera allt
chmod 0755 /etc/init.d/owfs
Kod: Markera allt
update-rc.d owfs defaults
Kod: Markera allt
### BEGIN INIT INFO
# Provides: sudo
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before: rmnologin
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Provide limited super user privileges to specific users
# Description: Provide limited super user privileges to specific users.
### END INIT INFO
Kod: Markera allt
root@MYNAS:~# cat -n /etc/init.d/usb
1 #!/bin/sh
2 #
3 # usb: control USB interface power status
4 #
5 # blstools - Tools for Buffalo Linkstation
6 # Copyright (C) 2010-2011 Michele Manzato
7 # Distributed under the MIT License
8
9 MODULES=("usbcore" "ehci-hcd" "ohci-hcd" "uhci-hcd" "usb_storage" "usblp")
10
11 load_modules()
12 {
13 COUNTER=0
14 while [ ${MODULES[${COUNTER}]} ]
15 do
16 modprobe ${MODULES[${COUNTER}]}
17 [ $? -ne 0 ] && return 1
18 COUNTER=$((${COUNTER} + 1))
19 done
20 return 0
21 }
22
23 unload_modules()
24 {
25 COUNTER=${#MODULES[@]}
26 while [ ${COUNTER} -ge 0 ]
27 do
28 modprobe -r ${MODULES[${COUNTER}]}
29 [ $? -ne 0 ] && return 1
30 COUNTER=$((${COUNTER} - 1))
31 done
32 }
33
34 detect_usbfs()
35 {
36 IsMounted=`cat /proc/mounts |grep usbfs`
37 if [ "${IsMounted}" != "" ] ; then
38 return 1
39 else
40 return 0
41 fi
42 }
43
44 mount_usbfs()
45 {
46 detect_usbfs
47 [ $? -eq 1 ] && return 0
48 mount -t usbfs usbfs /proc/bus/usb
49 return $?
50 }
51
52 umount_usbfs()
53 {
54 detect_usbfs
55 [ $? -eq 0 ] && return 0
56 umount -f /proc/bus/usb
57 return $?
58 }
59
60
61 case $1 in
62 start)
63 # Power on the USB interface
64 echo on > /proc/buffalo/gpio/power_control/usb0
65
66 load_modules
67 [ $? -ne 0 ] && echo "USB power-on failed" 1>&2 && unload_modules && exit 1
68
69 mount_usbfs
70 ;;
71 stop)
72 umount_usbfs
73 [ $? -ne 0 ] && echo "USB power-off failed" 1>&2 && exit 1
74
75 unload_modules
76
77 # Power off the USB interface
78 echo off > /proc/buffalo/gpio/power_control/usb0
79 ;;
80 *)
81 ;;
82 esac
Kod: Markera allt
root@MYNAS:~# lsusb
Bus 001 Device 002: ID 0781:5150 SanDisk Corp. SDCZ2 Cruzer Mini Flash Drive (thin)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Kod: Markera allt
#!/bin/bash
# Starts OWFS
/opt/owfs/bin/owfs -u --allow_other --usb_regulartime /mnt/1wire
Kod: Markera allt
root@MYNAS:~# ls -la /etc/init.d/MyStartScript.sh
-rwxr-xr-x 1 root root 94 Jan 3 16:27 /etc/init.d/MyStartScript.sh
Kod: Markera allt
Tue Jan 3 16:37:18 2012: /etc/init.d/MyStartScript.sh: line 5: 929 Segmentation fault /opt/owfs/bin/owfs -u --allow_other --usb_regulartime /mnt/1wire