Class: Yast::FileSystemsClass
- Inherits:
-
Module
- Object
- Module
- Yast::FileSystemsClass
- Defined in:
- ../../src/modules/FileSystems.rb
Instance Method Summary (collapse)
- - (Object) AddQuotaOpts(part, fst_opts)
- - (Object) assertInit
- - (Object) CanDoQuota(part)
- - (Object) CanMountRo(part)
- - (Object) ChangeLabelMounted(fsys)
- - (Object) CheckFstabOptions(option_list)
- - (Object) crypt_m_points
- - (Object) DefaultFormatOptions(part)
- - (Object) DefaultFstabOptions(part)
- - (Object) FileSystems
- - (Object) FindFsid(fs_item)
- - (Object) fromSymbol(conv, val)
- - (Object) FsToSymbol(type)
- - (Object) GetAclFstabOptions
-
- (Hash) GetAllFileSystems(add_swap, add_pseudo, label)
Filesystem Definitions.
- - (Object) GetArbitraryOptionField
- - (Object) GetCrypt(used_fs)
- - (Object) GetFsid(used_fs)
- - (Object) GetFsidItem(used_fs)
- - (Object) GetFsMap(used_fs)
- - (Object) GetFstabDefaultList(key)
- - (Object) GetFstabDefaultMap(key)
- - (Object) GetFstabOptWidgets(fsys)
- - (Object) GetFstype(used_fs)
- - (Object) GetGeneralFstabOptions
- - (Object) GetJournalFstabOptions
- - (Object) GetMountOption(used_fs)
-
- (String) GetMountString(used_fs, defaultv)
Return the mount option for each used_fs (-t).
- - (Object) GetName(used_fs, defaultv)
- - (Object) GetNeededModules(used_fs)
- - (Object) GetNormalFilesystems
- - (Object) GetOptions(used_fs)
- - (Object) GetPossibleMountPoints(used_fs)
- - (Object) GetSupportFormat(used_fs)
- - (Object) GetTmpfsFilesystem
- - (Object) HasFstabOption(part, opt, prefix)
- - (Object) HasQuota(part)
- - (Object) InitSlib(value)
- - (Object) IsCryptMp(mount, prefix)
- - (Object) IsResizable(fsys)
- - (Object) IsSupported(used_fs)
- - (Object) IsSystemMp(mount, prefix)
- - (Object) IsUnsupported(used_fs)
- - (Object) LabelLength(fsys)
- - (Object) LangTypicalEncoding
- - (Object) main
- - (Object) MinFsSizeK(fsys)
- - (Object) MountLabel(fsys)
- - (Object) MountUuid(fsys)
- - (Object) RemoveCryptOpts(opt)
- - (Object) RemoveQuotaOpts(fst_opts)
- - (Object) SuggesTmpfsMPoints
- - (Object) SuggestMPoints
- - (Object) system_m_points
Instance Method Details
- (Object) AddQuotaOpts(part, fst_opts)
1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 |
# File '../../src/modules/FileSystems.rb', line 1988 def AddQuotaOpts(part, fst_opts) part = deep_copy(part) journal = [:ext3, :ext4, :btrfs, :reiser] ret = RemoveQuotaOpts(fst_opts) if Builtins.contains(journal, Ops.get_symbol(part, "used_fs", :unknown)) ret = Ops.add( ret, ",usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0" ) else ret = Ops.add(ret, ",usrquota,grpquota") end ret end |
- (Object) assertInit
1423 1424 1425 1426 1427 1428 1429 1430 |
# File '../../src/modules/FileSystems.rb', line 1423 def assertInit if @sint == nil @sint = StorageInit.CreateInterface(false) Builtins.y2error("StorageInit::CreateInterface failed") if @sint == nil end nil end |
- (Object) CanDoQuota(part)
1961 1962 1963 1964 1965 |
# File '../../src/modules/FileSystems.rb', line 1961 def CanDoQuota(part) part = deep_copy(part) quota_fs = [:ext2, :ext3, :ext4, :reiser, :xfs] Builtins.contains(quota_fs, Ops.get_symbol(part, "used_fs", :unknown)) end |
- (Object) CanMountRo(part)
1955 1956 1957 1958 1959 |
# File '../../src/modules/FileSystems.rb', line 1955 def CanMountRo(part) part = deep_copy(part) only_rw_fs = [:tmpfs, :swap] !Builtins.contains(only_rw_fs, Ops.get_symbol(part, "used_fs", :unknown)) end |
- (Object) ChangeLabelMounted(fsys)
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 |
# File '../../src/modules/FileSystems.rb', line 1560 def ChangeLabelMounted(fsys) ret = false assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = caps.labelWhileMounted end Builtins.y2milestone("ChangeLabelMounted fsys:%1 ret:%2", fsys, ret) ret end |
- (Object) CheckFstabOptions(option_list)
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 |
# File '../../src/modules/FileSystems.rb', line 1901 def CheckFstabOptions(option_list) found = false index = 0 Builtins.y2milestone("CheckFstabOptions option_list=%1", option_list) olist = Builtins.splitstring(option_list, ",") known = [] unknown = [] Builtins.foreach(olist) do |o| if Builtins.contains(@FstabOptionStrings, o) known = Builtins.add(known, o) else found = false index = 0 while !found && Ops.less_than(index, Builtins.size(@FstabOptionRegex)) found = Builtins.regexpmatch( o, Ops.get(@FstabOptionRegex, index, "") ) index = Ops.add(index, 1) end if found known = Builtins.add(known, o) else unknown = Builtins.add(unknown, o) end end end ret = { "all_known" => Builtins.size(unknown) == 0, "known_options" => Builtins.mergestring(known, ","), "unknown_options" => Builtins.mergestring(unknown, ",") } Builtins.y2milestone("CheckFstabOptions ret=%1", ret) deep_copy(ret) end |
- (Object) crypt_m_points
418 419 420 |
# File '../../src/modules/FileSystems.rb', line 418 def crypt_m_points ["/", Partitions.BootMount, "/usr"] end |
- (Object) DefaultFormatOptions(part)
1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 |
# File '../../src/modules/FileSystems.rb', line 1805 def DefaultFormatOptions(part) part = deep_copy(part) ret = {} fsys = Ops.get_symbol(part, "used_fs", :none) if Ops.get_boolean(part, "format", false) if Builtins.contains([:ext3, :ext4], fsys) Ops.set( ret, "opt_dir_index", { "option_str" => "-O dir_index", "option_value" => true } ) Ops.set( ret, "opt_reg_checks", { "option_str" => "-c 0 -i 0", "option_value" => true, "option_cmd" => :tunefs } ) end if Arch.board_pegasos && Builtins.contains([:ext2, :ext3, :ext4], fsys) Ops.set( ret, "opt_bytes_per_inode", { "option_str" => "-I", "option_value" => "128" } ) end if Arch.s390 && Builtins.contains([:ext2, :ext3, :ext4], fsys) Ops.set( ret, "opt_blocksize", { "option_str" => "-b", "option_value" => "4096" } ) end if Builtins.contains([:ext2, :ext3, :ext4], fsys) if Arch.s390 Ops.set( ret, "opt_blocksize", { "option_str" => "-b", "option_value" => "4096" } ) end f = Ops.multiply( Ops.divide( 1048580.0, Convert.convert( Ops.get_integer(part, "size_k", 0), :from => "integer", :to => "float" ) ), Convert.convert(100, :from => "integer", :to => "float") ) if Ops.greater_than( f, Convert.convert(5, :from => "integer", :to => "float") ) f = Convert.convert(5, :from => "integer", :to => "float") end f = 0.1 if Ops.less_than(f, 0.1) Ops.set( ret, "opt_reserved_blocks", { "option_str" => "-m", "option_value" => Builtins.tostring(f, 1) } ) end end Builtins.y2milestone( "DefaultFormatOptions fsys %1 fmt %2 is %3", fsys, Ops.get_boolean(part, "format", false), ret ) deep_copy(ret) end |
- (Object) DefaultFstabOptions(part)
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 |
# File '../../src/modules/FileSystems.rb', line 1702 def DefaultFstabOptions(part) part = deep_copy(part) fsys = Ops.get_symbol(part, "used_fs", :none) fst_default = "" if Ops.get_boolean(part, "format", false) && Builtins.contains([:ext2, :ext3, :ext4, :reiser], fsys) fst_default = "acl,user_xattr" elsif Ops.get_boolean(part, "format", false) && fsys == :btrfs && @default_subvol != "" fst_default = Ops.add("subvol=", @default_subvol) elsif !Arch.ia64 && Builtins.contains([:vfat, :ntfs], fsys) fst_default = "" is_boot = Builtins.substring(Ops.get_string(part, "mount", ""), 0, 5) == "/boot" fst_default = "users,gid=users" if !is_boot enc = LangTypicalEncoding() code = Encoding.GetCodePage(enc) if Ops.greater_than(Builtins.size(enc), 0) if fsys != :ntfs fst_default = Ops.add(fst_default, ",umask=0002") if enc == "utf8" fst_default = Ops.add(fst_default, ",utf8=true") else fst_default = Ops.add(Ops.add(fst_default, ",iocharset="), enc) end else fst_default = Ops.add(fst_default, ",fmask=133,dmask=022") m = Convert.to_map( SCR.Execute(path(".target.bash_output"), "locale | grep LC_CTYPE") ) sl = Builtins.splitstring(Ops.get_string(m, "stdout", ""), "\n") sl = Builtins.splitstring(Ops.get(sl, 0, ""), "=") Builtins.y2milestone("DefaultFstabOptions sl %1", sl) if Ops.greater_than(Builtins.size(Ops.get(sl, 1, "")), 0) fst_default = Ops.add( Ops.add(fst_default, ",locale="), Builtins.deletechars(Ops.get(sl, 1, ""), "\"") ) end end end if Ops.greater_than(Builtins.size(code), 0) && code != "437" && fsys != :ntfs && !is_boot fst_default = Ops.add(Ops.add(fst_default, ",codepage="), code) end end dev = Ops.get_string(part, "device", "") if Ops.get_string(part, "mount", "") != "/" need_nofail = false assertInit devs = Convert.convert( Ops.get(part, "using_devices") { [dev] }, :from => "any", :to => "list <string>" ) Builtins.y2milestone("DefaultFstabOptions devs:%1", devs) usedby_devices = ::Storage::ListString.new() dv = ::Storage::ListString.new() devs.each { |x| dv.push(x) } if @sint.getRecursiveUsedBy( dv, true, usedby_devices)==0 # USB since those might actually not be present during boot # iSCSI since the boot scripts need it hotplug_transports = [::Storage::USB, ::Storage::ISCSI] usedby_devices.each do |usedby_device| dp = ::Storage::ContVolInfo.new() if @sint.getContVolInfo(usedby_device, dp)==0 && dp.ctype == ::Storage::DISK disk = dp.cdevice infos = ::Storage::DiskInfo.new() if @sint.getDiskInfo(disk, infos)==0 && Builtins.contains(hotplug_transports, infos.transport) need_nofail = true end end end if need_nofail if !Builtins.isempty(fst_default) fst_default = Ops.add(fst_default, ",") end fst_default = Ops.add(fst_default, "nofail") end end end if Builtins.substring(fst_default, 0, 1) == "," fst_default = Builtins.substring(fst_default, 1) end Builtins.y2milestone( "DefaultFstabOptions dev %3 fsys %1 is %2", fsys, fst_default, dev ) fst_default end |
- (Object) FileSystems
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 |
# File '../../src/modules/FileSystems.rb', line 1382 def FileSystems Ops.set(@support, :vfat, false) if Arch.sparc64 || Arch.sparc32 if Arch.ppc Ops.set(@support, :vfat, Arch.board_chrp) Ops.set(@support, :xbootdisk, true) Ops.set(@support, :xbootfat, Arch.board_chrp) end Ops.set(@support, :vfat, false) if Arch.s390 if Arch.ia64 Ops.set(@support, :jfs, false) Ops.set(@support, :xxefi, true) end Ops.set(@support, :reiser, false) if Arch.alpha if Arch.board_mac Ops.set(@support, :hfs, true) Ops.set(@support, :hfsplus, true) end Builtins.y2milestone("support %1", @support) nil end |
- (Object) FindFsid(fs_item)
1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 |
# File '../../src/modules/FileSystems.rb', line 1362 def FindFsid(fs_item) ret = nil fs = Convert.convert( Builtins.union(GetNormalFilesystems(), @SwapFileSystems), :from => "map", :to => "map <symbol, map>" ) fs = Convert.convert( Builtins.union(fs, @PseudoFileSystems), :from => "map", :to => "map <symbol, map>" ) l = Builtins.maplist(Builtins.filter(fs) do |s, m| Ops.get_string(m, :fsid_item, "") == fs_item end) { |ss, mm| Ops.get(mm, :fsid) } ret = Ops.get_integer(l, 0, 0) if !Builtins.isempty(l) Builtins.y2milestone("FindFsid item:%1 ret:%2", fs_item, ret) ret end |
- (Object) fromSymbol(conv, val)
407 408 409 410 411 412 |
# File '../../src/modules/FileSystems.rb', line 407 def fromSymbol(conv, val) conv = deep_copy(conv) ret = Ops.get_integer(conv, "def_int", -1) Builtins.foreach(Ops.get_map(conv, "m", {})) { |i, s| ret = i if s == val } ret end |
- (Object) FsToSymbol(type)
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 |
# File '../../src/modules/FileSystems.rb', line 1604 def FsToSymbol(type) ret = :none if type == "ext2" ret = :ext2 elsif type == "ext3" ret = :ext3 elsif type == "ext4" ret = :ext4 elsif type == "btrfs" ret = :btrfs elsif Builtins.regexpmatch(type, "reiser.*") ret = :reiser elsif type == "jfs" ret = :jfs elsif type == "xfs" ret = :xfs elsif type == "vfat" || Builtins.regexpmatch(type, "fat.*") ret = :vfat elsif type == "ntfs" ret = :ntfs elsif type == "hfs" ret = :hfs elsif type == "swap" ret = :swap end ret end |
- (Object) GetAclFstabOptions
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
# File '../../src/modules/FileSystems.rb', line 590 def GetAclFstabOptions = [ { # button text :widget => Left( CheckBox(Id("opt_acl"), _("&Access Control Lists (ACL)"), false) ), :query_key => "opt_acl", # help text, richtext format :help_text => _( "<p><b>Access Control Lists (ACL):</b>\nEnable access control lists on the file system.</p>\n" ), :type => :boolean, :default => true, :str_opt => { 0 => "noacl", "default" => "acl" }, :str_scan => [["acl", 1], ["noacl", 0]] }, { # button text :widget => Left( CheckBox(Id("opt_eua"), _("&Extended User Attributes"), false) ), :query_key => "opt_eua", # help text, richtext format :help_text => _( "<p><b>Extended User Attributes:</b>\nAllow extended user attributes on the file system.</p>\n" ), :type => :boolean, :str_opt => { 1 => "user_xattr", "default" => "" }, :str_scan => [["user_xattr", 1], ["nouser_xattr", 0]] } ] deep_copy() end |
- (Hash) GetAllFileSystems(add_swap, add_pseudo, label)
Filesystem Definitions
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 |
# File '../../src/modules/FileSystems.rb', line 1304 def GetAllFileSystems(add_swap, add_pseudo, label) ret = Builtins.filter(GetNormalFilesystems()) do |fs_key, fs_map| Ops.get(@support, fs_key, false) end if add_swap ret = Convert.convert( Builtins.union(ret, @SwapFileSystems), :from => "map", :to => "map <symbol, map <symbol, any>>" ) end if add_pseudo ret = Convert.convert( Builtins.union(ret, Builtins.filter(@PseudoFileSystems) do |fs_key, fs_map| Ops.get(@support, fs_key, false) || !Builtins.isempty(Ops.get_string(fs_map, :label, "")) && Ops.get_string(fs_map, :label, "") == label end), :from => "map", :to => "map <symbol, map <symbol, any>>" ) end deep_copy(ret) end |
- (Object) GetArbitraryOptionField
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
# File '../../src/modules/FileSystems.rb', line 625 def GetArbitraryOptionField opt = { # label text :widget => TextEntry( Id("opt_arbitrary"), Opt(:hstretch), _("Arbitrary Option &Value"), "" ), :query_key => "opt_arbitrary", :invalid_chars => "\t ", :error_text => _( "Invalid characters in arbitrary option value. Do not use spaces or tabs. Try again." ), # help text, richtext format :help_text => _( "<p><b>Arbitrary Option Value:</b>\n" + "In this field, type any legal mount option allowed in the fourth field of /etc/fstab.\n" + "Multiple options are separated by commas.</p>\n" ), :type => :text } deep_copy(opt) end |
- (Object) GetCrypt(used_fs)
1482 1483 1484 1485 |
# File '../../src/modules/FileSystems.rb', line 1482 def GetCrypt(used_fs) fsmap = GetFsMap(used_fs) Ops.get_boolean(fsmap, :crypt) end |
- (Object) GetFsid(used_fs)
1462 1463 1464 1465 |
# File '../../src/modules/FileSystems.rb', line 1462 def GetFsid(used_fs) fsmap = GetFsMap(used_fs) Ops.get_integer(fsmap, :fsid, Partitions.fsid_native) end |
- (Object) GetFsidItem(used_fs)
1472 1473 1474 1475 |
# File '../../src/modules/FileSystems.rb', line 1472 def GetFsidItem(used_fs) fsmap = GetFsMap(used_fs) Ops.get_string(fsmap, :fsid_item, "") end |
- (Object) GetFsMap(used_fs)
1440 1441 1442 1443 1444 1445 1446 1447 1448 |
# File '../../src/modules/FileSystems.rb', line 1440 def GetFsMap(used_fs) allfs = GetAllFileSystems(true, true, "") if Builtins.haskey(allfs, used_fs) return Ops.get(allfs, used_fs, {}) else fs = GetNormalFilesystems() return Ops.get(fs, used_fs, {}) end end |
- (Object) GetFstabDefaultList(key)
1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 |
# File '../../src/modules/FileSystems.rb', line 1942 def GetFstabDefaultList(key) m = GetFstabDefaultMap(key) [ Ops.get_string(m, "spec", ""), Ops.get_string(m, "mount", ""), Ops.get_string(m, "vfstype", ""), Ops.get_string(m, "mntops", ""), Builtins.tostring(Ops.get_integer(m, "freq", 0)), Builtins.tostring(Ops.get_integer(m, "passno", 0)) ] end |
- (Object) GetFstabDefaultMap(key)
1938 1939 1940 |
# File '../../src/modules/FileSystems.rb', line 1938 def GetFstabDefaultMap(key) Ops.get(@FstabDefaultMap, key, {}) end |
- (Object) GetFstabOptWidgets(fsys)
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 |
# File '../../src/modules/FileSystems.rb', line 1334 def GetFstabOptWidgets(fsys) ret = [] if fsys == :swap ret = deep_copy(@swap_fst_options) elsif fsys == :tmpfs ret = deep_copy(@tmpfs_fst_options) else fs = GetAllFileSystems(true, false, "") ret = Ops.get_list(fs, [fsys, :fst_options], []) if Builtins.contains([:ext3, :ext4, :reiser], fsys) ret = Convert.convert( Builtins.union(ret, GetJournalFstabOptions()), :from => "list", :to => "list <map <symbol, any>>" ) end if Builtins.contains([:ext2, :ext3, :ext4, :reiser], fsys) ret = Convert.convert( Builtins.union(ret, GetAclFstabOptions()), :from => "list", :to => "list <map <symbol, any>>" ) end end Builtins.y2milestone("fsys:%1 ret:%2", fsys, ret) deep_copy(ret) end |
- (Object) GetFstype(used_fs)
1477 1478 1479 1480 |
# File '../../src/modules/FileSystems.rb', line 1477 def GetFstype(used_fs) fsmap = GetFsMap(used_fs) Ops.get_string(fsmap, :fstype, "") end |
- (Object) GetGeneralFstabOptions
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
# File '../../src/modules/FileSystems.rb', line 465 def GetGeneralFstabOptions = [ { # button text :widget => Left( CheckBox(Id("opt_readonly"), _("Mount &Read-Only"), false) ), :query_key => "opt_readonly", # help text, richtext format :help_text => _( "<p><b>Mount Read-Only:</b>\n" + "Writing to the file system is not possible. Default is false. During installation\n" + "the file system is always mounted read-write.</p>" ), :type => :boolean, :str_opt => { 1 => "ro", "default" => "" }, :str_scan => [["ro", 1], ["rw", 0]] }, { # button text :widget => Left( CheckBox(Id("opt_noatime"), _("No &Access Time"), false) ), :query_key => "opt_noatime", # help text, richtext format :help_text => _( "<p><b>No Access Time:</b>\nAccess times are not updated when a file is read. Default is false.</p>\n" ), :type => :boolean, :str_opt => { 1 => "noatime", "default" => "" }, :str_scan => [["noatime", 1], ["atime", 0]] }, { # button text :widget => Left( CheckBox(Id("opt_user"), _("Mountable by &User"), false) ), :query_key => "opt_user", # help text, richtext format :help_text => _( "<p><b>Mountable by User:</b>\nThe file system may be mounted by an ordinary user. Default is false.</p>\n" ), :type => :boolean, :str_opt => { 1 => "user", "default" => "" }, :str_scan => [["nouser", 0], ["user", 1]] }, { # button text :widget => Left( CheckBox( Id("opt_noauto"), Opt(:notify), _("Do Not Mount at System &Start-up"), false ) ), :query_key => "opt_noauto", # help text, richtext format :help_text => _( "<p><b>Do Not Mount at System Start-up:</b>\n" + "The file system is not automatically mounted when the system starts.\n" + "An entry in /etc/fstab is created and the file system is mounted\n" + "with the appropriate options when the command <tt>mount <mount point></tt>\n" + "is entered (<mount point> is the directory to which the file system is mounted). Default is false.</p>\n" ), :type => :boolean, :str_opt => { 1 => "noauto", "default" => "" }, :str_scan => [["noauto", 1], ["auto", 0]] }, { # button text :widget => Left( CheckBox( Id("opt_quota"), Opt(:notify), _("Enable &Quota Support"), false ) ), :query_key => "opt_quota", # help text, richtext format :help_text => _( "<p><b>Enable Quota Support:</b>\n" + "The file system is mounted with user quotas enabled.\n" + "Default is false.</p>\n" ), :type => :boolean } ] deep_copy() end |
- (Object) GetJournalFstabOptions
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
# File '../../src/modules/FileSystems.rb', line 557 def GetJournalFstabOptions = [ { :widget => VBox( ComboBox( Id("opt_journal"), Opt(:hstretch), # label text _("Data &Journaling Mode"), ["journal", "ordered", "writeback"] ), VSpacing(0.5) ), :default => "ordered", :query_key => "opt_journal", :type => :text, # help text, richtext format :help_text => _( "<p><b>Data Journaling Mode:</b>\n" + "Specifies the journaling mode for file data.\n" + "<tt>journal</tt> -- All data is committed to the journal prior to being\n" + "written into the main file system. Highest performance impact.<br>\n" + "<tt>ordered</tt> -- All data is forced directly out to the main file system\n" + "prior to its metadata being committed to the journal. Medium performance impact.<br>\n" + "<tt>writeback</tt> -- Data ordering is not preserved. No performance impact.</p>\n" ), :str_opt => "data=%1", :str_scan => "data=(.*)" } ] deep_copy() end |
- (Object) GetMountOption(used_fs)
1492 1493 1494 1495 |
# File '../../src/modules/FileSystems.rb', line 1492 def GetMountOption(used_fs) fsmap = GetFsMap(used_fs) Ops.get_string(fsmap, :mount_option, "") end |
- (String) GetMountString(used_fs, defaultv)
Return the mount option for each used_fs (-t)
1505 1506 1507 1508 1509 1510 |
# File '../../src/modules/FileSystems.rb', line 1505 def GetMountString(used_fs, defaultv) fsmap = GetFsMap(used_fs) ret = Ops.get_string(fsmap, :mount_string, defaultv) Builtins.y2milestone("GetMountString used_fs:%1 ret:%2", used_fs, ret) ret end |
- (Object) GetName(used_fs, defaultv)
1451 1452 1453 1454 1455 1456 1457 1458 1459 |
# File '../../src/modules/FileSystems.rb', line 1451 def GetName(used_fs, defaultv) fsmap = GetFsMap(used_fs) ret = Ops.get_string(fsmap, :name, "") ret = "NTFS" if ret == "" && used_fs == :ntfs # obsolete? (included in RealFileSystems) ret = "NFS" if ret == "" && used_fs == :nfs ret = "NFS4" if ret == "" && used_fs == :nfs4 ret = defaultv if ret == "" ret end |
- (Object) GetNeededModules(used_fs)
1513 1514 1515 1516 1517 1518 |
# File '../../src/modules/FileSystems.rb', line 1513 def GetNeededModules(used_fs) fsmap = GetFsMap(used_fs) ret = Ops.get_list(fsmap, :needed_modules, []) Builtins.y2milestone("GetNeededModules used_fs:%1 ret:%2", used_fs, ret) deep_copy(ret) end |
- (Object) GetNormalFilesystems
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 |
# File '../../src/modules/FileSystems.rb', line 650 def GetNormalFilesystems = [ { # label text :widget => ComboBox( Id("opt_iocharset"), Opt(:editable, :hstretch), _("Char&set for file names"), [ "", "iso8859-1", "iso8859-15", "iso8859-2", "iso8859-5", "iso8859-7", "iso8859-9", "utf8", "koi8-r", "euc-jp", "sjis", "gb2312", "big5", "euc-kr" ] ), :query_key => "opt_iocharset", :type => :text, # help text, richtext format :help_text => _( "<p><b>Charset for File Names:</b>\nSet the charset used for display of file names in Windows partitions.</p>\n" ), :str_opt => "iocharset=%1", :str_scan => "iocharset=(.*)" }, { # label text :widget => ComboBox( Id("opt_codepage"), Opt(:editable, :hstretch), _("Code&page for short FAT names"), ["", "437", "852", "932", "936", "949", "950"] ), :query_key => "opt_codepage", :type => :text, # help text, richtext format :help_text => _( "<p><b>Codepage for Short FAT Names:</b>\nThis codepage is used for converting to shortname characters on FAT file systems.</p>\n" ), :str_opt => "codepage=%1", :str_scan => "codepage=(.*)" } ] = [ { # label text :widget => ComboBox( Id("opt_number_of_fats"), Opt(:hstretch), _("Number of &FATs"), ["auto", "1", "2"] ), :query_key => "opt_number_of_fats", :option_str => "-f", # help text, richtext format :help_text => _( "<p><b>Number of FATs:</b>\nSpecify the number of file allocation tables in the file system. The default is 2.</p>" ) }, { # label text :widget => ComboBox( Id("opt_fat_size"), Opt(:hstretch), _("FAT &Size"), [ "auto", Item(Id("12"), "12 bit"), Item(Id("16"), "16 bit"), Item(Id("32"), "32 bit") ] ), :query_key => "opt_fat_size", :option_str => "-F", # help text, richtext format :help_text => _( "<p><b>FAT Size:</b>\nSpecifies the type of file allocation tables used (12, 16, or 32-bit). If auto is specified, YaST will automatically select the value most suitable for the file system size.</p>\n" ) }, { # label text :widget => TextEntry( Id("opt_root_dir_entries"), Opt(:hstretch), _("Root &Dir Entries"), "auto" ), :query_key => "opt_root_dir_entries", :option_str => "-r", :between => [112, -1], :valid_chars => "0123456789", # popup text :error_text => _( "The minimum size for \"Root Dir Entries\" is 112. Try again." ), # help text, richtext format :help_text => _( "<p><b>Root Dir Entries:</b>\nSelect the number of entries available in the root directory.</p>\n" ) } ] = [ { # label text :widget => ComboBox( Id("opt_hash"), Opt(:hstretch), _("Hash &Function"), ["auto", "r5", "tea", "rupasov"] ), :query_key => "opt_hash", :option_str => "--hash", :option_blank => true, # help text, richtext format :help_text => _( "<p><b>Hash Function:</b>\nThis specifies the name of the hash function to use to sort the file names in directories.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_format"), Opt(:hstretch), _("FS &Revision"), ["auto", "3.5", "3.6"] ), :query_key => "opt_format", :option_str => "--format", :option_blank => true, # help text, richtext format :help_text => _( "<p><b>FS Revision:</b>\nThis option defines the reiserfs format revision to use. '3.5' is for backwards compatibility with kernels of the 2.2.x series. '3.6' is more recent, but can only be used with kernel versions greater than or equal to 2.4.</p>\n" ) } ] = [ { # label text :widget => ComboBox( Id("opt_blocksize"), Opt(:hstretch), _("Block &Size in Bytes"), #,"8192", "16384","32768" ["auto", "512", "1024", "2048", "4096"] ), :query_key => "opt_blocksize", :option_str => "-bsize=", # help text, richtext format :help_text => _( "<p><b>Block Size:</b>\nSpecify the size of blocks in bytes. Valid block size values are 512, 1024, 2048 and 4096 bytes per block. If auto is selected, the standard block size of 4096 is used.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_bytes_per_inode"), Opt(:hstretch), _("&Inode Size"), ["auto", "256", "512", "1024", "2048"] ), :query_key => "opt_bytes_per_inode", :option_str => "-isize=", # help text, richtext format :help_text => _( "<p><b>Inode Size:</b>\nThis option specifies the inode size of the file system.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_max_inode_space"), Opt(:hstretch), _("&Percentage of Inode Space"), [ "auto", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", Item(Id("0"), "100") ] ), :query_key => "opt_max_inode_space", :option_str => "-imaxpct=", # help text, richtext format :help_text => _( "<p><b>Percentage of Inode Space:</b>\nThe option \"Percentage of Inode Space\" specifies the maximum percentage of space in the file system that can be allocated to inodes.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_inode_align"), Opt(:hstretch), _("Inode &Aligned"), ["auto", Item(Id("1"), "true"), Item(Id("0"), "false")] ), :query_key => "opt_inode_align", :option_str => "-ialign=", # help text, richtext format :help_text => _( "<p><b>Inode Aligned:</b>\n" + "The option \"Inode Aligned\" is used to specify whether inode allocation is or\n" + "is not aligned. By default inodes are aligned, which\n" + "is usually more efficient than unaligned access.</p>\n" ) } ] = [ # $[ # // label text # `widget : `ComboBox(`id("opt_iocharset"), `opt(`editable,`hstretch), _("Char&set for file names"), # ["", "iso8859-1", "iso8859-15", "iso8859-2", # "iso8859-5", "iso8859-7", "iso8859-9", "utf8", # "koi8-r", "euc-jp", "sjis", "gb2312", "big5", "euc-kr" ]), # `query_key : "opt_iocharset", # `type : `text, # // help text, richtext format # `help_text : _("<p><b>Charset for File Names:</b> # Set the charset used to display file names on the partition.</p>\n"), # `str_opt : "iocharset=%1", # `str_scan : "iocharset=\(.*\)" # ], { # label text :widget => TextEntry( Id("opt_log_size"), Opt(:hstretch), _("&Log Size in Megabytes"), "auto" ), :query_key => "opt_log_size", :option_str => "-s", # no way to find out the max log size ???? :between => [0, -1], # -> -1 = infinite :valid_chars => "0123456789", # popup text :error_text => _( "The \"Log Size\" value is incorrect.\nEnter a value greater than zero.\n" ), # xgettext: no-c-format # help text, richtext format :help_text => _( "<p><b>Log Size</b>\nSet the log size (in megabytes). If auto, the default is 40% of the aggregate size.</p>\n" ) }, { # label text :widget => CheckBox( Id("opt_blocks_utility"), _("Invoke Bad Blocks List &Utility"), false ), :query_key => "opt_blocks_utility", :option_str => "-c" } ] = [ { # label text :widget => TextEntry( Id("opt_raid"), Opt(:hstretch), _("Stride &Length in Blocks"), "none" ), :query_key => "opt_raid", :option_str => "-Rstride=", :valid_chars => "0123456789", :between => [1, -1], # popup text :error_text => _( "The \"Stride Length in Blocks\" value is invalid.\nSelect a value greater than 1.\n" ), # help text, richtext format :help_text => _( "<p><b>Stride Length in Blocks:</b>\n" + "Set RAID-related options for the file system. Currently, the only supported\n" + "argument is 'stride', which takes the number of blocks in a\n" + "RAID stripe as its argument.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_blocksize"), Opt(:hstretch), _("Block &Size in Bytes"), #,"8192", "16384","32768" ["auto", "1024", "2048", "4096"] ), :query_key => "opt_blocksize", :option_str => "-b", # help text, richtext format :help_text => _( "<p><b>Block Size:</b>\nSpecify the size of blocks in bytes. Valid block size values are 1024, 2048, and 4096 bytes per block. If auto is selected, the block size is determined by the file system size and the expected use of the file system.</p>\n" ) }, { # label text :widget => ComboBox( Id("opt_inode_density"), Opt(:hstretch), _("Bytes per &Inode"), ["auto", "1024", "2048", "4096", "8192", "16384", "32768"] ), :query_key => "opt_inode_density", :option_str => "-i", # help text, richtext format :help_text => _( "<p><b>Bytes per Inode:</b> \n" + "Specify the bytes to inode ratio. YaST creates an inode for every\n" + "<bytes-per-inode> bytes of space on the disk. The larger the\n" + "bytes-per-inode ratio, the fewer inodes will be created. Generally, this\n" + "value should not be smaller than the block size of the file system, or else\n" + "too many inodes will be created. It is not possible to expand the number of\n" + "inodes on a file system after its creation. So be sure to enter a reasonable\n" + "value for this parameter.</p>\n" ) }, { # label text :widget => TextEntry( Id("opt_reserved_blocks"), Opt(:hstretch), _("Percentage of Blocks &Reserved for root"), "auto" ), :query_key => "opt_reserved_blocks", :option_str => "-m", #`default : 5, :below => 99, :str_length => 6, :valid_chars => "0123456789.", # popup text :error_text => _( "The \"Percentage of Blocks Reserved for root\" value is incorrect.\nAllowed are float numbers no larger than 99 (e.g. 0.5).\n" ), # xgettext: no-c-format # help text, richtext format :help_text => _( "<p><b>Percentage of Blocks Reserved for root:</b> Specify the percentage of blocks reserved for the super user. The default is computed so that normally 1 Gig is reserved. Upper limit for reserved default is 5.0, lowest reserved default is 0.1.</p>" ) }, { # checkbox text :widget => CheckBox( Id("opt_reg_checks"), Opt(:hstretch), _("Disable Regular Checks") ), :query_key => "opt_reg_checks", :option_str => "-c 0 -i 0", :option_cmd => :tunefs, :type => :boolean, :default => false, # help text, richtext format :help_text => _( "<p><b>Disable Regular Checks:</b>\nDisable regular file system check at booting.</p>\n" ) } ] = [ { # label text :widget => ComboBox( Id("opt_bytes_per_inode"), Opt(:hstretch), _("&Inode Size"), ["default", "128", "256", "512", "1024"] ), :query_key => "opt_bytes_per_inode", :option_str => "-I", # help text, richtext format :help_text => _( "<p><b>Inode Size:</b>\nThis option specifies the inode size of the file system.</p>\n" ) }, { # label text :widget => CheckBox( Id("opt_dir_index"), Opt(:hstretch), _("&Directory Index Feature") ), :query_key => "opt_dir_index", :option_str => "-O dir_index", :option_false => "-O ^dir_index", :type => :boolean, # help text, richtext format :help_text => _( "<p><b>Directory Index:</b>\nEnables use of hashed b-trees to speed up lookups in large directories.</p>\n" ) } ] = [ { # label text :widget => CheckBox( Id("no_journal"), Opt(:hstretch), _("&No Journal") ), :query_key => "no_journal", :option_str => "-O ^has_journal", :type => :boolean, :default => false, # help text, richtext format :help_text => _( "<p><b>No Journal:</b>\n" + "Suppressed use of journaling on filesystem. Only activate this when you really\n" + "know what you are doing.</p>\n" ) } ] = Convert.convert( Builtins.merge(, ), :from => "list", :to => "list <map <symbol, any>>" ) = Convert.convert( Builtins.merge(, ), :from => "list", :to => "list <map <symbol, any>>" ) = Convert.convert( Builtins.merge(, ), :from => "list", :to => "list <map <symbol, any>>" ) = [] = [] = [] = [] _RealFileSystems = { :ext2 => { :name => "Ext2", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_option => "-t ext2", :mount_string => "ext2", :fst_options => , :options => }, :vfat => { :name => "FAT", :fsid => 12, :real_fs => true, :alt_fsid => [12, 259], :supports_format => true, :fsid_item => "0x0C Win95 FAT32 ", :fstype => "Fat32", :crypt => true, :mountpoints => SuggestMPoints(), :mount_option => "-t vfat", :mount_string => "vfat", :needed_modules => ["fat", "vfat"], :fst_options => , :options => }, :reiser => { :name => "Reiser", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_option => "-t reiserfs", :mount_string => "reiserfs", :needed_modules => ["reiserfs"], :fst_options => , :options => }, :xfs => { :name => "XFS", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_option => "-t xfs", :mount_string => "xfs", :needed_modules => ["xfs"], :options => }, :jfs => { :name => "JFS", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_string => "jfs", :mount_option => "-t jfs", :needed_modules => ["jfs"], :options => }, :ext3 => { :name => "Ext3", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_string => "ext3", :mount_option => "-t ext3", :needed_modules => ["jbd", "mbcache", "ext3"], :fst_options => , :options => }, :ext4 => { :name => "Ext4", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_string => "ext4", :mount_option => "-t ext4", :needed_modules => ["jbd2", "mbcache", "ext4"], :fst_options => , :options => }, :btrfs => { :name => "BtrFS", :fsid => Partitions.fsid_native, :real_fs => true, :supports_format => true, :fsid_item => "0x83 Linux ", :fstype => "Linux native", :crypt => true, :mountpoints => SuggestMPoints(), :mount_string => "btrfs", :mount_option => "-t btrfs", :needed_modules => ["btrfs"], :fst_options => [], :options => [] }, :hfs => { :name => "MacHFS", :fsid => Partitions.fsid_mac_hfs, :real_fs => true, :supports_format => true, :alt_fsid => [131], :fsid_item => "0x102 Apple_HFS ", :fstype => "Apple_HFS ", :crypt => false, :mountpoints => [], :mount_string => "hfs", :mount_option => "-t hfs", :needed_modules => ["hfs"], :fst_options => [], :options => [] }, :hfsplus => { :name => "MacHFS+", :fsid => Partitions.fsid_mac_hfs, :real_fs => true, :supports_format => false, :alt_fsid => [131], :fsid_item => "0x102 Apple_HFS ", :fstype => "Apple_HFS ", :crypt => false, :mountpoints => [], :mount_string => "hfsplus", :mount_option => "-t hfsplus", :needed_modules => ["hfsplus"], :fst_options => [], :options => [] }, :ntfs => { :name => "NTFS", :fsid => 7, :real_fs => true, :supports_format => false, :alt_fsid => Partitions.fsid_ntfstypes, :fsid_item => "0x07 NTFS ", :fstype => "NTFS ", :crypt => false, :mountpoints => [], :mount_string => "ntfs-3g", :mount_option => "-t ntfs", :needed_modules => ["ntfs"], :fst_options => [], :options => [] }, :tmpfs => { :name => "TmpFS", :mountpoints => SuggesTmpfsMPoints(), :mount_string => "tmpfs", :mount_option => "-t tmpfs", :fst_options => @tmpfs_fst_options } } deep_copy(_RealFileSystems) end |
- (Object) GetOptions(used_fs)
1497 1498 1499 1500 |
# File '../../src/modules/FileSystems.rb', line 1497 def GetOptions(used_fs) fsmap = GetFsMap(used_fs) Ops.get_list(fsmap, :options, []) end |
- (Object) GetPossibleMountPoints(used_fs)
1487 1488 1489 1490 |
# File '../../src/modules/FileSystems.rb', line 1487 def GetPossibleMountPoints(used_fs) fsmap = GetFsMap(used_fs) Ops.get_list(fsmap, :mountpoints, []) end |
- (Object) GetSupportFormat(used_fs)
1467 1468 1469 1470 |
# File '../../src/modules/FileSystems.rb', line 1467 def GetSupportFormat(used_fs) fsmap = GetFsMap(used_fs) Ops.get_boolean(fsmap, :supports_format) end |
- (Object) GetTmpfsFilesystem
1330 1331 1332 |
# File '../../src/modules/FileSystems.rb', line 1330 def GetTmpfsFilesystem Ops.get(GetNormalFilesystems(), :tmpfs, {}) end |
- (Object) HasFstabOption(part, opt, prefix)
1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 |
# File '../../src/modules/FileSystems.rb', line 1882 def HasFstabOption(part, opt, prefix) part = deep_copy(part) l = Builtins.splitstring(Ops.get_string(part, "fstopt", ""), ",") if prefix l = Builtins.filter(l) { |s| Builtins.search(s, opt) == 0 } else l = Builtins.filter(l) { |s| s == opt } end Builtins.y2milestone( "HasFstabOption fst:%1 opt:%2 prefix:%3 l:%4 ret:%5", Ops.get_string(part, "fstopt", ""), opt, prefix, l, Ops.greater_than(Builtins.size(l), 0) ) Ops.greater_than(Builtins.size(l), 0) end |
- (Object) HasQuota(part)
1967 1968 1969 1970 1971 1972 1973 1974 1975 |
# File '../../src/modules/FileSystems.rb', line 1967 def HasQuota(part) part = deep_copy(part) opts = Builtins.splitstring(Ops.get_string(part, "fstopt", ""), ",") Builtins.find(opts) do |opt| opt == "usrquota" || opt == "grpquota" || Builtins.search(opt, "usrjquota=") == 0 || Builtins.search(opt, "grpjquota=") == 0 end != nil end |
- (Object) InitSlib(value)
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 |
# File '../../src/modules/FileSystems.rb', line 1405 def InitSlib(value) @sint = value if @sint != nil ret = @sint.getDefaultSubvolName Builtins.y2milestone("InitSlib libstorage default_subvol:\"%1\"", ret) ret = "" @sint.setDefaultSubvolName(ret) ret = @sint.getDefaultSubvolName @default_subvol = ret Builtins.y2milestone( "InitSlib used default_subvol:\"%1\"", @default_subvol ) end nil end |
- (Object) IsCryptMp(mount, prefix)
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 |
# File '../../src/modules/FileSystems.rb', line 1635 def IsCryptMp(mount, prefix) ret = Builtins.contains(crypt_m_points, mount) if !ret && prefix mp = Builtins.filter(system_m_points) { |s| s != "/" } Builtins.foreach(mp) do |s| ret = ret || Builtins.search(mount, Ops.add(s, "/")) == 0 end end Builtins.y2milestone( "IsCryptMp mount:%1 prefix:%2 ret:%3", mount, prefix, ret ) ret end |
- (Object) IsResizable(fsys)
1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 |
# File '../../src/modules/FileSystems.rb', line 1586 def IsResizable(fsys) ret = {} assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = { "extend" => caps.isExtendable, "shrink" => caps.isReduceable, "mount_extend" => caps.isExtendableWhileMounted, "mount_shrink" => caps.isReduceableWhileMounted } end Builtins.y2milestone("IsResizable fsys:%1 ret:%2", fsys, ret) deep_copy(ret) end |
- (Object) IsSupported(used_fs)
1432 1433 1434 |
# File '../../src/modules/FileSystems.rb', line 1432 def IsSupported(used_fs) Ops.get(@support, used_fs, false) end |
- (Object) IsSystemMp(mount, prefix)
1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 |
# File '../../src/modules/FileSystems.rb', line 1652 def IsSystemMp(mount, prefix) mp = Convert.convert( Builtins.union(system_m_points, ["/boot"]), :from => "list", :to => "list <string>" ) ret = Builtins.contains(mp, mount) if !ret && prefix mp = Builtins.filter(mp) { |s| s != "/" } Builtins.foreach(mp) do |s| ret = ret || Builtins.search(mount, Ops.add(s, "/")) == 0 end end if Ops.greater_than(Builtins.size(mount), 0) Builtins.y2milestone( "IsSystemMp mount:%1 prefix:%2 ret:%3", mount, prefix, ret ) end ret end |
- (Object) IsUnsupported(used_fs)
1436 1437 1438 |
# File '../../src/modules/FileSystems.rb', line 1436 def IsUnsupported(used_fs) Builtins.contains(@unsupportFs, used_fs) end |
- (Object) LabelLength(fsys)
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 |
# File '../../src/modules/FileSystems.rb', line 1573 def LabelLength(fsys) ret = 0 assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = caps.labelLength end Builtins.y2milestone("LabelLength fsys:%1 ret:%2", fsys, ret) ret end |
- (Object) LangTypicalEncoding
1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 |
# File '../../src/modules/FileSystems.rb', line 1689 def LangTypicalEncoding lang = Encoding.GetEncLang enc = "utf8" if !Encoding.GetUtf8Lang enc = "iso8859-15" lang = Builtins.substring(lang, 0, 2) lang = Builtins.tolower(lang) enc = Ops.get_string(@lenc, lang, "") if Builtins.haskey(@lenc, lang) end Builtins.y2milestone("LangTypicalEncoding lang %1 ret %2", lang, enc) enc end |
- (Object) main
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File '../../src/modules/FileSystems.rb', line 37 def main textdomain "storage" Yast.import "Arch" Yast.import "String" Yast.import "Partitions" Yast.import "Encoding" Yast.import "Stage" Yast.import "StorageInit" @conv_fs = { "def_sym" => :unknown, "def_int" => ::Storage::FSUNKNOWN, "m" => { ::Storage::REISERFS => :reiser, ::Storage::EXT2 => :ext2, ::Storage::EXT3 => :ext3, ::Storage::EXT4 => :ext4, ::Storage::BTRFS => :btrfs, ::Storage::VFAT => :vfat, ::Storage::XFS => :xfs, ::Storage::JFS => :jfs, ::Storage::HFS => :hfs, ::Storage::NTFS => :ntfs, ::Storage::SWAP => :swap, ::Storage::NFS => :nfs, ::Storage::NFS4 => :nfs4, ::Storage::TMPFS => :tmpfs, ::Storage::FSNONE => :none } } # filesystems possible for root volume. used during scan for root volumes. @possible_root_fs = [:ext2, :ext3, :ext4, :btrfs, :reiser, :xfs] @swap_m_points = ["swap"] @tmp_m_points = ["/tmp", "/var/tmp"] @default_subvol = "UNDEFINED" @suggest_m_points = [] @suggest_tmp_points = [] @nchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" @sint = nil @FstabOptionStrings = [ "defaults", "auto", "noauto", "atime", "noatime", "ro", "rw", "user", "nouser", "acl", "noacl", "user_xattr", "no_user_xattr", "data=journal", "data=ordered", "data=writeback", "dev", "nodev", "exec", "noexec", "suid", "nosuid", "async", "sync", "dirsync", "procuid", "barrier=none", "fs=floppyfss", "fs=cdfss", "users", "gid=users", "usrquota", "grpquota" ] @FstabOptionRegex = [ "pri=[0-9]+", "iocharset=.+", "utf8=.*", "nls=.+", "codepage=.+", "gid=[0-9]+", "umask=[0-7]+", "loop=.+", "encryption=.+", "pri=[0-9]+", "locale=.+", "fmask=[0-7]+", "dmask=[0-7]+", "usrjquota=.+", "grpjquota=.+", "jqfmt=.+" ] @FstabDefaultMap = { "pts" => { "spec" => "devpts", "mount" => "/dev/pts", "vfstype" => "devpts", "mntops" => "mode=0620,gid=5", "freq" => 0, "passno" => 0 }, "proc" => { "spec" => "proc", "mount" => "/proc", "vfstype" => "proc", "mntops" => "defaults", "freq" => 0, "passno" => 0 }, "sys" => { "spec" => "sysfs", "mount" => "/sys", "vfstype" => "sysfs", "mntops" => "noauto", "freq" => 0, "passno" => 0 }, "debug" => { "spec" => "debugfs", "mount" => "/sys/kernel/debug", "vfstype" => "debugfs", "mntops" => "noauto", "freq" => 0, "passno" => 0 }, "swap" => { "spec" => "", "mount" => "swap", "vfstype" => "swap", "mntops" => "default", "freq" => 0, "passno" => 0 }, "root" => { "spec" => "", "mount" => "", "vfstype" => "auto", "mntops" => "defaults", "freq" => 1, "passno" => 1 }, "dev" => { "spec" => "", "mount" => "", "vfstype" => "auto", "mntops" => "noauto,user", "freq" => 0, "passno" => 0 }, "nfs" => { "spec" => "", "mount" => "", "vfstype" => "nfs", "mntops" => "defaults", "freq" => 0, "passno" => 0 }, "usb" => { "spec" => "usbfs", "mount" => "/proc/bus/usb", "vfstype" => "usbfs", "mntops" => "noauto", "freq" => 0, "passno" => 0 }, "cdrom" => { "spec" => "", "mount" => "", "vfstype" => "subfs", "mntops" => "noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec", "freq" => 0, "passno" => 0 }, "floppy" => { "spec" => "", "mount" => "", "vfstype" => "auto", "mntops" => "noauto,user,sync", "freq" => 0, "passno" => 0 }, "zip" => { "spec" => "", "mount" => "", "vfstype" => "auto", "mntops" => "noauto,user", "freq" => 0, "passno" => 0 }, "data" => { "spec" => "", "mount" => "", "vfstype" => "auto", "mntops" => "noauto,user", "freq" => 0, "passno" => 0 } } # All supported filesystems @support = { :xfs => true, :ext2 => true, :ext3 => true, :ext4 => true, :btrfs => true, :jfs => false, :vfat => true, :ntfs => true, :xxefi => false, :xbootdisk => false, :xbootfat => false, :xhibernate => true, :raid => true, :lvm => true } @unsupportFs = [] @tmpfs_fst_options = [ { :widget => TextEntry( Id("tmpfs_size"), Opt(:hstretch), # label text _("Tmpfs &Size"), "" ), :query_key => "tmpfs_size", :between => [1, 200], :empty_allowed => true, :min_size => 100 * 1024, :valid_chars => "0123456789kKmMgG%", # popup text :error_text => _( "Invalid Size specified. Use number followed by K, M, G or %.\nValue must be above 100k or between 1% and 200%. Try again." ), :error_text_percent => _( "Value must be between 1% and 200%. Try again." ), :type => :text, :str_opt => "size=%1", :str_scan => "size=(.*)", # help text, richtext format :help_text => _( "<p><b>Tmpfs Size:</b>\n" + "Size may be either entered as a number followed by K,M,G for Kilo-, Mega- or Gigabyte or\n" + "as a number followed by a percent sign meaning percentage of memory.</p>" ) } ] @swap_fst_options = [ { :widget => TextEntry( Id("priority"), Opt(:hstretch), # label text _("Swap &Priority"), "42" ), :query_key => "priority", :between => [0, 32767], :empty_allowed => true, :valid_chars => "0123456789", # popup text :error_text => _( "Value must be between 0 and 32767. Try again." ), :type => :text, :str_opt => "pri=%1", :str_scan => "pri=(.*)", # help text, richtext format :help_text => _( "<p><b>Swap Priority:</b>\nEnter the swap priority. Higher numbers mean higher priority.</p>\n" ) } ] @SwapFileSystems = { :swap => { :name => "Swap", :fsid => Partitions.fsid_swap, :real_fs => true, :supports_format => true, :fsid_item => "0x82 Linux swap ", :fstype => "Linux swap", :crypt => true, :fst_options => @swap_fst_options, :mountpoints => @swap_m_points } } @PseudoFileSystems = { :lvm => { :name => "LVM", :fsid => Partitions.fsid_lvm, :supports_format => false, :fsid_item => "0x8E Linux LVM " }, :raid => { :name => "RAID", :fsid => Partitions.fsid_raid, :supports_format => false, :fsid_item => "0xFD Linux RAID " }, :xbootdisk => { :name => "PPCBOOT", :fsid => Partitions.fsid_prep_chrp_boot, :supports_format => false, :fsid_item => "0x41 PPC PReP Boot" }, :xbootfat => { :name => "FATBOOT", :fsid => Partitions.fsid_fat16, :supports_format => false, :fsid_item => "0x06 FAT16 Boot" }, :xhibernate => { :name => "Hibernate", :fsid => Partitions.fsid_hibernation, :supports_format => false, :fsid_item => "0xA0 Hibernation" }, :xxbios => { :name => "BIOS Grub", :fsid => Partitions.fsid_bios_grub, :supports_format => false, :label => "gpt", :fsid_item => "0x00 BIOS Grub" }, :xxefi => { :name => "Efi Boot", :fsid => Partitions.fsid_gpt_boot, :supports_format => false, :label => "gpt", :fsid_item => "0x00 EFI Boot" } } @lenc = { "el" => "iso8859-7", "hu" => "iso8859-2", "cs" => "iso8859-2", "hr" => "iso8859-2", "sl" => "iso8859-2", "sk" => "iso8859-2", "en" => "iso8859-1", "tr" => "iso8859-9", "lt" => "iso8859-13", "bg" => "iso8859-5", "ru" => "iso8859-5" } FileSystems() end |
- (Object) MinFsSizeK(fsys)
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 |
# File '../../src/modules/FileSystems.rb', line 1521 def MinFsSizeK(fsys) ret = 0 assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = caps.minimalFsSizeK end Builtins.y2milestone("MinFsSizeK fsys:%1 ret:%2", fsys, ret) ret end |
- (Object) MountLabel(fsys)
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 |
# File '../../src/modules/FileSystems.rb', line 1547 def MountLabel(fsys) ret = false assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = caps.supportsLabel end Builtins.y2milestone("MountLabel fsys:%1 ret:%2", fsys, ret) ret end |
- (Object) MountUuid(fsys)
1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 |
# File '../../src/modules/FileSystems.rb', line 1534 def MountUuid(fsys) ret = false assertInit id = fromSymbol(@conv_fs, fsys) caps = ::Storage::FsCapabilities.new() if @sint.getFsCapabilities(id, caps) ret = caps.supportsUuid end Builtins.y2milestone("MountUuid fsys:%1 ret:%2", fsys, ret) ret end |
- (Object) RemoveCryptOpts(opt)
1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 |
# File '../../src/modules/FileSystems.rb', line 1676 def RemoveCryptOpts(opt) ret = opt ret = String.CutRegexMatch(ret, ",*loop[^,]*", true) ret = String.CutRegexMatch(ret, ",*encryption=[^,]*", true) ret = String.CutRegexMatch(ret, ",*phash=[^,]*", true) ret = String.CutRegexMatch(ret, ",*itercountk=[^,]*", true) if Builtins.size(ret) != Builtins.size(opt) ret = String.CutRegexMatch(ret, "^,", false) Builtins.y2milestone("in %1 ret %2", opt, ret) end ret end |
- (Object) RemoveQuotaOpts(fst_opts)
1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 |
# File '../../src/modules/FileSystems.rb', line 1977 def RemoveQuotaOpts(fst_opts) opts = Builtins.splitstring(fst_opts, ",") opts = Builtins.filter(opts) do |opt| opt != "usrquota" && opt != "grpquota" && Builtins.search(opt, "usrjquota=") != 0 && Builtins.search(opt, "grpjquota=") != 0 && Builtins.search(opt, "jqfmt=") != 0 end Builtins.mergestring(opts, ",") end |
- (Object) SuggesTmpfsMPoints
456 457 458 459 460 461 462 |
# File '../../src/modules/FileSystems.rb', line 456 def SuggesTmpfsMPoints if Builtins.size(@suggest_tmp_points) == 0 @suggest_tmp_points = ["/run", "/var/run", "/tmp", "/var/lock"] Builtins.y2milestone("SuggesTmpfsMPoints init:%1", @suggest_tmp_points) end deep_copy(@suggest_tmp_points) end |
- (Object) SuggestMPoints
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File '../../src/modules/FileSystems.rb', line 422 def SuggestMPoints if Builtins.size(@suggest_m_points) == 0 @suggest_m_points = ["/home", "/srv", "/tmp", "/usr/local"] order_m_mpoints = { "/" => 1, "/home" => 2, "/var" => 3, "/opt" => 4, Partitions.BootMount => 5 } non_proposed_m_points = ["/usr"] if Stage.initial @suggest_m_points = Convert.convert( Builtins.union(system_m_points, @suggest_m_points), :from => "list", :to => "list <string>" ) end @suggest_m_points = Builtins.filter(@suggest_m_points) do |s| !Builtins.contains(non_proposed_m_points, s) end @suggest_m_points = Builtins.sort(@suggest_m_points) do |a, b| Ops.get(order_m_mpoints, a, 99) == Ops.get(order_m_mpoints, b, 99) ? Ops.less_or_equal(a, b) : Ops.less_or_equal( Ops.get(order_m_mpoints, a, 99), Ops.get(order_m_mpoints, b, 99) ) end Builtins.y2milestone("SuggestMPoints init:%1", @suggest_m_points) end deep_copy(@suggest_m_points) end |
- (Object) system_m_points
415 416 417 |
# File '../../src/modules/FileSystems.rb', line 415 def system_m_points ["/", "/usr", "/var", "/opt", Partitions.BootMount] end |