Skip to content

Commit

Permalink
diskman: fix filesystem string
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaac committed Apr 10, 2020
1 parent 32b331e commit ab4b4ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion luasrc/model/cbi/diskman/partition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ if not disk_info.p_table:match("Raid") then
if disk_info.partitions[section].mount_point == "-" and disk_info.partitions[section].number ~= -1 and disk_info.partitions[section].type ~= "extended" then
self.template = "diskman/cbi/format_button"
self.inputstyle = "reset"
self.inputtitle = disk_info.partitions[section].fs:match("^%s+$") and translate("Format") or disk_info.partitions[section].fs
self.inputtitle = disk_info.partitions[section].fs == "raw" and translate("Format") or disk_info.partitions[section].fs
Button.render(self, section, scope)
-- self:reset_values()
-- self.keylist = {}
Expand Down
4 changes: 2 additions & 2 deletions luasrc/model/diskman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ local get_parted_info = function(device)
partition_temp["name"] = device.."p"..partition_temp["number"]
end
if partition_temp["number"] > 0 and partition_temp["fs"] == "" and d.command.lsblk then
partition_temp["fs"] = luci.util.exec(d.command.lsblk .. " /dev/"..device.. tostring(partition_temp["number"]) .. " -no fstype")
partition_temp["fs"] = luci.util.exec(d.command.lsblk .. " /dev/"..device.. tostring(partition_temp["number"]) .. " -no fstype"):match("([^%s]+)") or ""
end
partition_temp["fs"] = partition_temp["fs"] == "" and "raw" or partition_temp["fs"]
partition_temp["sec_start"] = partition_temp["sec_start"] and partition_temp["sec_start"]:sub(1,-2)
Expand Down Expand Up @@ -459,7 +459,7 @@ d.get_format_cmd = function()
exfat = { cmd = "mkexfat", option = "-f" },
hfsplus = { cmd = "mkhfs", option = "-f" },
ntfs = { cmd = "mkntfs", option = "-f" },
swap = { cmd = "mkswap", option = "-f" },
swap = { cmd = "mkswap", option = "" },
btrfs = { cmd = "mkfs.btrfs", option = "-f" }
}
result = {}
Expand Down

0 comments on commit ab4b4ce

Please sign in to comment.