X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Ffstab%2Fmount.lua;fp=modules%2Fadmin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Ffstab%2Fmount.lua;h=0000000000000000000000000000000000000000;hb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;hp=bac886888a02bb9698ebbefbe6890c104c5889b2;hpb=9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4;p=project%2Fluci.git diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua b/modules/admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua deleted file mode 100644 index bac886888..000000000 --- a/modules/admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua +++ /dev/null @@ -1,108 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2010 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ -]]-- - -local fs = require "nixio.fs" -local util = require "nixio.util" - -local has_extroot = fs.access("/sbin/block") -local has_fscheck = fs.access("/usr/sbin/e2fsck") - -local devices = {} -util.consume((fs.glob("/dev/sd*")), devices) -util.consume((fs.glob("/dev/hd*")), devices) -util.consume((fs.glob("/dev/scd*")), devices) -util.consume((fs.glob("/dev/mmc*")), devices) - -local size = {} -for i, dev in ipairs(devices) do - local s = tonumber((fs.readfile("/sys/class/block/%s/size" % dev:sub(6)))) - size[dev] = s and math.floor(s / 2048) -end - - -m = Map("fstab", translate("Mount Points - Mount Entry")) -m.redirect = luci.dispatcher.build_url("admin/system/fstab") - -if not arg[1] or m.uci:get("fstab", arg[1]) ~= "mount" then - luci.http.redirect(m.redirect) - return -end - - - -mount = m:section(NamedSection, arg[1], "mount", translate("Mount Entry")) -mount.anonymous = true -mount.addremove = false - -mount:tab("general", translate("General Settings")) -mount:tab("advanced", translate("Advanced Settings")) - - -mount:taboption("general", Flag, "enabled", translate("Enable this mount")).rmempty = false - - -o = mount:taboption("general", Value, "device", translate("Device"), - translate("The device file of the memory or partition (e.g. /dev/sda1)")) - -for i, d in ipairs(devices) do - o:value(d, size[d] and "%s (%s MB)" % {d, size[d]}) -end - -o = mount:taboption("advanced", Value, "uuid", translate("UUID"), - translate("If specified, mount the device by its UUID instead of a fixed device node")) - -o = mount:taboption("advanced", Value, "label", translate("Label"), - translate("If specified, mount the device by the partition label instead of a fixed device node")) - - -o = mount:taboption("general", Value, "target", translate("Mount point"), - translate("Specifies the directory the device is attached to")) - -o:depends("is_rootfs", "") - - -o = mount:taboption("general", Value, "fstype", translate("Filesystem"), - translate("The filesystem that was used to format the memory (e.g. ext3)")) - -local fs -for fs in io.lines("/proc/filesystems") do - fs = fs:match("%S+") - if fs ~= "nodev" then - o:value(fs) - end -end - - -o = mount:taboption("advanced", Value, "options", translate("Mount options"), - translate("See \"mount\" manpage for details")) - -o.placeholder = "defaults" - - -if has_extroot then - o = mount:taboption("general", Flag, "is_rootfs", translate("Use as root filesystem"), - translate("Configures this mount as overlay storage for block-extroot")) - - o:depends("fstype", "jffs") - o:depends("fstype", "ext2") - o:depends("fstype", "ext3") - o:depends("fstype", "ext4") -end - -if has_fscheck then - o = mount:taboption("general", Flag, "enabled_fsck", translate("Run filesystem check"), - translate("Run a filesystem check before mounting the device")) -end - -return m