Merge branch 'master' into raid-support
This commit is contained in:
commit
4a52757009
|
@ -32,10 +32,10 @@ set(BLKID_MIN_VERSION "2.33.2")
|
||||||
# Qca plugin (botan or ossl)
|
# Qca plugin (botan or ossl)
|
||||||
|
|
||||||
set(VERSION_MAJOR "4")
|
set(VERSION_MAJOR "4")
|
||||||
set(VERSION_MINOR "0")
|
set(VERSION_MINOR "1")
|
||||||
set(VERSION_RELEASE "1")
|
set(VERSION_RELEASE "0")
|
||||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE})
|
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE})
|
||||||
set(SOVERSION "8")
|
set(SOVERSION "10")
|
||||||
add_definitions(-D'VERSION="${VERSION}"') #"
|
add_definitions(-D'VERSION="${VERSION}"') #"
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
@ -82,8 +82,8 @@ add_definitions(
|
||||||
-DQT_NO_URL_CAST_FROM_STRING
|
-DQT_NO_URL_CAST_FROM_STRING
|
||||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||||
-DQT_NO_CAST_TO_BYTEARRAY
|
-DQT_NO_CAST_TO_BYTEARRAY
|
||||||
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
|
|
||||||
-DQT_USE_FAST_OPERATOR_PLUS
|
-DQT_USE_FAST_OPERATOR_PLUS
|
||||||
|
-DQT_NO_KEYWORDS
|
||||||
)
|
)
|
||||||
kde_enable_exceptions()
|
kde_enable_exceptions()
|
||||||
|
|
||||||
|
|
675
COPYING.md
675
COPYING.md
|
@ -1,675 +0,0 @@
|
||||||
### GNU GENERAL PUBLIC LICENSE
|
|
||||||
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
|
||||||
<https://fsf.org/>
|
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this
|
|
||||||
license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
### Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom
|
|
||||||
to share and change all versions of a program--to make sure it remains
|
|
||||||
free software for all its users. We, the Free Software Foundation, use
|
|
||||||
the GNU General Public License for most of our software; it applies
|
|
||||||
also to any other work released this way by its authors. You can apply
|
|
||||||
it to your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you
|
|
||||||
have certain responsibilities if you distribute copies of the
|
|
||||||
software, or if you modify it: responsibilities to respect the freedom
|
|
||||||
of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the
|
|
||||||
manufacturer can do so. This is fundamentally incompatible with the
|
|
||||||
aim of protecting users' freedom to change the software. The
|
|
||||||
systematic pattern of such abuse occurs in the area of products for
|
|
||||||
individuals to use, which is precisely where it is most unacceptable.
|
|
||||||
Therefore, we have designed this version of the GPL to prohibit the
|
|
||||||
practice for those products. If such problems arise substantially in
|
|
||||||
other domains, we stand ready to extend this provision to those
|
|
||||||
domains in future versions of the GPL, as needed to protect the
|
|
||||||
freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish
|
|
||||||
to avoid the special danger that patents applied to a free program
|
|
||||||
could make it effectively proprietary. To prevent this, the GPL
|
|
||||||
assures that patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
### TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
#### 0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds
|
|
||||||
of works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of
|
|
||||||
an exact copy. The resulting work is called a "modified version" of
|
|
||||||
the earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user
|
|
||||||
through a computer network, with no transfer of a copy, is not
|
|
||||||
conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices" to
|
|
||||||
the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
#### 1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. "Object code" means any non-source form of
|
|
||||||
a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users can
|
|
||||||
regenerate automatically from other parts of the Corresponding Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that same
|
|
||||||
work.
|
|
||||||
|
|
||||||
#### 2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not convey,
|
|
||||||
without conditions so long as your license otherwise remains in force.
|
|
||||||
You may convey covered works to others for the sole purpose of having
|
|
||||||
them make modifications exclusively for you, or provide you with
|
|
||||||
facilities for running those works, provided that you comply with the
|
|
||||||
terms of this License in conveying all material for which you do not
|
|
||||||
control copyright. Those thus making or running the covered works for
|
|
||||||
you must do so exclusively on your behalf, under your direction and
|
|
||||||
control, on terms that prohibit them from making any copies of your
|
|
||||||
copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under the
|
|
||||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
|
||||||
it unnecessary.
|
|
||||||
|
|
||||||
#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such
|
|
||||||
circumvention is effected by exercising rights under this License with
|
|
||||||
respect to the covered work, and you disclaim any intention to limit
|
|
||||||
operation or modification of the work as a means of enforcing, against
|
|
||||||
the work's users, your or third parties' legal rights to forbid
|
|
||||||
circumvention of technological measures.
|
|
||||||
|
|
||||||
#### 4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
#### 5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
- a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
- b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under
|
|
||||||
section 7. This requirement modifies the requirement in section 4
|
|
||||||
to "keep intact all notices".
|
|
||||||
- c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
- d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
#### 6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms of
|
|
||||||
sections 4 and 5, provided that you also convey the machine-readable
|
|
||||||
Corresponding Source under the terms of this License, in one of these
|
|
||||||
ways:
|
|
||||||
|
|
||||||
- a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
- b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the Corresponding
|
|
||||||
Source from a network server at no charge.
|
|
||||||
- c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
- d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
- e) Convey the object code using peer-to-peer transmission,
|
|
||||||
provided you inform other peers where the object code and
|
|
||||||
Corresponding Source of the work are being offered to the general
|
|
||||||
public at no charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal,
|
|
||||||
family, or household purposes, or (2) anything designed or sold for
|
|
||||||
incorporation into a dwelling. In determining whether a product is a
|
|
||||||
consumer product, doubtful cases shall be resolved in favor of
|
|
||||||
coverage. For a particular product received by a particular user,
|
|
||||||
"normally used" refers to a typical or common use of that class of
|
|
||||||
product, regardless of the status of the particular user or of the way
|
|
||||||
in which the particular user actually uses, or expects or is expected
|
|
||||||
to use, the product. A product is a consumer product regardless of
|
|
||||||
whether the product has substantial commercial, industrial or
|
|
||||||
non-consumer uses, unless such uses represent the only significant
|
|
||||||
mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to
|
|
||||||
install and execute modified versions of a covered work in that User
|
|
||||||
Product from a modified version of its Corresponding Source. The
|
|
||||||
information must suffice to ensure that the continued functioning of
|
|
||||||
the modified object code is in no case prevented or interfered with
|
|
||||||
solely because modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or
|
|
||||||
updates for a work that has been modified or installed by the
|
|
||||||
recipient, or for the User Product in which it has been modified or
|
|
||||||
installed. Access to a network may be denied when the modification
|
|
||||||
itself materially and adversely affects the operation of the network
|
|
||||||
or violates the rules and protocols for communication across the
|
|
||||||
network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
#### 7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders
|
|
||||||
of that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
- a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
- b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
- c) Prohibiting misrepresentation of the origin of that material,
|
|
||||||
or requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
- d) Limiting the use for publicity purposes of names of licensors
|
|
||||||
or authors of the material; or
|
|
||||||
- e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
- f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions
|
|
||||||
of it) with contractual assumptions of liability to the recipient,
|
|
||||||
for any liability that these contractual assumptions directly
|
|
||||||
impose on those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions; the
|
|
||||||
above requirements apply either way.
|
|
||||||
|
|
||||||
#### 8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your license
|
|
||||||
from a particular copyright holder is reinstated (a) provisionally,
|
|
||||||
unless and until the copyright holder explicitly and finally
|
|
||||||
terminates your license, and (b) permanently, if the copyright holder
|
|
||||||
fails to notify you of the violation by some reasonable means prior to
|
|
||||||
60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
#### 9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or run
|
|
||||||
a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
#### 10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
#### 11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims owned
|
|
||||||
or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within the
|
|
||||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
|
||||||
the non-exercise of one or more of the rights that are specifically
|
|
||||||
granted under this License. You may not convey a covered work if you
|
|
||||||
are a party to an arrangement with a third party that is in the
|
|
||||||
business of distributing software, under which you make payment to the
|
|
||||||
third party based on the extent of your activity of conveying the
|
|
||||||
work, and under which the third party grants, to any of the parties
|
|
||||||
who would receive the covered work from you, a discriminatory patent
|
|
||||||
license (a) in connection with copies of the covered work conveyed by
|
|
||||||
you (or copies made from those copies), or (b) primarily for and in
|
|
||||||
connection with specific products or compilations that contain the
|
|
||||||
covered work, unless you entered into that arrangement, or that patent
|
|
||||||
license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
#### 12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under
|
|
||||||
this License and any other pertinent obligations, then as a
|
|
||||||
consequence you may not convey it at all. For example, if you agree to
|
|
||||||
terms that obligate you to collect a royalty for further conveying
|
|
||||||
from those to whom you convey the Program, the only way you could
|
|
||||||
satisfy both those terms and this License would be to refrain entirely
|
|
||||||
from conveying the Program.
|
|
||||||
|
|
||||||
#### 13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
#### 14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the GNU General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in
|
|
||||||
detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies that a certain numbered version of the GNU General Public
|
|
||||||
License "or any later version" applies to it, you have the option of
|
|
||||||
following the terms and conditions either of that numbered version or
|
|
||||||
of any later version published by the Free Software Foundation. If the
|
|
||||||
Program does not specify a version number of the GNU General Public
|
|
||||||
License, you may choose any version ever published by the Free
|
|
||||||
Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future versions
|
|
||||||
of the GNU General Public License can be used, that proxy's public
|
|
||||||
statement of acceptance of a version permanently authorizes you to
|
|
||||||
choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
#### 15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
|
||||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
|
||||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
|
||||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
|
||||||
CORRECTION.
|
|
||||||
|
|
||||||
#### 16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
|
||||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
|
||||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
|
||||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
|
||||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
|
||||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
|
||||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
#### 17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
### How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these
|
|
||||||
terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest to
|
|
||||||
attach them to the start of each source file to most effectively state
|
|
||||||
the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper
|
|
||||||
mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands \`show w' and \`show c' should show the
|
|
||||||
appropriate parts of the General Public License. Of course, your
|
|
||||||
program's commands might be different; for a GUI interface, you would
|
|
||||||
use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. For more information on this, and how to apply and follow
|
|
||||||
the GNU GPL, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your
|
|
||||||
program into proprietary programs. If your program is a subroutine
|
|
||||||
library, you may consider it more useful to permit linking proprietary
|
|
||||||
applications with the library. If this is what you want to do, use the
|
|
||||||
GNU Lesser General Public License instead of this License. But first,
|
|
||||||
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
|
@ -55,7 +55,7 @@ class `KPMCoreInitializer` from `test/helpers.h`):
|
||||||
|
|
||||||
QByteArray env = qgetenv( "KPMCORE_BACKEND" );
|
QByteArray env = qgetenv( "KPMCORE_BACKEND" );
|
||||||
auto backendName = env.isEmpty() ? CoreBackendManager::defaultBackendName() : env;
|
auto backendName = env.isEmpty() ? CoreBackendManager::defaultBackendName() : env;
|
||||||
if ( !CoreBackendManager::self()->load( backendName )
|
if ( !CoreBackendManager::self()->load( backendName ) )
|
||||||
{
|
{
|
||||||
qWarning() << "Failed to load backend plugin" << backendName;
|
qWarning() << "Failed to load backend plugin" << backendName;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -40,12 +40,12 @@ CoreBackend::~CoreBackend()
|
||||||
|
|
||||||
void CoreBackend::emitProgress(int i)
|
void CoreBackend::emitProgress(int i)
|
||||||
{
|
{
|
||||||
emit progress(i);
|
Q_EMIT progress(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreBackend::emitScanProgress(const QString& deviceNode, int i)
|
void CoreBackend::emitScanProgress(const QString& deviceNode, int i)
|
||||||
{
|
{
|
||||||
emit scanProgress(deviceNode, i);
|
Q_EMIT scanProgress(deviceNode, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreBackend::setPartitionTableForDevice(Device& d, PartitionTable* p)
|
void CoreBackend::setPartitionTableForDevice(Device& d, PartitionTable* p)
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Report;
|
||||||
class CoreBackendDevice
|
class CoreBackendDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CoreBackendDevice(const QString& deviceNode);
|
explicit CoreBackendDevice(const QString& deviceNode);
|
||||||
virtual ~CoreBackendDevice() {}
|
virtual ~CoreBackendDevice() {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -103,6 +103,47 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool updateGeometry(Report& report, const Partition& partition, qint64 sector_start, qint64 sector_end) = 0;
|
virtual bool updateGeometry(Report& report, const Partition& partition, qint64 sector_start, qint64 sector_end) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the UUID of a partition in the partition table (GPT only).
|
||||||
|
* The partition UUID is known as PARTUUID by several utilities. The device-manager links
|
||||||
|
* the device under /dev/disk/by-partuuid/<uuid>.
|
||||||
|
* @param report the report to write information to
|
||||||
|
* @param partition the partition to get the UUID for
|
||||||
|
* @return the partition UUID
|
||||||
|
*/
|
||||||
|
virtual QString getPartitionUUID(Report& report, const Partition& partition) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the label of a partition in the partition table (GPT only).
|
||||||
|
* The label is set in the GPT partition name entry. The partition name is known as PARTLABEL by
|
||||||
|
* several utilities. The device-manager links the device under /dev/disk/by-partlabel/<label>.
|
||||||
|
* @param report the report to write information to
|
||||||
|
* @param partition the partition to set the label for
|
||||||
|
* @param label the new label for the partition
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
|
virtual bool setPartitionLabel(Report& report, const Partition& partition, const QString& label) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the UUID of a partition in the partition table (GPT only).
|
||||||
|
* The partition UUID is known as PARTUUID by several utilities. The device-manager links
|
||||||
|
* the device under /dev/disk/by-partuuid/<uuid>.
|
||||||
|
* @param report the report to write information to
|
||||||
|
* @param partition the partition to set the UUID for
|
||||||
|
* @param uuid the new UUID for the partition
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
|
virtual bool setPartitionUUID(Report& report, const Partition& partition, const QString& uuid) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the attributes of a partition in the partition table (GPT only).
|
||||||
|
* @param report the report to write information to
|
||||||
|
* @param partition the partition to set the attributes for
|
||||||
|
* @param attrs the new attributes for the partition
|
||||||
|
* @return true on success
|
||||||
|
*/
|
||||||
|
virtual bool setPartitionAttributes(Report& report, const Partition& partition, quint64 attrs) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the system type (e.g. 83 for Linux) of a partition. The type to set is taken from
|
* Set the system type (e.g. 83 for Linux) of a partition. The type to set is taken from
|
||||||
* the partition's file system.
|
* the partition's file system.
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CopyTarget;
|
||||||
class CopySourceFile : public CopySource
|
class CopySourceFile : public CopySource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CopySourceFile(const QString& filename);
|
explicit CopySourceFile(const QString& filename);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool open() override;
|
bool open() override;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
class CopyTargetByteArray : public CopyTarget
|
class CopyTargetByteArray : public CopyTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CopyTargetByteArray(QByteArray& array);
|
explicit CopyTargetByteArray(QByteArray& array);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool open() override {
|
bool open() override {
|
||||||
|
|
|
@ -36,7 +36,7 @@ class QString;
|
||||||
class CopyTargetFile : public CopyTarget
|
class CopyTargetFile : public CopyTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CopyTargetFile(const QString& filename);
|
explicit CopyTargetFile(const QString& filename);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool open() override;
|
bool open() override;
|
||||||
|
|
|
@ -59,7 +59,7 @@ void DeviceScanner::run()
|
||||||
|
|
||||||
void DeviceScanner::scan()
|
void DeviceScanner::scan()
|
||||||
{
|
{
|
||||||
emit progress(QString(), 0);
|
Q_EMIT progress(QString(), 0);
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "util/externalcommand.h"
|
#include "util/externalcommand.h"
|
||||||
#include "util/report.h"
|
#include "util/report.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#include <blkid/blkid.h>
|
#include <blkid/blkid.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,6 +36,8 @@
|
||||||
|
|
||||||
static void parseFsSpec(const QString& m_fsSpec, FstabEntry::Type& m_entryType, QString& m_deviceNode);
|
static void parseFsSpec(const QString& m_fsSpec, FstabEntry::Type& m_entryType, QString& m_deviceNode);
|
||||||
static QString findBlkIdDevice(const char *token, const QString& value);
|
static QString findBlkIdDevice(const char *token, const QString& value);
|
||||||
|
static void writeEntry(QTextStream& s, const FstabEntry& entry, std::array<unsigned int, 4> columnWidth);
|
||||||
|
std::array<unsigned int, 4> fstabColumnWidth(const FstabEntryList& fstabEntries);
|
||||||
|
|
||||||
struct FstabEntryPrivate
|
struct FstabEntryPrivate
|
||||||
{
|
{
|
||||||
|
@ -59,6 +63,7 @@ FstabEntry::FstabEntry(const QString& fsSpec, const QString& mountPoint, const Q
|
||||||
d->m_comment = comment;
|
d->m_comment = comment;
|
||||||
|
|
||||||
d->m_options = options.split(QLatin1Char(','));
|
d->m_options = options.split(QLatin1Char(','));
|
||||||
|
d->m_options.removeAll(QStringLiteral("defaults"));
|
||||||
parseFsSpec(d->m_fsSpec, d->m_entryType, d->m_deviceNode);
|
parseFsSpec(d->m_fsSpec, d->m_entryType, d->m_deviceNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,15 +93,20 @@ FstabEntryList readFstabEntries( const QString& fstabPath )
|
||||||
// (4) dump frequency (optional, defaults to 0), no comment is allowed if omitted,
|
// (4) dump frequency (optional, defaults to 0), no comment is allowed if omitted,
|
||||||
// (5) pass number (optional, defaults to 0), no comment is allowed if omitted,
|
// (5) pass number (optional, defaults to 0), no comment is allowed if omitted,
|
||||||
// (#) comment (optional).
|
// (#) comment (optional).
|
||||||
|
auto fsSpec = splitLine.at(0);
|
||||||
|
auto mountPoint = splitLine.at(1);
|
||||||
|
auto fsType = splitLine.at(2);
|
||||||
|
auto options = splitLine.at(3);
|
||||||
|
|
||||||
switch (splitLine.length()) {
|
switch (splitLine.length()) {
|
||||||
case 4:
|
case 4:
|
||||||
fstabEntries.push_back( {splitLine.at(0), splitLine.at(1), splitLine.at(2), splitLine.at(3) } );
|
fstabEntries.push_back( {fsSpec, mountPoint, fsType, options } );
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
fstabEntries.push_back( {splitLine.at(0), splitLine.at(1), splitLine.at(2), splitLine.at(3), splitLine.at(4).toInt() } );
|
fstabEntries.push_back( {fsSpec, mountPoint, fsType, options, splitLine.at(4).toInt() } );
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
fstabEntries.push_back( {splitLine.at(0), splitLine.at(1), splitLine.at(2), splitLine.at(3), splitLine.at(4).toInt(), splitLine.at(5).toInt(), comment.isEmpty() ? QString() : QLatin1Char('#') + comment } );
|
fstabEntries.push_back( {fsSpec, mountPoint, fsType, options, splitLine.at(4).toInt(), splitLine.at(5).toInt(), comment.isEmpty() ? QString() : QLatin1Char('#') + comment } );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fstabEntries.push_back( { {}, {}, {}, {}, {}, {}, QLatin1Char('#') + line } );
|
fstabEntries.push_back( { {}, {}, {}, {}, {}, {}, QLatin1Char('#') + line } );
|
||||||
|
@ -142,6 +152,11 @@ const QStringList& FstabEntry::options() const
|
||||||
return d->m_options;
|
return d->m_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString FstabEntry::optionsString() const
|
||||||
|
{
|
||||||
|
return options().size() > 0 ? options().join(QLatin1Char(',')) : QStringLiteral("defaults");
|
||||||
|
}
|
||||||
|
|
||||||
int FstabEntry::dumpFreq() const
|
int FstabEntry::dumpFreq() const
|
||||||
{
|
{
|
||||||
return d->m_dumpFreq;
|
return d->m_dumpFreq;
|
||||||
|
@ -203,6 +218,9 @@ static QString findBlkIdDevice(const char *token, const QString& value)
|
||||||
rval = QString::fromLocal8Bit(c);
|
rval = QString::fromLocal8Bit(c);
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
Q_UNUSED(token);
|
||||||
|
Q_UNUSED(value);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
|
@ -229,40 +247,50 @@ static void parseFsSpec(const QString& m_fsSpec, FstabEntry::Type& m_entryType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void writeEntry(QTextStream& s, const FstabEntry& entry)
|
|
||||||
|
// Used to nicely format fstab file
|
||||||
|
std::array<unsigned int, 4> fstabColumnWidth(const FstabEntryList& fstabEntries)
|
||||||
|
{
|
||||||
|
std::array<unsigned int, 4> columnWidth;
|
||||||
|
|
||||||
|
#define FIELD_WIDTH(x) 3 + std::max_element(fstabEntries.begin(), fstabEntries.end(), [](const FstabEntry& a, const FstabEntry& b) {return a.x().length() < b.x().length(); })->x().length();
|
||||||
|
|
||||||
|
columnWidth[0] = FIELD_WIDTH(fsSpec);
|
||||||
|
columnWidth[1] = FIELD_WIDTH(mountPoint);
|
||||||
|
columnWidth[2] = FIELD_WIDTH(type);
|
||||||
|
columnWidth[3] = FIELD_WIDTH(optionsString);
|
||||||
|
|
||||||
|
return columnWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void writeEntry(QTextStream& s, const FstabEntry& entry, std::array<unsigned int, 4> columnWidth)
|
||||||
{
|
{
|
||||||
if (entry.entryType() == FstabEntry::Type::comment) {
|
if (entry.entryType() == FstabEntry::Type::comment) {
|
||||||
s << entry.comment() << "\n";
|
s << entry.comment() << "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString options;
|
s.setFieldAlignment(QTextStream::AlignLeft);
|
||||||
if (entry.options().size() > 0) {
|
s.setFieldWidth(columnWidth[0]);
|
||||||
options = entry.options().join(QLatin1Char(','));
|
s << entry.fsSpec()
|
||||||
if (options.isEmpty())
|
<< qSetFieldWidth(columnWidth[1]) << (entry.mountPoint().isEmpty() ? QStringLiteral("none") : entry.mountPoint())
|
||||||
options = QStringLiteral("defaults");
|
<< qSetFieldWidth(columnWidth[2]) << entry.type()
|
||||||
}
|
<< qSetFieldWidth(columnWidth[3]) << entry.optionsString() << qSetFieldWidth(0)
|
||||||
else
|
<< entry.dumpFreq() << " "
|
||||||
options = QStringLiteral("defaults");
|
<< entry.passNumber() << " "
|
||||||
|
|
||||||
s << entry.fsSpec() << "\t"
|
|
||||||
<< (entry.mountPoint().isEmpty() ? QStringLiteral("none") : entry.mountPoint()) << "\t"
|
|
||||||
<< entry.type() << "\t"
|
|
||||||
<< options << "\t"
|
|
||||||
<< entry.dumpFreq() << "\t"
|
|
||||||
<< entry.passNumber() << "\t"
|
|
||||||
<< entry.comment() << "\n";
|
<< entry.comment() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool writeMountpoints(const FstabEntryList& fstabEntries, const QString& filename)
|
bool writeMountpoints(const FstabEntryList& fstabEntries, const QString& filename)
|
||||||
{
|
{
|
||||||
Report report(nullptr);
|
QString fstabContents;
|
||||||
QByteArray fstabContents;
|
|
||||||
QTextStream out(&fstabContents);
|
QTextStream out(&fstabContents);
|
||||||
|
|
||||||
|
std::array<unsigned int, 4> columnWidth = fstabColumnWidth(fstabEntries);
|
||||||
|
|
||||||
for (const auto &e : fstabEntries)
|
for (const auto &e : fstabEntries)
|
||||||
writeEntry(out, e);
|
writeEntry(out, e, columnWidth);
|
||||||
|
|
||||||
ExternalCommand cmd;
|
ExternalCommand cmd;
|
||||||
return cmd.writeData(report, fstabContents, filename, 0);
|
return cmd.createFile(fstabContents.toLocal8Bit(), filename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,11 @@ public:
|
||||||
*/
|
*/
|
||||||
const QStringList& options() const;
|
const QStringList& options() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the mount options associated with the file system
|
||||||
|
*/
|
||||||
|
const QString optionsString() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the fs_freq field of fstab entry
|
* @return the fs_freq field of fstab entry
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -170,7 +170,7 @@ Partition* LvmDevice::scanPartition(const QString& lvPath, PartitionTable* pTabl
|
||||||
mountPoint = FileSystem::detectMountPoint(fs, lvPath);
|
mountPoint = FileSystem::detectMountPoint(fs, lvPath);
|
||||||
mounted = FileSystem::detectMountStatus(fs, lvPath);
|
mounted = FileSystem::detectMountStatus(fs, lvPath);
|
||||||
|
|
||||||
if (mountPoint != QString() && fs->type() != FileSystem::Type::LinuxSwap) {
|
if (!mountPoint.isEmpty() && fs->type() != FileSystem::Type::LinuxSwap) {
|
||||||
const QStorageInfo storage = QStorageInfo(mountPoint);
|
const QStorageInfo storage = QStorageInfo(mountPoint);
|
||||||
if (logicalSize() > 0 && fs->type() != FileSystem::Type::Luks && mounted && storage.isValid())
|
if (logicalSize() > 0 && fs->type() != FileSystem::Type::Luks && mounted && storage.isValid())
|
||||||
fs->setSectorsUsed( (storage.bytesTotal() - storage.bytesFree()) / logicalSize() );
|
fs->setSectorsUsed( (storage.bytesTotal() - storage.bytesFree()) / logicalSize() );
|
||||||
|
|
|
@ -48,7 +48,7 @@ class LIBKPMCORE_EXPORT LvmDevice : public VolumeManagerDevice
|
||||||
friend class VolumeManagerDevice;
|
friend class VolumeManagerDevice;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LvmDevice(const QString& name, const QString& iconName = QString());
|
explicit LvmDevice(const QString& name, const QString& iconName = QString());
|
||||||
~LvmDevice();
|
~LvmDevice();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -69,7 +69,7 @@ void OperationRunner::run()
|
||||||
Operation* op = operationStack().operations()[i];
|
Operation* op = operationStack().operations()[i];
|
||||||
op->setStatus(Operation::StatusRunning);
|
op->setStatus(Operation::StatusRunning);
|
||||||
|
|
||||||
emit opStarted(i + 1, op);
|
Q_EMIT opStarted(i + 1, op);
|
||||||
|
|
||||||
connect(op, &Operation::progress, this, &OperationRunner::progressSub);
|
connect(op, &Operation::progress, this, &OperationRunner::progressSub);
|
||||||
|
|
||||||
|
@ -78,18 +78,18 @@ void OperationRunner::run()
|
||||||
|
|
||||||
disconnect(op, &Operation::progress, this, &OperationRunner::progressSub);
|
disconnect(op, &Operation::progress, this, &OperationRunner::progressSub);
|
||||||
|
|
||||||
emit opFinished(i + 1, op);
|
Q_EMIT opFinished(i + 1, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (automounter)
|
if (automounter)
|
||||||
kdedInterface.call( QStringLiteral("loadModule"), automounterService );
|
kdedInterface.call( QStringLiteral("loadModule"), automounterService );
|
||||||
|
|
||||||
if (!status)
|
if (!status)
|
||||||
emit error();
|
Q_EMIT error();
|
||||||
else if (isCancelling())
|
else if (isCancelling())
|
||||||
emit cancelled();
|
Q_EMIT cancelled();
|
||||||
else
|
else
|
||||||
emit finished();
|
Q_EMIT finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the number of Operations to run */
|
/** @return the number of Operations to run */
|
||||||
|
|
|
@ -452,9 +452,9 @@ void OperationStack::push(Operation* o)
|
||||||
o->setStatus(Operation::StatusPending);
|
o->setStatus(Operation::StatusPending);
|
||||||
}
|
}
|
||||||
|
|
||||||
// emit operationsChanged even if o is nullptr because it has been merged: merging might
|
// Q_EMIT operationsChanged even if o is nullptr because it has been merged: merging might
|
||||||
// have led to an existing operation changing.
|
// have led to an existing operation changing.
|
||||||
emit operationsChanged();
|
Q_EMIT operationsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes the topmost Operation from the OperationStack, calls Operation::undo() on it and deletes it. */
|
/** Removes the topmost Operation from the OperationStack, calls Operation::undo() on it and deletes it. */
|
||||||
|
@ -463,7 +463,7 @@ void OperationStack::pop()
|
||||||
Operation* o = operations().takeLast();
|
Operation* o = operations().takeLast();
|
||||||
o->undo();
|
o->undo();
|
||||||
delete o;
|
delete o;
|
||||||
emit operationsChanged();
|
Q_EMIT operationsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check whether previous operations involve given partition.
|
/** Check whether previous operations involve given partition.
|
||||||
|
@ -499,7 +499,7 @@ void OperationStack::clearOperations()
|
||||||
delete o;
|
delete o;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit operationsChanged();
|
Q_EMIT operationsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Clears the list of Devices. */
|
/** Clears the list of Devices. */
|
||||||
|
@ -509,7 +509,7 @@ void OperationStack::clearDevices()
|
||||||
|
|
||||||
qDeleteAll(previewDevices());
|
qDeleteAll(previewDevices());
|
||||||
previewDevices().clear();
|
previewDevices().clear();
|
||||||
emit devicesChanged();
|
Q_EMIT devicesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Finds a Device a Partition is on.
|
/** Finds a Device a Partition is on.
|
||||||
|
@ -549,7 +549,7 @@ void OperationStack::addDevice(Device* d)
|
||||||
QWriteLocker lockDevices(&lock());
|
QWriteLocker lockDevices(&lock());
|
||||||
|
|
||||||
previewDevices().append(d);
|
previewDevices().append(d);
|
||||||
emit devicesChanged();
|
Q_EMIT devicesChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool deviceLessThan(const Device* d1, const Device* d2)
|
static bool deviceLessThan(const Device* d1, const Device* d2)
|
||||||
|
@ -567,5 +567,5 @@ void OperationStack::sortDevices()
|
||||||
|
|
||||||
std::sort(previewDevices().begin(), previewDevices().end(), deviceLessThan);
|
std::sort(previewDevices().begin(), previewDevices().end(), deviceLessThan);
|
||||||
|
|
||||||
emit devicesChanged();
|
Q_EMIT devicesChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
typedef QList<Operation*> Operations;
|
typedef QList<Operation*> Operations;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OperationStack(QObject* parent = nullptr);
|
explicit OperationStack(QObject* parent = nullptr);
|
||||||
~OperationStack();
|
~OperationStack();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#include "util/libpartitionmanagerexport.h"
|
#include "util/libpartitionmanagerexport.h"
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
|
@ -125,9 +124,15 @@ public:
|
||||||
const QString& label() const {
|
const QString& label() const {
|
||||||
return m_Label; /**< @return the GPT Partition label */
|
return m_Label; /**< @return the GPT Partition label */
|
||||||
}
|
}
|
||||||
|
const QString& type() const {
|
||||||
|
return m_Type; /**< @return the GPT Partition type */
|
||||||
|
}
|
||||||
const QString& uuid() const {
|
const QString& uuid() const {
|
||||||
return m_UUID; /**< @return the GPT Partition UUID */
|
return m_UUID; /**< @return the GPT Partition UUID */
|
||||||
}
|
}
|
||||||
|
quint64 attributes() const {
|
||||||
|
return m_Attributes; /**< @return the GPT Partition attributes */
|
||||||
|
}
|
||||||
qint64 firstSector() const {
|
qint64 firstSector() const {
|
||||||
return m_FirstSector; /**< @return the Partition's first sector on the Device */
|
return m_FirstSector; /**< @return the Partition's first sector on the Device */
|
||||||
}
|
}
|
||||||
|
@ -210,9 +215,15 @@ public:
|
||||||
void setLabel(const QString& s) {
|
void setLabel(const QString& s) {
|
||||||
m_Label = s; /**< @param s the new label */
|
m_Label = s; /**< @param s the new label */
|
||||||
}
|
}
|
||||||
|
void setType(const QString& s) {
|
||||||
|
m_Type = s; /**< @param s the new type */
|
||||||
|
}
|
||||||
void setUUID(const QString& s) {
|
void setUUID(const QString& s) {
|
||||||
m_UUID = s; /**< @param s the new UUID */
|
m_UUID = s; /**< @param s the new UUID */
|
||||||
}
|
}
|
||||||
|
void setAttributes(quint64 f) {
|
||||||
|
m_Attributes = f; /**< @param f the new attributes */
|
||||||
|
}
|
||||||
|
|
||||||
void append(Partition* p) override {
|
void append(Partition* p) override {
|
||||||
m_Children.append(p);
|
m_Children.append(p);
|
||||||
|
@ -266,7 +277,9 @@ private:
|
||||||
qint64 m_LastSector;
|
qint64 m_LastSector;
|
||||||
QString m_DevicePath;
|
QString m_DevicePath;
|
||||||
QString m_Label;
|
QString m_Label;
|
||||||
|
QString m_Type;
|
||||||
QString m_UUID;
|
QString m_UUID;
|
||||||
|
quint64 m_Attributes;
|
||||||
QString m_PartitionPath;
|
QString m_PartitionPath;
|
||||||
QString m_MountPoint;
|
QString m_MountPoint;
|
||||||
PartitionTable::Flags m_AvailableFlags;
|
PartitionTable::Flags m_AvailableFlags;
|
||||||
|
|
|
@ -75,7 +75,7 @@ bool PartitionAlignment::isLengthAligned(const Device& d, const Partition& p)
|
||||||
@param d device the partition is on
|
@param d device the partition is on
|
||||||
@param p the partition to check
|
@param p the partition to check
|
||||||
@param quiet if true, will not print warning
|
@param quiet if true, will not print warning
|
||||||
@return true if propertly aligned
|
@return true if properly aligned
|
||||||
*/
|
*/
|
||||||
bool PartitionAlignment::isAligned(const Device& d, const Partition& p, bool quiet)
|
bool PartitionAlignment::isAligned(const Device& d, const Partition& p, bool quiet)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
Recovery,
|
Recovery,
|
||||||
};
|
};
|
||||||
|
|
||||||
SoftwareRAID(const QString& name,
|
explicit SoftwareRAID(const QString& name,
|
||||||
SoftwareRAID::Status status = SoftwareRAID::Status::Active,
|
SoftwareRAID::Status status = SoftwareRAID::Status::Active,
|
||||||
const QString& iconName = QString());
|
const QString& iconName = QString());
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SmartAttribute(const SmartAttributeParsedData& a);
|
explicit SmartAttribute(const SmartAttributeParsedData& a);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
qint32 id() const {
|
qint32 id() const {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
/** Creates a new SmartParser object
|
/** Creates a new SmartParser object
|
||||||
@param device_path device path that indicates the device that SMART must analyse
|
@param device_path device path that indicates the device that SMART must analyze
|
||||||
*/
|
*/
|
||||||
SmartParser::SmartParser(const QString &device_path) :
|
SmartParser::SmartParser(const QString &device_path) :
|
||||||
m_DevicePath(device_path),
|
m_DevicePath(device_path),
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SmartDiskInformation;
|
||||||
class SmartParser
|
class SmartParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SmartParser(const QString &device_path);
|
explicit SmartParser(const QString &device_path);
|
||||||
~SmartParser();
|
~SmartParser();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
public:
|
public:
|
||||||
const QString &devicePath() const
|
const QString &devicePath() const
|
||||||
{
|
{
|
||||||
return m_DevicePath; /**< @return the device path that SMART must analyse */
|
return m_DevicePath; /**< @return the device path that SMART must analyze */
|
||||||
}
|
}
|
||||||
|
|
||||||
SmartDiskInformation *diskInformation() const
|
SmartDiskInformation *diskInformation() const
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
typedef QList<SmartAttribute> Attributes;
|
typedef QList<SmartAttribute> Attributes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SmartStatus(const QString &device_path);
|
explicit SmartStatus(const QString &device_path);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void update();
|
void update();
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "core/device_p.h"
|
|
||||||
#include "core/partition.h"
|
|
||||||
#include "core/volumemanagerdevice.h"
|
#include "core/volumemanagerdevice.h"
|
||||||
#include "core/volumemanagerdevice_p.h"
|
#include "core/volumemanagerdevice_p.h"
|
||||||
|
#include "core/device_p.h"
|
||||||
|
#include "core/partition.h"
|
||||||
#include "core/lvmdevice.h"
|
#include "core/lvmdevice.h"
|
||||||
#include "core/raid/softwareraid.h"
|
#include "core/raid/softwareraid.h"
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ FileSystem::CommandSupportType apfs::m_Move = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType apfs::m_Copy = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType apfs::m_Copy = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType apfs::m_Backup = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType apfs::m_Backup = FileSystem::cmdSupportCore;
|
||||||
|
|
||||||
apfs::apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
apfs::apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Apfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Apfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT apfs : public FileSystem
|
class LIBKPMCORE_EXPORT apfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandSupportType supportMove() const override {
|
CommandSupportType supportMove() const override {
|
||||||
|
|
|
@ -23,8 +23,8 @@ FileSystem::CommandSupportType bitlocker::m_Move = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType bitlocker::m_Copy = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType bitlocker::m_Copy = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType bitlocker::m_Backup = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType bitlocker::m_Backup = FileSystem::cmdSupportCore;
|
||||||
|
|
||||||
bitlocker::bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
bitlocker::bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::BitLocker)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::BitLocker)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT bitlocker : public FileSystem
|
class LIBKPMCORE_EXPORT bitlocker : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandSupportType supportMove() const override {
|
CommandSupportType supportMove() const override {
|
||||||
|
|
|
@ -43,8 +43,8 @@ FileSystem::CommandSupportType btrfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType btrfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType btrfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType btrfs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType btrfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
btrfs::btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
btrfs::btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Btrfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Btrfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,22 @@ void btrfs::init()
|
||||||
m_GetLabel = cmdSupportCore;
|
m_GetLabel = cmdSupportCore;
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
|
|
||||||
|
if (m_Create == cmdSupportFileSystem) {
|
||||||
|
ExternalCommand cmd(QStringLiteral("mkfs.btrfs"), QStringList() << QStringLiteral("-O") << QStringLiteral("list-all"));
|
||||||
|
if (cmd.run(-1) && cmd.exitCode() == 0) {
|
||||||
|
QStringList lines = cmd.output().split(QStringLiteral("\n"));
|
||||||
|
|
||||||
|
// First line is introductory text, we don't need it
|
||||||
|
lines.removeFirst();
|
||||||
|
|
||||||
|
for (const auto& l: lines) {
|
||||||
|
if (!l.isEmpty())
|
||||||
|
addAvailableFeature(l.split(QStringLiteral(" ")).first());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool btrfs::supportToolFound() const
|
bool btrfs::supportToolFound() const
|
||||||
|
@ -86,7 +102,7 @@ bool btrfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool btrfs::supportToolName() const
|
FileSystem::SupportTool btrfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("btrfs-tools"), QUrl(QStringLiteral("http://btrfs.wiki.kernel.org/")));
|
return SupportTool(QStringLiteral("btrfs-tools"), QUrl(QStringLiteral("https://btrfs.wiki.kernel.org/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 btrfs::minCapacity() const
|
qint64 btrfs::minCapacity() const
|
||||||
|
@ -128,7 +144,26 @@ bool btrfs::check(Report& report, const QString& deviceNode) const
|
||||||
|
|
||||||
bool btrfs::create(Report& report, const QString& deviceNode)
|
bool btrfs::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.btrfs"), { QStringLiteral("--force"), deviceNode });
|
QStringList args = QStringList();
|
||||||
|
|
||||||
|
if (!this->features().isEmpty()) {
|
||||||
|
QStringList feature_list = QStringList();
|
||||||
|
for (const auto& k : this->features().keys()) {
|
||||||
|
const auto& v = this->features().value(k);
|
||||||
|
if (v.type() == QVariant::Type::Bool) {
|
||||||
|
if (v.toBool())
|
||||||
|
feature_list << k;
|
||||||
|
else
|
||||||
|
feature_list << (QStringLiteral("^") + k);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args << QStringLiteral("--features") << feature_list.join(QStringLiteral(","));
|
||||||
|
}
|
||||||
|
args << QStringLiteral("--force") << deviceNode;
|
||||||
|
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("mkfs.btrfs"), args);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT btrfs : public FileSystem
|
class LIBKPMCORE_EXPORT btrfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
@ -61,6 +61,9 @@ public:
|
||||||
CommandSupportType supportCreate() const override {
|
CommandSupportType supportCreate() const override {
|
||||||
return m_Create;
|
return m_Create;
|
||||||
}
|
}
|
||||||
|
CommandSupportType supportCreateWithFeatures() const override {
|
||||||
|
return m_Create;
|
||||||
|
}
|
||||||
CommandSupportType supportGrow() const override {
|
CommandSupportType supportGrow() const override {
|
||||||
return m_Grow;
|
return m_Grow;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,8 @@ FileSystem::CommandSupportType exfat::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType exfat::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType exfat::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType exfat::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType exfat::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
exfat::exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
exfat::exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Exfat)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Exfat)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ bool exfat::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool exfat::supportToolName() const
|
FileSystem::SupportTool exfat::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("exfat-utils"), QUrl(QStringLiteral("http://code.google.com/p/exfat/")));
|
return SupportTool(QStringLiteral("exfat-utils"), QUrl(QStringLiteral("https://github.com/relan/exfat")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 exfat::maxCapacity() const
|
qint64 exfat::maxCapacity() const
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT exfat : public FileSystem
|
class LIBKPMCORE_EXPORT exfat : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType ext2::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ext2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ext2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ext2::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ext2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
ext2::ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t) :
|
ext2::ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type t) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, t)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,37 @@ void ext2::init()
|
||||||
m_Move = (m_Check != cmdSupportNone) ? cmdSupportCore : cmdSupportNone;
|
m_Move = (m_Check != cmdSupportNone) ? cmdSupportCore : cmdSupportNone;
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
|
|
||||||
|
if (m_Create == cmdSupportFileSystem) {
|
||||||
|
addAvailableFeature(QStringLiteral("64bit"));
|
||||||
|
addAvailableFeature(QStringLiteral("bigalloc"));
|
||||||
|
addAvailableFeature(QStringLiteral("casefold"));
|
||||||
|
addAvailableFeature(QStringLiteral("dir_index"));
|
||||||
|
addAvailableFeature(QStringLiteral("dir_nlink"));
|
||||||
|
addAvailableFeature(QStringLiteral("ea_inode"));
|
||||||
|
addAvailableFeature(QStringLiteral("encrypt"));
|
||||||
|
addAvailableFeature(QStringLiteral("ext_attr"));
|
||||||
|
addAvailableFeature(QStringLiteral("extent"));
|
||||||
|
addAvailableFeature(QStringLiteral("extra_isize"));
|
||||||
|
addAvailableFeature(QStringLiteral("filetype"));
|
||||||
|
addAvailableFeature(QStringLiteral("flex_bg"));
|
||||||
|
addAvailableFeature(QStringLiteral("has_journal"));
|
||||||
|
addAvailableFeature(QStringLiteral("huge_file"));
|
||||||
|
addAvailableFeature(QStringLiteral("inline_data"));
|
||||||
|
addAvailableFeature(QStringLiteral("journal_dev"));
|
||||||
|
addAvailableFeature(QStringLiteral("large_dir"));
|
||||||
|
addAvailableFeature(QStringLiteral("large_file"));
|
||||||
|
addAvailableFeature(QStringLiteral("metadata_csum"));
|
||||||
|
addAvailableFeature(QStringLiteral("metadata_csum_seed"));
|
||||||
|
addAvailableFeature(QStringLiteral("meta_bg"));
|
||||||
|
addAvailableFeature(QStringLiteral("mmp"));
|
||||||
|
addAvailableFeature(QStringLiteral("project"));
|
||||||
|
addAvailableFeature(QStringLiteral("quota"));
|
||||||
|
addAvailableFeature(QStringLiteral("resize_inode"));
|
||||||
|
addAvailableFeature(QStringLiteral("sparse_super"));
|
||||||
|
addAvailableFeature(QStringLiteral("sparse_super2"));
|
||||||
|
addAvailableFeature(QStringLiteral("uninit_bg"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ext2::supportToolFound() const
|
bool ext2::supportToolFound() const
|
||||||
|
@ -133,7 +164,26 @@ bool ext2::check(Report& report, const QString& deviceNode) const
|
||||||
|
|
||||||
bool ext2::create(Report& report, const QString& deviceNode)
|
bool ext2::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.ext2"), { QStringLiteral("-qF"), deviceNode });
|
QStringList args = QStringList();
|
||||||
|
|
||||||
|
if (!this->features().isEmpty()) {
|
||||||
|
QStringList feature_list = QStringList();
|
||||||
|
for (const auto& k : this->features().keys()) {
|
||||||
|
const auto& v = this->features().value(k);
|
||||||
|
if (v.type() == QVariant::Type::Bool) {
|
||||||
|
if (v.toBool())
|
||||||
|
feature_list << k;
|
||||||
|
else
|
||||||
|
feature_list << (QStringLiteral("^") + k);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-qF") << deviceNode;
|
||||||
|
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("mkfs.ext2"), args);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ext2 : public FileSystem
|
class LIBKPMCORE_EXPORT ext2 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t = FileSystem::Type::Ext2);
|
ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Ext2);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
@ -59,6 +59,9 @@ public:
|
||||||
CommandSupportType supportCreate() const override {
|
CommandSupportType supportCreate() const override {
|
||||||
return m_Create;
|
return m_Create;
|
||||||
}
|
}
|
||||||
|
CommandSupportType supportCreateWithFeatures() const override {
|
||||||
|
return m_Create;
|
||||||
|
}
|
||||||
CommandSupportType supportGrow() const override {
|
CommandSupportType supportGrow() const override {
|
||||||
return m_Grow;
|
return m_Grow;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
ext3::ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
ext3::ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
ext2(firstsector, lastsector, sectorsused, label, FileSystem::Type::Ext3)
|
ext2(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ext3)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,26 @@ qint64 ext3::maxCapacity() const
|
||||||
|
|
||||||
bool ext3::create(Report& report, const QString& deviceNode)
|
bool ext3::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.ext3"), QStringList() << QStringLiteral("-qF") << deviceNode);
|
QStringList args = QStringList();
|
||||||
|
|
||||||
|
if (!this->features().isEmpty()) {
|
||||||
|
QStringList feature_list = QStringList();
|
||||||
|
for (const auto& k : this->features().keys()) {
|
||||||
|
const auto& v = this->features().value(k);
|
||||||
|
if (v.type() == QVariant::Type::Bool) {
|
||||||
|
if (v.toBool())
|
||||||
|
feature_list << k;
|
||||||
|
else
|
||||||
|
feature_list << (QStringLiteral("^") + k);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-qF") << deviceNode;
|
||||||
|
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("mkfs.ext3"), args);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ext3 : public ext2
|
class LIBKPMCORE_EXPORT ext3 : public ext2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool create(Report& report, const QString& deviceNode) override;
|
bool create(Report& report, const QString& deviceNode) override;
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
ext4::ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
ext4::ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
ext2(firstsector, lastsector, sectorsused, label, FileSystem::Type::Ext4)
|
ext2(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ext4)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,26 @@ qint64 ext4::maxCapacity() const
|
||||||
|
|
||||||
bool ext4::create(Report& report, const QString& deviceNode)
|
bool ext4::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.ext4"), QStringList() << QStringLiteral("-qF") << deviceNode);
|
QStringList args = QStringList();
|
||||||
|
|
||||||
|
if (!this->features().isEmpty()) {
|
||||||
|
QStringList feature_list = QStringList();
|
||||||
|
for (const auto& k : this->features().keys()) {
|
||||||
|
const auto& v = this->features().value(k);
|
||||||
|
if (v.type() == QVariant::Type::Bool) {
|
||||||
|
if (v.toBool())
|
||||||
|
feature_list << k;
|
||||||
|
else
|
||||||
|
feature_list << (QStringLiteral("^") + k);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-qF") << deviceNode;
|
||||||
|
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("mkfs.ext4"), args);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ext4 : public ext2
|
class LIBKPMCORE_EXPORT ext4 : public ext2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool create(Report& report, const QString& deviceNode) override;
|
bool create(Report& report, const QString& deviceNode) override;
|
||||||
|
|
|
@ -24,8 +24,8 @@ FileSystem::CommandSupportType extended::m_Grow = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType extended::m_Shrink = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType extended::m_Shrink = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType extended::m_Move = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType extended::m_Move = FileSystem::cmdSupportCore;
|
||||||
|
|
||||||
extended::extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
extended::extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Extended)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Extended)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT extended : public FileSystem
|
class LIBKPMCORE_EXPORT extended : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ FileSystem::CommandSupportType f2fs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType f2fs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType f2fs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
bool f2fs::oldVersion = false; // 1.8.x or older
|
bool f2fs::oldVersion = false; // 1.8.x or older
|
||||||
|
|
||||||
f2fs::f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
f2fs::f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::F2fs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::F2fs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT f2fs : public FileSystem
|
class LIBKPMCORE_EXPORT f2fs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QtMath>
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
|
@ -46,8 +49,8 @@ FileSystem::CommandSupportType fat12::m_Backup = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType fat12::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType fat12::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType fat12::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType fat12::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
fat12::fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t) :
|
fat12::fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type t) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, t)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +64,11 @@ void fat12::init()
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
m_UpdateUUID = cmdSupportCore;
|
m_UpdateUUID = cmdSupportCore;
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
|
|
||||||
|
if (m_Create == cmdSupportFileSystem) {
|
||||||
|
addAvailableFeature(QStringLiteral("sector-size"));
|
||||||
|
addAvailableFeature(QStringLiteral("sectors-per-cluster"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fat12::supportToolFound() const
|
bool fat12::supportToolFound() const
|
||||||
|
@ -151,7 +159,39 @@ bool fat12::check(Report& report, const QString& deviceNode) const
|
||||||
|
|
||||||
bool fat12::create(Report& report, const QString& deviceNode)
|
bool fat12::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.fat"), { QStringLiteral("-F12"), QStringLiteral("-I"), QStringLiteral("-v"), deviceNode });
|
return createWithFatSize(report, deviceNode, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool fat12::createWithFatSize(Report &report, const QString& deviceNode, int fatSize)
|
||||||
|
{
|
||||||
|
QStringList args = QStringList();
|
||||||
|
|
||||||
|
if (fatSize != 12 && fatSize != 16 && fatSize != 32)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (const auto& k : this->features().keys()) {
|
||||||
|
const auto& v = this->features().value(k);
|
||||||
|
if (k == QStringLiteral("sector-size")) {
|
||||||
|
quint32 sectorSize = v.toInt();
|
||||||
|
|
||||||
|
/* sectorSize has to be a power of 2 between 512 and 32768 */
|
||||||
|
if (sectorSize >= 512 && sectorSize <= 32768 && sectorSize == qNextPowerOfTwo(sectorSize - 1))
|
||||||
|
args << QStringLiteral("-S%1").arg(sectorSize);
|
||||||
|
else
|
||||||
|
qWarning() << QStringLiteral("FAT sector size %1 is invalid, using default").arg(sectorSize);
|
||||||
|
} else if (k == QStringLiteral("sectors-per-cluster")) {
|
||||||
|
quint32 sectorsPerCluster = v.toInt();
|
||||||
|
|
||||||
|
/* sectorsPerCluster has to be a power of 2 between 2 and 128 */
|
||||||
|
if (sectorsPerCluster <= 128 && sectorsPerCluster == qNextPowerOfTwo(sectorsPerCluster - 1))
|
||||||
|
args << QStringLiteral("-s%1").arg(sectorsPerCluster);
|
||||||
|
else
|
||||||
|
qWarning() << QStringLiteral("FAT sector size %1 is invalid, using default").arg(sectorsPerCluster);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args << QStringLiteral("-F%1").arg(fatSize) << QStringLiteral("-I") << QStringLiteral("-v") << deviceNode;
|
||||||
|
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("mkfs.fat"), args);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT fat12 : public FileSystem
|
class LIBKPMCORE_EXPORT fat12 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t = FileSystem::Type::Fat12);
|
fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Fat12);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
@ -92,6 +92,9 @@ public:
|
||||||
SupportTool supportToolName() const override;
|
SupportTool supportToolName() const override;
|
||||||
bool supportToolFound() const override;
|
bool supportToolFound() const override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool createWithFatSize(Report &report, const QString& deviceNode, int fatSize);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CommandSupportType m_GetUsed;
|
static CommandSupportType m_GetUsed;
|
||||||
static CommandSupportType m_GetLabel;
|
static CommandSupportType m_GetLabel;
|
||||||
|
|
|
@ -31,13 +31,8 @@
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
fat16::fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
fat16::fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type) :
|
||||||
fat12(firstsector, lastsector, sectorsused, label, FileSystem::Type::Fat16)
|
fat12(firstsector, lastsector, sectorsused, label, features, type)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
fat16::fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type type) :
|
|
||||||
fat12(firstsector, lastsector, sectorsused, label, type)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +48,11 @@ void fat16::init()
|
||||||
m_Grow = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
m_Grow = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||||
m_Shrink = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
m_Shrink = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
|
|
||||||
|
if (m_Create == cmdSupportFileSystem) {
|
||||||
|
addAvailableFeature(QStringLiteral("sector-size"));
|
||||||
|
addAvailableFeature(QStringLiteral("sectors-per-cluster"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fat16::supportToolFound() const
|
bool fat16::supportToolFound() const
|
||||||
|
@ -84,8 +84,7 @@ qint64 fat16::maxCapacity() const
|
||||||
|
|
||||||
bool fat16::create(Report& report, const QString& deviceNode)
|
bool fat16::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.fat"), { QStringLiteral("-F16"), QStringLiteral("-I"), QStringLiteral("-v"), deviceNode });
|
return createWithFatSize(report, deviceNode, 16);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const
|
bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const
|
||||||
|
|
|
@ -33,8 +33,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT fat16 : public fat12
|
class LIBKPMCORE_EXPORT fat16 : public fat12
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type type = FileSystem::Type::Fat16);
|
||||||
fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type type);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
|
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
fat32::fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
fat32::fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
fat16(firstsector, lastsector, sectorsused, label, FileSystem::Type::Fat32)
|
fat16(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Fat32)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +43,7 @@ qint64 fat32::maxCapacity() const
|
||||||
|
|
||||||
bool fat32::create(Report& report, const QString& deviceNode)
|
bool fat32::create(Report& report, const QString& deviceNode)
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(report, QStringLiteral("mkfs.fat"), { QStringLiteral("-F32"), QStringLiteral("-I"), QStringLiteral("-v"), deviceNode });
|
return createWithFatSize(report, deviceNode, 32);
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fat32::updateUUID(Report& report, const QString& deviceNode) const
|
bool fat32::updateUUID(Report& report, const QString& deviceNode) const
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT fat32 : public fat16
|
class LIBKPMCORE_EXPORT fat32 : public fat16
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool create(Report& report, const QString& deviceNode) override;
|
bool create(Report& report, const QString& deviceNode) override;
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "fs/filesystem.h"
|
||||||
#include "core/fstab.h"
|
#include "core/fstab.h"
|
||||||
#include "core/raid/softwareraid.h"
|
#include "core/raid/softwareraid.h"
|
||||||
|
|
||||||
#include "fs/filesystem.h"
|
|
||||||
#include "fs/lvm2_pv.h"
|
#include "fs/lvm2_pv.h"
|
||||||
|
|
||||||
#include "backend/corebackend.h"
|
#include "backend/corebackend.h"
|
||||||
|
@ -85,6 +85,8 @@ struct FileSystemPrivate {
|
||||||
qint64 m_SectorsUsed;
|
qint64 m_SectorsUsed;
|
||||||
QString m_Label;
|
QString m_Label;
|
||||||
QString m_UUID;
|
QString m_UUID;
|
||||||
|
QStringList m_AvailableFeatures;
|
||||||
|
QVariantMap m_Features;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Creates a new FileSystem object
|
/** Creates a new FileSystem object
|
||||||
|
@ -105,6 +107,26 @@ FileSystem::FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused
|
||||||
d->m_UUID = QString();
|
d->m_UUID = QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Creates a new FileSystem object
|
||||||
|
@param firstsector the first sector used by this FileSystem on the Device
|
||||||
|
@param lastsector the last sector used by this FileSystem on the Device
|
||||||
|
@param sectorsused the number of sectors in use on the FileSystem
|
||||||
|
@param label the FileSystem label
|
||||||
|
@param features the FileSystem features
|
||||||
|
@param type the FileSystem type
|
||||||
|
*/
|
||||||
|
FileSystem::FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type) :
|
||||||
|
d(std::make_unique<FileSystemPrivate>())
|
||||||
|
{
|
||||||
|
d->m_Type = type;
|
||||||
|
d->m_FirstSector = firstsector;
|
||||||
|
d->m_LastSector = lastsector;
|
||||||
|
d->m_SectorsUsed = sectorsused;
|
||||||
|
d->m_Label = label;
|
||||||
|
d->m_Features = features;
|
||||||
|
d->m_UUID = QString();
|
||||||
|
}
|
||||||
|
|
||||||
FileSystem::~FileSystem()
|
FileSystem::~FileSystem()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -155,7 +177,7 @@ bool FileSystem::detectMountStatus(FileSystem* fs, const QString& partitionPath)
|
||||||
bool mounted = false;
|
bool mounted = false;
|
||||||
|
|
||||||
if (fs->type() == FileSystem::Type::Lvm2_PV) {
|
if (fs->type() == FileSystem::Type::Lvm2_PV) {
|
||||||
mounted = FS::lvm2_pv::getVGName(partitionPath) != QString();
|
mounted = !FS::lvm2_pv::getVGName(partitionPath).isEmpty();
|
||||||
} else {
|
} else {
|
||||||
mounted = isMounted(partitionPath);
|
mounted = isMounted(partitionPath);
|
||||||
}
|
}
|
||||||
|
@ -585,6 +607,23 @@ bool FileSystem::findExternal(const QString& cmdName, const QStringList& args, i
|
||||||
return cmd.exitCode() == 0 || cmd.exitCode() == expectedCode;
|
return cmd.exitCode() == 0 || cmd.exitCode() == expectedCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileSystem::addAvailableFeature(const QString& name)
|
||||||
|
{
|
||||||
|
d->m_AvailableFeatures.append(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileSystem::addFeature(const QString& name, const QVariant& value)
|
||||||
|
{
|
||||||
|
d->m_Features.insert(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileSystem::addFeatures(const QVariantMap& features)
|
||||||
|
{
|
||||||
|
for (const auto& k : features.keys()) {
|
||||||
|
d->m_Features.insert(k, features.value(k));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool FileSystem::supportToolFound() const
|
bool FileSystem::supportToolFound() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -610,6 +649,16 @@ const QString& FileSystem::label() const
|
||||||
return d->m_Label;
|
return d->m_Label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QStringList& FileSystem::availableFeatures() const
|
||||||
|
{
|
||||||
|
return d->m_AvailableFeatures;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QVariantMap& FileSystem::features() const
|
||||||
|
{
|
||||||
|
return d->m_Features;
|
||||||
|
}
|
||||||
|
|
||||||
qint64 FileSystem::sectorSize() const
|
qint64 FileSystem::sectorSize() const
|
||||||
{
|
{
|
||||||
return d->m_SectorSize;
|
return d->m_SectorSize;
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
#ifndef KPMCORE_FILESYSTEM_H
|
#ifndef KPMCORE_FILESYSTEM_H
|
||||||
#define KPMCORE_FILESYSTEM_H
|
#define KPMCORE_FILESYSTEM_H
|
||||||
|
|
||||||
|
|
||||||
#include "util/libpartitionmanagerexport.h"
|
#include "util/libpartitionmanagerexport.h"
|
||||||
|
|
||||||
|
#include <QVariant>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -113,6 +115,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type type);
|
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type type);
|
||||||
|
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~FileSystem();
|
virtual ~FileSystem();
|
||||||
|
@ -149,6 +152,9 @@ public:
|
||||||
virtual CommandSupportType supportCreateWithLabel() const {
|
virtual CommandSupportType supportCreateWithLabel() const {
|
||||||
return cmdSupportNone; /**< @return CommandSupportType for creating */
|
return cmdSupportNone; /**< @return CommandSupportType for creating */
|
||||||
}
|
}
|
||||||
|
virtual CommandSupportType supportCreateWithFeatures() const {
|
||||||
|
return cmdSupportNone; /**< @return CommandSupportType for creating */
|
||||||
|
}
|
||||||
virtual CommandSupportType supportGrow() const {
|
virtual CommandSupportType supportGrow() const {
|
||||||
return cmdSupportNone; /**< @return CommandSupportType for growing */
|
return cmdSupportNone; /**< @return CommandSupportType for growing */
|
||||||
}
|
}
|
||||||
|
@ -263,6 +269,19 @@ public:
|
||||||
/**< @return the FileSystem's label */
|
/**< @return the FileSystem's label */
|
||||||
const QString& label() const;
|
const QString& label() const;
|
||||||
|
|
||||||
|
/**< @return the FileSystem's available features */
|
||||||
|
const QStringList& availableFeatures() const;
|
||||||
|
|
||||||
|
/**< @return the FileSystem's features */
|
||||||
|
const QVariantMap& features() const;
|
||||||
|
|
||||||
|
/**< @param the feature's name to add to the FileSystem */
|
||||||
|
/**< @param the feature's value to add to the FileSystem */
|
||||||
|
void addFeature(const QString& name, const QVariant& value);
|
||||||
|
|
||||||
|
/**< @param features the list of features to add to the FileSystem */
|
||||||
|
void addFeatures(const QVariantMap& features);
|
||||||
|
|
||||||
/**< @return the sector size in the underlying Device */
|
/**< @return the sector size in the underlying Device */
|
||||||
qint64 sectorSize() const;
|
qint64 sectorSize() const;
|
||||||
|
|
||||||
|
@ -286,6 +305,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool findExternal(const QString& cmdName, const QStringList& args = QStringList(), int exptectedCode = 1);
|
static bool findExternal(const QString& cmdName, const QStringList& args = QStringList(), int exptectedCode = 1);
|
||||||
|
void addAvailableFeature(const QString& name);
|
||||||
|
|
||||||
std::unique_ptr<FileSystemPrivate> d;
|
std::unique_ptr<FileSystemPrivate> d;
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,46 +62,48 @@ FileSystemFactory::FileSystems FileSystemFactory::m_FileSystems;
|
||||||
/** Initializes the instance. */
|
/** Initializes the instance. */
|
||||||
void FileSystemFactory::init()
|
void FileSystemFactory::init()
|
||||||
{
|
{
|
||||||
|
FileSystems fileSystems;
|
||||||
|
fileSystems.insert(FileSystem::Type::Apfs, new FS::apfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::BitLocker, new FS::bitlocker(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Btrfs, new FS::btrfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Exfat, new FS::exfat(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ext2, new FS::ext2(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ext3, new FS::ext3(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ext4, new FS::ext4(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Extended, new FS::extended(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::F2fs, new FS::f2fs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Fat12, new FS::fat12(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Fat16, new FS::fat16(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Fat32, new FS::fat32(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Hfs, new FS::hfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::HfsPlus, new FS::hfsplus(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Hpfs, new FS::hpfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Iso9660, new FS::iso9660(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Jfs, new FS::jfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::LinuxRaidMember, new FS::linuxraidmember(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::LinuxSwap, new FS::linuxswap(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Luks, new FS::luks(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Luks2, new FS::luks2(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Lvm2_PV, new FS::lvm2_pv(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Minix, new FS::minix(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Nilfs2, new FS::nilfs2(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ntfs, new FS::ntfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ocfs2, new FS::ocfs2(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::ReiserFS, new FS::reiserfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Reiser4, new FS::reiser4(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Udf, new FS::udf(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Ufs, new FS::ufs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Unformatted, new FS::unformatted(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Unknown, new FS::unknown(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Xfs, new FS::xfs(-1, -1, -1, QString()));
|
||||||
|
fileSystems.insert(FileSystem::Type::Zfs, new FS::zfs(-1, -1, -1, QString()));
|
||||||
|
|
||||||
|
for (const auto &fs : qAsConst(fileSystems))
|
||||||
|
fs->init();
|
||||||
|
|
||||||
qDeleteAll(m_FileSystems);
|
qDeleteAll(m_FileSystems);
|
||||||
m_FileSystems.clear();
|
m_FileSystems.clear();
|
||||||
|
m_FileSystems = fileSystems;
|
||||||
m_FileSystems.insert(FileSystem::Type::Apfs, new FS::apfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::BitLocker, new FS::bitlocker(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Btrfs, new FS::btrfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Exfat, new FS::exfat(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ext2, new FS::ext2(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ext3, new FS::ext3(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ext4, new FS::ext4(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Extended, new FS::extended(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::F2fs, new FS::f2fs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Fat12, new FS::fat12(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Fat16, new FS::fat16(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Fat32, new FS::fat32(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Hfs, new FS::hfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::HfsPlus, new FS::hfsplus(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Hpfs, new FS::hpfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Iso9660, new FS::iso9660(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Jfs, new FS::jfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::LinuxRaidMember, new FS::linuxraidmember(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::LinuxSwap, new FS::linuxswap(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Luks, new FS::luks(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Luks2, new FS::luks2(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Lvm2_PV, new FS::lvm2_pv(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Minix, new FS::minix(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Nilfs2, new FS::nilfs2(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ntfs, new FS::ntfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ocfs2, new FS::ocfs2(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::ReiserFS, new FS::reiserfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Reiser4, new FS::reiser4(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Udf, new FS::udf(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Ufs, new FS::ufs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Unformatted, new FS::unformatted(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Unknown, new FS::unknown(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Xfs, new FS::xfs(-1, -1, -1, QString()));
|
|
||||||
m_FileSystems.insert(FileSystem::Type::Zfs, new FS::zfs(-1, -1, -1, QString()));
|
|
||||||
|
|
||||||
for (const auto &fs : FileSystemFactory::map())
|
|
||||||
fs->init();
|
|
||||||
|
|
||||||
CoreBackendManager::self()->backend()->initFSSupport();
|
CoreBackendManager::self()->backend()->initFSSupport();
|
||||||
}
|
}
|
||||||
|
@ -114,45 +116,45 @@ void FileSystemFactory::init()
|
||||||
@param label the FileSystem's label
|
@param label the FileSystem's label
|
||||||
@return pointer to the newly created FileSystem object or nullptr if FileSystem could not be created
|
@return pointer to the newly created FileSystem object or nullptr if FileSystem could not be created
|
||||||
*/
|
*/
|
||||||
FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused, const QString& label, const QString& uuid)
|
FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused, const QString& label, const QVariantMap& features, const QString& uuid)
|
||||||
{
|
{
|
||||||
FileSystem* fs = nullptr;
|
FileSystem* fs = nullptr;
|
||||||
|
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case FileSystem::Type::Apfs: fs = new FS::apfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Apfs: fs = new FS::apfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::BitLocker: fs = new FS::bitlocker (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::BitLocker: fs = new FS::bitlocker (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Btrfs: fs = new FS::btrfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Btrfs: fs = new FS::btrfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Exfat: fs = new FS::exfat (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Exfat: fs = new FS::exfat (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ext2: fs = new FS::ext2 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ext2: fs = new FS::ext2 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ext3: fs = new FS::ext3 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ext3: fs = new FS::ext3 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ext4: fs = new FS::ext4 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ext4: fs = new FS::ext4 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Extended: fs = new FS::extended (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Extended: fs = new FS::extended (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::F2fs: fs = new FS::f2fs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::F2fs: fs = new FS::f2fs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Fat12: fs = new FS::fat12 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Fat12: fs = new FS::fat12 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Fat16: fs = new FS::fat16 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Fat16: fs = new FS::fat16 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Fat32: fs = new FS::fat32 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Fat32: fs = new FS::fat32 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Hfs: fs = new FS::hfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Hfs: fs = new FS::hfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::HfsPlus: fs = new FS::hfsplus (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::HfsPlus: fs = new FS::hfsplus (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Hpfs: fs = new FS::hpfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Hpfs: fs = new FS::hpfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Iso9660: fs = new FS::iso9660 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Iso9660: fs = new FS::iso9660 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Jfs: fs = new FS::jfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Jfs: fs = new FS::jfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::LinuxRaidMember: fs = new FS::linuxraidmember(firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::LinuxRaidMember: fs = new FS::linuxraidmember(firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::LinuxSwap: fs = new FS::linuxswap (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::LinuxSwap: fs = new FS::linuxswap (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Luks: fs = new FS::luks (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Luks: fs = new FS::luks (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Luks2: fs = new FS::luks2 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Luks2: fs = new FS::luks2 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Lvm2_PV: fs = new FS::lvm2_pv (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Lvm2_PV: fs = new FS::lvm2_pv (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Minix: fs = new FS::minix (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Minix: fs = new FS::minix (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Nilfs2: fs = new FS::nilfs2 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Nilfs2: fs = new FS::nilfs2 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ntfs: fs = new FS::ntfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ntfs: fs = new FS::ntfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ocfs2: fs = new FS::ocfs2 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ocfs2: fs = new FS::ocfs2 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::ReiserFS: fs = new FS::reiserfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::ReiserFS: fs = new FS::reiserfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Reiser4: fs = new FS::reiser4 (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Reiser4: fs = new FS::reiser4 (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Udf: fs = new FS::udf (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Udf: fs = new FS::udf (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Ufs: fs = new FS::ufs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Ufs: fs = new FS::ufs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Unformatted: fs = new FS::unformatted (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Unformatted: fs = new FS::unformatted (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Unknown: fs = new FS::unknown (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Unknown: fs = new FS::unknown (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Xfs: fs = new FS::xfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Xfs: fs = new FS::xfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
case FileSystem::Type::Zfs: fs = new FS::zfs (firstsector, lastsector, sectorsused, label); break;
|
case FileSystem::Type::Zfs: fs = new FS::zfs (firstsector, lastsector, sectorsused, label, features); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +171,7 @@ FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qi
|
||||||
*/
|
*/
|
||||||
FileSystem* FileSystemFactory::create(const FileSystem& other)
|
FileSystem* FileSystemFactory::create(const FileSystem& other)
|
||||||
{
|
{
|
||||||
return create(other.type(), other.firstSector(), other.lastSector(), other.sectorSize(), other.sectorsUsed(), other.label(), other.uuid());
|
return create(other.type(), other.firstSector(), other.lastSector(), other.sectorSize(), other.sectorsUsed(), other.label(), other.features(), other.uuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the map of FileSystems */
|
/** @return the map of FileSystems */
|
||||||
|
@ -185,5 +187,5 @@ const FileSystemFactory::FileSystems& FileSystemFactory::map()
|
||||||
*/
|
*/
|
||||||
FileSystem* FileSystemFactory::cloneWithNewType(FileSystem::Type newType, const FileSystem& other)
|
FileSystem* FileSystemFactory::cloneWithNewType(FileSystem::Type newType, const FileSystem& other)
|
||||||
{
|
{
|
||||||
return create(newType, other.firstSector(), other.lastSector(), other.sectorSize(), other.sectorsUsed(), other.label());
|
return create(newType, other.firstSector(), other.lastSector(), other.sectorSize(), other.sectorsUsed(), other.label(), other.features());
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
static FileSystem* create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused = -1, const QString& label = QString(), const QString& uuid = QString());
|
static FileSystem* create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused = -1, const QString& label = QString(), const QVariantMap& features = {}, const QString& uuid = QString());
|
||||||
static FileSystem* create(const FileSystem& other);
|
static FileSystem* create(const FileSystem& other);
|
||||||
static FileSystem* cloneWithNewType(FileSystem::Type newType, const FileSystem& other);
|
static FileSystem* cloneWithNewType(FileSystem::Type newType, const FileSystem& other);
|
||||||
static const FileSystems& map();
|
static const FileSystems& map();
|
||||||
|
|
|
@ -34,8 +34,8 @@ FileSystem::CommandSupportType hfs::m_Check = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hfs::m_Copy = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hfs::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hfs::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hfs::m_Backup = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
hfs::hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
hfs::hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Hfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Hfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ bool hfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool hfs::supportToolName() const
|
FileSystem::SupportTool hfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("hfsutils"), QUrl(QStringLiteral("http://www.mars.org/home/rob/proj/hfs/")));
|
return SupportTool(QStringLiteral("hfsutils"), QUrl(QStringLiteral("https://www.mars.org/home/rob/proj/hfs/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT hfs : public FileSystem
|
class LIBKPMCORE_EXPORT hfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -34,8 +34,8 @@ FileSystem::CommandSupportType hfsplus::m_Create = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hfsplus::m_Copy = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hfsplus::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hfsplus::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hfsplus::m_Backup = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
hfsplus::hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
hfsplus::hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::HfsPlus)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::HfsPlus)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ bool hfsplus::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool hfsplus::supportToolName() const
|
FileSystem::SupportTool hfsplus::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("diskdev_cmds"), QUrl(QStringLiteral("http://opendarwin.org")));
|
return SupportTool(QStringLiteral("diskdev_cmds"), QUrl(QStringLiteral("https://opensource.apple.com/tarballs/diskdev_cmds/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 hfsplus::maxCapacity() const
|
qint64 hfsplus::maxCapacity() const
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT hfsplus : public FileSystem
|
class LIBKPMCORE_EXPORT hfsplus : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -36,8 +36,8 @@ FileSystem::CommandSupportType hpfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hpfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hpfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType hpfs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType hpfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
hpfs::hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
hpfs::hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Hpfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Hpfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT hpfs : public FileSystem
|
class LIBKPMCORE_EXPORT hpfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandSupportType supportGetUsed() const override {
|
CommandSupportType supportGetUsed() const override {
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
|
|
||||||
iso9660::iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
iso9660::iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Iso9660)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Iso9660)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT iso9660 : public FileSystem
|
class LIBKPMCORE_EXPORT iso9660 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType jfs::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType jfs::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType jfs::m_Backup = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType jfs::m_SetLabel = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType jfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
jfs::jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
jfs::jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Jfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Jfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT jfs : public FileSystem
|
class LIBKPMCORE_EXPORT jfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
|
|
||||||
linuxraidmember::linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
linuxraidmember::linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::LinuxRaidMember)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::LinuxRaidMember)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT linuxraidmember : public FileSystem
|
class LIBKPMCORE_EXPORT linuxraidmember : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType linuxswap::m_SetLabel = FileSystem::cmdSupportNon
|
||||||
FileSystem::CommandSupportType linuxswap::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType linuxswap::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType linuxswap::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType linuxswap::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
linuxswap::linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
linuxswap::linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::LinuxSwap)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::LinuxSwap)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ bool linuxswap::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool linuxswap::supportToolName() const
|
FileSystem::SupportTool linuxswap::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("util-linux"), QUrl(QStringLiteral("http://www.kernel.org/pub/linux/utils/util-linux-ng/")));
|
return SupportTool(QStringLiteral("util-linux"), QUrl(QStringLiteral("https://github.com/karelzak/util-linux")));
|
||||||
}
|
}
|
||||||
|
|
||||||
int linuxswap::maxLabelLength() const
|
int linuxswap::maxLabelLength() const
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT linuxswap : public FileSystem
|
class LIBKPMCORE_EXPORT linuxswap : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -63,8 +63,9 @@ luks::luks(qint64 firstsector,
|
||||||
qint64 lastsector,
|
qint64 lastsector,
|
||||||
qint64 sectorsused,
|
qint64 sectorsused,
|
||||||
const QString& label,
|
const QString& label,
|
||||||
|
const QVariantMap& features,
|
||||||
FileSystem::Type t)
|
FileSystem::Type t)
|
||||||
: FileSystem(firstsector, lastsector, sectorsused, label, t)
|
: FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||||
, m_innerFs(nullptr)
|
, m_innerFs(nullptr)
|
||||||
, m_isCryptOpen(false)
|
, m_isCryptOpen(false)
|
||||||
, m_cryptsetupFound(m_Create != cmdSupportNone)
|
, m_cryptsetupFound(m_Create != cmdSupportNone)
|
||||||
|
@ -492,18 +493,20 @@ bool luks::resize(Report& report, const QString& deviceNode, qint64 newLength) c
|
||||||
if (mapperName().isEmpty())
|
if (mapperName().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( newLength - length() * sectorSize() > 0 )
|
const qint64 sizeDiff = newLength - length() * sectorSize();
|
||||||
|
const qint64 newPayloadSize = m_PayloadSize + sizeDiff;
|
||||||
|
if ( sizeDiff > 0 ) // grow
|
||||||
{
|
{
|
||||||
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"), { QStringLiteral("resize"), mapperName() });
|
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"), { QStringLiteral("resize"), mapperName() });
|
||||||
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
||||||
|
|
||||||
if (cryptResizeCmd.run(-1) && cryptResizeCmd.exitCode() == 0)
|
if (cryptResizeCmd.run(-1) && cryptResizeCmd.exitCode() == 0)
|
||||||
return m_innerFs->resize(report, mapperName(), m_PayloadSize);
|
return m_innerFs->resize(report, mapperName(), newPayloadSize);
|
||||||
}
|
}
|
||||||
else if (m_innerFs->resize(report, mapperName(), m_PayloadSize))
|
else if (m_innerFs->resize(report, mapperName(), newPayloadSize)) // shrink
|
||||||
{
|
{
|
||||||
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"),
|
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"),
|
||||||
{ QStringLiteral("--size"), QString::number(m_PayloadSize / 512), // LUKS1 payload length is specified in multiples of 512 bytes
|
{ QStringLiteral("--size"), QString::number(newPayloadSize / 512), // LUKS1 payload length is specified in multiples of 512 bytes
|
||||||
QStringLiteral("resize"), mapperName() });
|
QStringLiteral("resize"), mapperName() });
|
||||||
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
||||||
if (cryptResizeCmd.run(-1) && cryptResizeCmd.exitCode() == 0)
|
if (cryptResizeCmd.run(-1) && cryptResizeCmd.exitCode() == 0)
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT luks : public FileSystem
|
class LIBKPMCORE_EXPORT luks : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
luks(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type t = FileSystem::Type::Luks);
|
luks(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Luks);
|
||||||
~luks() override;
|
~luks() override;
|
||||||
|
|
||||||
enum class KeyLocation {
|
enum class KeyLocation {
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
namespace FS
|
namespace FS
|
||||||
{
|
{
|
||||||
|
|
||||||
luks2::luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label)
|
luks2::luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features)
|
||||||
: luks(firstsector, lastsector, sectorsused, label, FileSystem::Type::Luks2)
|
: luks(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Luks2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,9 @@ bool luks2::resize(Report& report, const QString& deviceNode, qint64 newLength)
|
||||||
if (mapperName().isEmpty())
|
if (mapperName().isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( newLength - length() * sectorSize() > 0 )
|
const qint64 sizeDiff = newLength - length() * sectorSize();
|
||||||
|
const qint64 newPayloadSize = m_PayloadSize + sizeDiff;
|
||||||
|
if ( sizeDiff > 0 ) // grow
|
||||||
{
|
{
|
||||||
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"), { QStringLiteral("resize"), mapperName() });
|
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"), { QStringLiteral("resize"), mapperName() });
|
||||||
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
||||||
|
@ -102,12 +104,12 @@ bool luks2::resize(Report& report, const QString& deviceNode, qint64 newLength)
|
||||||
if (!cryptResizeCmd.start(-1))
|
if (!cryptResizeCmd.start(-1))
|
||||||
return false;
|
return false;
|
||||||
if ( cryptResizeCmd.exitCode() == 0 )
|
if ( cryptResizeCmd.exitCode() == 0 )
|
||||||
return m_innerFs->resize(report, mapperName(), m_PayloadSize);
|
return m_innerFs->resize(report, mapperName(), newPayloadSize);
|
||||||
}
|
}
|
||||||
else if (m_innerFs->resize(report, mapperName(), m_PayloadSize))
|
else if (m_innerFs->resize(report, mapperName(), newPayloadSize))
|
||||||
{
|
{
|
||||||
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"),
|
ExternalCommand cryptResizeCmd(report, QStringLiteral("cryptsetup"),
|
||||||
{ QStringLiteral("--size"), QString::number(m_PayloadSize / 512), // FIXME, LUKS2 can have different sector sizes
|
{ QStringLiteral("--size"), QString::number(newPayloadSize / 512), // FIXME, LUKS2 can have different sector sizes
|
||||||
QStringLiteral("resize"), mapperName() });
|
QStringLiteral("resize"), mapperName() });
|
||||||
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
report.line() << xi18nc("@info:progress", "Resizing LUKS crypt on partition <filename>%1</filename>.", deviceNode);
|
||||||
if (m_KeyLocation == KeyLocation::keyring) {
|
if (m_KeyLocation == KeyLocation::keyring) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT luks2 : public luks
|
class LIBKPMCORE_EXPORT luks2 : public luks
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
~luks2() override;
|
~luks2() override;
|
||||||
|
|
||||||
bool create(Report& report, const QString& deviceNode) override;
|
bool create(Report& report, const QString& deviceNode) override;
|
||||||
|
|
|
@ -42,8 +42,8 @@ FileSystem::CommandSupportType lvm2_pv::m_UpdateUUID = FileSystem::cmdSupportNon
|
||||||
FileSystem::CommandSupportType lvm2_pv::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType lvm2_pv::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
lvm2_pv::lvm2_pv(qint64 firstsector, qint64 lastsector,
|
lvm2_pv::lvm2_pv(qint64 firstsector, qint64 lastsector,
|
||||||
qint64 sectorsused, const QString& label)
|
qint64 sectorsused, const QString& label, const QVariantMap& features)
|
||||||
: FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Lvm2_PV)
|
: FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Lvm2_PV)
|
||||||
, m_PESize(0)
|
, m_PESize(0)
|
||||||
, m_TotalPE(0)
|
, m_TotalPE(0)
|
||||||
, m_AllocatedPE(0)
|
, m_AllocatedPE(0)
|
||||||
|
@ -94,7 +94,7 @@ bool lvm2_pv::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool lvm2_pv::supportToolName() const
|
FileSystem::SupportTool lvm2_pv::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("lvm2"), QUrl(QStringLiteral("http://sourceware.org/lvm2/")));
|
return SupportTool(QStringLiteral("lvm2"), QUrl(QStringLiteral("https://sourceware.org/lvm2/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 lvm2_pv::maxCapacity() const
|
qint64 lvm2_pv::maxCapacity() const
|
||||||
|
|
|
@ -89,7 +89,7 @@ class LIBKPMCORE_EXPORT lvm2_pv : public FileSystem
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -33,8 +33,8 @@ FileSystem::CommandSupportType minix::m_Create = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType minix::m_Copy = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType minix::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType minix::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType minix::m_Backup = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
minix::minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
minix::minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Minix)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Minix)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT minix : public FileSystem
|
class LIBKPMCORE_EXPORT minix : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
||||||
bool check(Report& report, const QString&deviceNode) const override;
|
bool check(Report& report, const QString&deviceNode) const override;
|
||||||
|
|
|
@ -46,8 +46,8 @@ FileSystem::CommandSupportType nilfs2::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType nilfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType nilfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType nilfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType nilfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
nilfs2::nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
nilfs2::nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Nilfs2)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Nilfs2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ bool nilfs2::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool nilfs2::supportToolName() const
|
FileSystem::SupportTool nilfs2::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("nilfs2-utils"), QUrl(QStringLiteral("http://code.google.com/p/nilfs2/")));
|
return SupportTool(QStringLiteral("nilfs2-utils"), QUrl(QStringLiteral("https://github.com/nilfs-dev/nilfs-utils")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 nilfs2::minCapacity() const
|
qint64 nilfs2::minCapacity() const
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT nilfs2 : public FileSystem
|
class LIBKPMCORE_EXPORT nilfs2 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -48,8 +48,8 @@ FileSystem::CommandSupportType ntfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ntfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ntfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ntfs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ntfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
ntfs::ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
ntfs::ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Ntfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ntfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ bool ntfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool ntfs::supportToolName() const
|
FileSystem::SupportTool ntfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("ntfs-3g"), QUrl(QStringLiteral("http://www.tuxera.com/community/ntfs-3g-download/")));
|
return SupportTool(QStringLiteral("ntfs-3g"), QUrl(QStringLiteral("https://www.tuxera.com/community/open-source-ntfs-3g/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 ntfs::minCapacity() const
|
qint64 ntfs::minCapacity() const
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ntfs : public FileSystem
|
class LIBKPMCORE_EXPORT ntfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType ocfs2::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ocfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ocfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType ocfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType ocfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
ocfs2::ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
ocfs2::ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Ocfs2)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ocfs2)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ bool ocfs2::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool ocfs2::supportToolName() const
|
FileSystem::SupportTool ocfs2::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("ocfs2-tools"), QUrl(QStringLiteral("http://oss.oracle.com/projects/ocfs2-tools/")));
|
return SupportTool(QStringLiteral("ocfs2-tools"), QUrl(QStringLiteral("https://oss.oracle.com/projects/ocfs2-tools/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 ocfs2::minCapacity() const
|
qint64 ocfs2::minCapacity() const
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ocfs2 : public FileSystem
|
class LIBKPMCORE_EXPORT ocfs2 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -34,8 +34,8 @@ FileSystem::CommandSupportType reiser4::m_Check = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType reiser4::m_Copy = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType reiser4::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType reiser4::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType reiser4::m_Backup = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
reiser4::reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
reiser4::reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Reiser4)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Reiser4)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,13 +68,13 @@ bool reiser4::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool reiser4::supportToolName() const
|
FileSystem::SupportTool reiser4::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("reiser4progs"), QUrl(QStringLiteral("http://www.kernel.org/pub/linux/utils/fs/reiser4/reiser4progs/")));
|
return SupportTool(QStringLiteral("reiser4progs"), QUrl(QStringLiteral("https://github.com/edward6/reiser4progs")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 reiser4::maxCapacity() const
|
qint64 reiser4::maxCapacity() const
|
||||||
{
|
{
|
||||||
// looks like it's actually unknown. see
|
// looks like it's actually unknown. see
|
||||||
// http://en.wikipedia.org/wiki/Comparison_of_file_systems
|
// https://en.wikipedia.org/wiki/Comparison_of_file_systems
|
||||||
return Capacity::unitFactor(Capacity::Unit::Byte, Capacity::Unit::EiB);
|
return Capacity::unitFactor(Capacity::Unit::Byte, Capacity::Unit::EiB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT reiser4 : public FileSystem
|
class LIBKPMCORE_EXPORT reiser4 : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -41,8 +41,8 @@ FileSystem::CommandSupportType reiserfs::m_SetLabel = FileSystem::cmdSupportNone
|
||||||
FileSystem::CommandSupportType reiserfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType reiserfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType reiserfs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType reiserfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
reiserfs::reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
reiserfs::reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::ReiserFS)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::ReiserFS)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ bool reiserfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool reiserfs::supportToolName() const
|
FileSystem::SupportTool reiserfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("reiserfsprogs"), QUrl(QStringLiteral("http://www.kernel.org/pub/linux/utils/fs/reiserfs/")));
|
return SupportTool(QStringLiteral("reiserfsprogs"), QUrl(QStringLiteral("https://reiser4.wiki.kernel.org/index.php/Reiserfsprogs")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 reiserfs::minCapacity() const
|
qint64 reiserfs::minCapacity() const
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT reiserfs : public FileSystem
|
class LIBKPMCORE_EXPORT reiserfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType udf::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType udf::m_Create = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType udf::m_Create = FileSystem::cmdSupportNone;
|
||||||
bool udf::oldMkudffsVersion = false;
|
bool udf::oldMkudffsVersion = false;
|
||||||
|
|
||||||
udf::udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
udf::udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Udf)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Udf)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT udf : public FileSystem
|
class LIBKPMCORE_EXPORT udf : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -23,8 +23,8 @@ FileSystem::CommandSupportType ufs::m_Move = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType ufs::m_Copy = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType ufs::m_Copy = FileSystem::cmdSupportCore;
|
||||||
FileSystem::CommandSupportType ufs::m_Backup = FileSystem::cmdSupportCore;
|
FileSystem::CommandSupportType ufs::m_Backup = FileSystem::cmdSupportCore;
|
||||||
|
|
||||||
ufs::ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
ufs::ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Ufs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ufs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT ufs : public FileSystem
|
class LIBKPMCORE_EXPORT ufs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandSupportType supportMove() const override {
|
CommandSupportType supportMove() const override {
|
||||||
|
|
|
@ -21,8 +21,8 @@ namespace FS
|
||||||
{
|
{
|
||||||
FileSystem::CommandSupportType unformatted::m_Create = FileSystem::cmdSupportFileSystem;
|
FileSystem::CommandSupportType unformatted::m_Create = FileSystem::cmdSupportFileSystem;
|
||||||
|
|
||||||
unformatted::unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
unformatted::unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Unformatted)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Unformatted)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT unformatted : public FileSystem
|
class LIBKPMCORE_EXPORT unformatted : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool create(Report&, const QString&) override;
|
bool create(Report&, const QString&) override;
|
||||||
|
|
|
@ -22,8 +22,8 @@ namespace FS
|
||||||
|
|
||||||
FileSystem::CommandSupportType unknown::m_Move = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType unknown::m_Move = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Unknown)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Unknown)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT unknown : public FileSystem
|
class LIBKPMCORE_EXPORT unknown : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool supportToolFound() const override {
|
bool supportToolFound() const override {
|
||||||
|
|
|
@ -41,8 +41,8 @@ FileSystem::CommandSupportType xfs::m_Copy = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType xfs::m_Backup = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType xfs::m_Backup = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType xfs::m_SetLabel = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType xfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
xfs::xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
xfs::xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Xfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Xfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ bool xfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool xfs::supportToolName() const
|
FileSystem::SupportTool xfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("xfsprogs"), QUrl(QStringLiteral("http://oss.sgi.com/projects/xfs/")));
|
return SupportTool(QStringLiteral("xfsprogs"), QUrl(QStringLiteral("https://xfs.org/index.php/Getting_the_latest_source_code")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 xfs::minCapacity() const
|
qint64 xfs::minCapacity() const
|
||||||
|
@ -153,7 +153,7 @@ bool xfs::copy(Report& report, const QString& targetDeviceNode, const QString& s
|
||||||
|
|
||||||
// xfs_copy behaves a little strangely. It apparently kills itself at the end of main, causing QProcess
|
// xfs_copy behaves a little strangely. It apparently kills itself at the end of main, causing QProcess
|
||||||
// to report that it crashed.
|
// to report that it crashed.
|
||||||
// See http://oss.sgi.com/archives/xfs/2004-11/msg00169.html
|
// See https://marc.info/?l=linux-xfs&m=110178337825926&w=2
|
||||||
// So we cannot rely on QProcess::exitStatus() and thus not on ExternalCommand::run() returning true.
|
// So we cannot rely on QProcess::exitStatus() and thus not on ExternalCommand::run() returning true.
|
||||||
|
|
||||||
cmd.run(-1);
|
cmd.run(-1);
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT xfs : public FileSystem
|
class LIBKPMCORE_EXPORT xfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -39,8 +39,8 @@ FileSystem::CommandSupportType zfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType zfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType zfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||||
FileSystem::CommandSupportType zfs::m_GetUUID = FileSystem::cmdSupportNone;
|
FileSystem::CommandSupportType zfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||||
|
|
||||||
zfs::zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label) :
|
zfs::zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||||
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Type::Zfs)
|
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Zfs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ bool zfs::supportToolFound() const
|
||||||
|
|
||||||
FileSystem::SupportTool zfs::supportToolName() const
|
FileSystem::SupportTool zfs::supportToolName() const
|
||||||
{
|
{
|
||||||
return SupportTool(QStringLiteral("zfs"), QUrl(QStringLiteral("http://zfsonlinux.org/")));
|
return SupportTool(QStringLiteral("zfs"), QUrl(QStringLiteral("https://zfsonlinux.org/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 zfs::minCapacity() const
|
qint64 zfs::minCapacity() const
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
||||||
class LIBKPMCORE_EXPORT zfs : public FileSystem
|
class LIBKPMCORE_EXPORT zfs : public FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init() override;
|
void init() override;
|
||||||
|
|
|
@ -278,8 +278,8 @@ bool PartResizerWidget::movePartition(qint64 newFirstSector)
|
||||||
|
|
||||||
updatePositions();
|
updatePositions();
|
||||||
|
|
||||||
emit firstSectorChanged(partition().firstSector());
|
Q_EMIT firstSectorChanged(partition().firstSector());
|
||||||
emit lastSectorChanged(partition().lastSector());
|
Q_EMIT lastSectorChanged(partition().lastSector());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ bool PartResizerWidget::updateFirstSector(qint64 newFirstSector)
|
||||||
|
|
||||||
updatePositions();
|
updatePositions();
|
||||||
|
|
||||||
emit firstSectorChanged(partition().firstSector());
|
Q_EMIT firstSectorChanged(partition().firstSector());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ bool PartResizerWidget::updateLastSector(qint64 newLastSector)
|
||||||
resizeLogicals(0, deltaLast);
|
resizeLogicals(0, deltaLast);
|
||||||
updatePositions();
|
updatePositions();
|
||||||
|
|
||||||
emit lastSectorChanged(partition().lastSector());
|
Q_EMIT lastSectorChanged(partition().lastSector());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LIBKPMCORE_EXPORT PartResizerWidget : public QWidget
|
||||||
Q_DISABLE_COPY(PartResizerWidget)
|
Q_DISABLE_COPY(PartResizerWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PartResizerWidget(QWidget* parent);
|
explicit PartResizerWidget(QWidget* parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init(Device& d, Partition& p, qint64 minFirst, qint64 maxLast, bool read_only = false, bool move_allowed = true);
|
void init(Device& d, Partition& p, qint64 minFirst, qint64 maxLast, bool read_only = false, bool move_allowed = true);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue