|
本帖最后由 zhuojianshu 于 2012-10-30 00:03 编辑
固件默认支持EXT4的格式,但用WIN多阿,EXT4真的比较麻烦。。要怎么才能支持?已经装了ntfs-3g这个软件了,但还是挂不上
输入那个什么命令,提示如图。。高手快来教教吧。。
mount脚本
#!/bin/sh
# Copyright (C) 2009-2010 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# Modified By RA
. /lib/functions/block.sh
set_devices(){
set_section=$(uci show fstab |grep $get_uuid|awk -F "." '{print $2}')
old_device=$(uci get fstab.${set_section}.device)
[ "$old_device" != "/dev/$device" ]&&{
uci set fstab.${set_section}.device="/dev/$device"
uci commit fstab
}
}
set_fstab(){
isext4=$(blkid | grep "/dev/$device" | grep -c ext4)
isext3=$(blkid | grep "/dev/$device" | grep -c ext3)
isntfs=$(fdisk -l | grep "/dev/$device" | grep -v exFAT | grep -c NTFS)
isexfat=$(fdisk -l | grep "/dev/$device" | grep -c exFAT)
isvfat=$(fdisk -l | grep "/dev/$device" | grep -c FAT)
isswap=$(fdisk -l | grep "/dev/$device" | grep -c swap)
if [ "$isntfs" -ge "1" ] ; then
my_fstype=ntfs
elif [ "$isexfat" -ge "1" ] ; then
my_fstype=fuseblk
elif [ "$isvfat" -ge "1" ] ; then
my_fstype=vfat
elif [ "$isswap" -ge "1" ] ; then
my_fstype=swap
elif [ "$isext4" -ge "1" ] ; then
my_fstype=ext4
elif [ "$isext3" -ge "1" ] ; then
my_fstype=ext3
fi
if [ "$my_fstype" == "swap" ] ; then
j=$(uci show fstab |grep "fstab.@swap"|grep -c "=swap")
uci add fstab swap
uci set [url=mailto:fstab.@swap[$j]=swap]fstab.@swap[$j]=swap[/url]
uci set [url=mailto:fstab.@swap[$j].uuid=]fstab.@swap[$j].uuid="${get_uuid[/url]}"
uci set [url=mailto:fstab.@swap[$j].device=]fstab.@swap[$j].device="/dev/$device[/url]"
uci set [url=mailto:fstab.@swap[$j].enabled=1]fstab.@swap[$j].enabled=1[/url]
elif [ "$my_fstype" == "ext4" -o "$my_fstype" == "ext3" ] ; then
n=$(uci show fstab |grep "fstab.@mount"|grep -c "=mount")
m=$((n+1))
uci add fstab mount
uci set [url=mailto:fstab.@mount[$n]=mount]fstab.@mount[$n]=mount[/url]
uci set [url=mailto:fstab.@mount[$n].uuid=]fstab.@mount[$n].uuid="${get_uuid[/url]}"
uci set [url=mailto:fstab.@mount[$n].target=]fstab.@mount[$n].target="/mnt/sda${m[/url]}"
uci set [url=mailto:fstab.@mount[$n].enabled=1]fstab.@mount[$n].enabled=1[/url]
uci set [url=mailto:fstab.@mount[$n].options=]fstab.@mount[$n].options="rw,noatime,barrier=0,data=writeback[/url]"
uci set [url=mailto:fstab.@mount[$n].fstype=$my_fstype]fstab.@mount[$n].fstype=$my_fstype[/url]
uci set [url=mailto:fstab.@mount[$n].device=]fstab.@mount[$n].device="/dev/$device[/url]"
else
n=$(uci show fstab |grep "fstab.@mount"|grep -c "=mount")
m=$((n+1))
uci add fstab mount
uci set [url=mailto:fstab.@mount[$n]=mount]fstab.@mount[$n]=mount[/url]
uci set [url=mailto:fstab.@mount[$n].uuid=]fstab.@mount[$n].uuid="${get_uuid[/url]}"
uci set [url=mailto:fstab.@mount[$n].target=]fstab.@mount[$n].target="/mnt/sda${m[/url]}"
uci set [url=mailto:fstab.@mount[$n].enabled=1]fstab.@mount[$n].enabled=1[/url]
uci set [url=mailto:fstab.@mount[$n].fstype=$my_fstype]fstab.@mount[$n].fstype=$my_fstype[/url]
uci set [url=mailto:fstab.@mount[$n].device=]fstab.@mount[$n].device="/dev/$device[/url]"
fi
uci commit fstab
}
blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
device=`basename $DEVPATH`
case "$ACTION" in
add)
get_uuid=$(blkid |grep /dev/${device} |awk -F "UUID=" '{print $2}'|awk -F "\"" '{print $2}')
[ -n "$get_uuid" ]&&{
have_uuid="0"
[ "$have_uuid" == "0" ]
have_uuid=$(uci show fstab |grep -c $get_uuid)
[ "$have_uuid" == "0" ]&&set_fstab
[ "$have_uuid" != "0" ]&&set_devices
}
local from_fstab
local anon_mount
local anon_fsck
local mds_mount_target
local mds_mount_device
local mds_mount_fstype
local use_device
local do_fsck=0
local fsck_type
local automount_from_fstab
mount_dev_section_cb() {
mds_mount_target="$2"
mds_mount_device="$3"
mds_mount_fstype="$4"
mds_mount_enabled="$6"
}
config_get_automount
automount_from_fstab="$from_fstab"
[ "$automount_from_fstab" -eq 1 ] && {
config_get_mount_section_by_device "/dev/$device"
use_device="$mds_mount_device"
[ "$mds_mount_enabled" -eq 1 ] && {
if [ -n "$mds_mount_target" ]; then
grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts ||{
mkdir -p "$mds_mount_target"
if [ "$mds_mount_fstype" = "ntfs" ];then
ntfs-3g -o noatime,nls=utf8 /dev/$device $mds_mount_target 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
elif [ "$mds_mount_fstype" = "fuseblk" ];then
mount.exfat -o noatime /dev/$device $mds_mount_target 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
elif [ "$mds_mount_fstype" = "vfat" ];then
mount -t vfat -o codepage=936,iocharset=cp936 /dev/$device $mds_mount_target 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
elif [ "$mds_mount_fstype" == "ext4" -o "$mds_mount_fstype" == "ext3" ];then
mount -o rw,noatime,barrier=0,data=writeback /dev/$device $mds_mount_target 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
fi
}
else
logger -t 'fstab' "Mount enabled for $mds_mount_device but it doesn't have a defined mountpoint (target)"
fi
}
pgrep aria2c >/dev/null 2>&1 || /etc/init.d/aria2 start
}
grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {
[ "$anon_mount" -eq 1 -a -z "$use_device" ] && {
case "$device" in
mtdblock*) ;;
*)
( mkdir -p /mnt/$device && mount /dev/$device /mnt/$device ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
;;
esac
}
}
reset_dev_section_cb
;;
remove)
umount /dev/$device
;;
esac
fi
附上已安装软件包名称
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|