├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── LICENSE
├── PKGBUILD
├── README.md
├── sbsustart
├── systemback-bootfiles
└── PKGBUILD
└── systemback
├── LICENSE
├── debian
├── changelog
├── compat
├── control
├── copyright
├── libsystemback.install
├── libsystemback.postrm
├── rules
├── source.lintian-overrides
├── source
│ └── format
├── systemback-cli.1
├── systemback-cli.install
├── systemback-efiboot-amd64.install
├── systemback-locales.install
├── systemback-scheduler.install
├── systemback-scheduler.lintian-overrides
├── systemback-scheduler.postrm
├── systemback-scheduler.preinst
├── systemback-scheduler.prerm
├── systemback.1
├── systemback.install
├── systemback.links
└── systemback.lintian-overrides
├── debuild.sh
├── efi-amd64.bootfiles
├── efi-amd64.bootfiles.old
├── icons
├── 128x128
│ └── systemback.png
├── 256x256
│ └── systemback.png
├── 48x48
│ └── systemback.png
└── 64x64
│ └── systemback.png
├── lang
├── systemback_ar_EG.ts
├── systemback_ca_ES.ts
├── systemback_cs.ts
├── systemback_da_DK.ts
├── systemback_de.ts
├── systemback_en_GB.ts
├── systemback_es.ts
├── systemback_fi.ts
├── systemback_fr.ts
├── systemback_gl_ES.ts
├── systemback_hu.ts
├── systemback_id.ts
├── systemback_pl.ts
├── systemback_pt_BR.ts
├── systemback_ro.ts
├── systemback_ru.ts
├── systemback_tr.ts
├── systemback_uk.ts
├── systemback_vi.ts
└── systemback_zh_CN.ts
├── libsystemback
├── bstr.hpp
├── lcheck.sh
├── libsystemback.pro
├── sblib.cpp
├── sblib.hpp
├── sblib_global.hpp
├── sbtypedef.hpp
├── scripts
│ └── upgrade.sh
├── version
└── version.qrc
├── logo.png
├── org.systemback.sbsustart.policy
├── org.systemback.systemback.desktop
├── pacman
├── hooks
│ └── sbnoxconf
└── install
│ ├── sbfinstall
│ └── sbnoxconf
├── reserved_usernames
├── sbschedule.desktop
├── sbscheduler
├── main.cpp
├── sbscheduler.cpp
├── sbscheduler.hpp
└── sbscheduler.pro
├── sbsustart
├── main.cpp
├── sbsustart.cpp
├── sbsustart.hpp
└── sbsustart.pro
├── sbsysupgrade
├── sbsysupgrade.cpp
└── sbsysupgrade.pro
├── splash.png
├── splash.png.old
├── systemback-cli
├── main.cpp
├── systemback-cli.cpp
├── systemback-cli.hpp
└── systemback-cli.pro
├── systemback.conf
├── systemback.png
├── systemback.pro
└── systemback
├── bttnevent.hpp
├── chckbxevent.hpp
├── lblevent.hpp
├── lndtevent.hpp
├── main.cpp
├── pictures.qrc
├── pictures
├── back.png
├── dialogerror.png
├── dialoginfo.png
├── dialogquestion.png
├── dir.png
├── dirx.png
├── down.png
├── error.png
├── isdir.png
├── leftarrow.png
├── leftgreenarrow.png
├── logo.png
├── menuback.png
├── menunext.png
├── next.png
├── ok.png
├── passwordlogo.png
├── refresh.png
├── resize.png
├── rightarrow.png
├── systemback.png
└── up.png
├── pnlevent.hpp
├── systemback.cpp
├── systemback.hpp
├── systemback.pro
├── systemback.ui
└── tblwdgtevent.hpp
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **Steps to Reproduce**
14 | Steps to reproduce the behavior
15 |
16 | **Expected behavior**
17 | A clear and concise description of what you expected to happen.
18 |
19 | **Screenshots**
20 | If applicable, add screenshots to help explain your problem.
21 |
22 | **OS specs:**
23 | About init system, package list,...
24 |
25 | **Additional context**
26 | Add any other context about the problem here.
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.log
3 | *.deb
4 | *.pkg.tar*
5 | *.build
6 | build-*
7 | *.changes
8 | *.dsc
9 | *.tar.xz
10 | debian/
11 | *.qm
12 | *.so
13 | *.so.*
14 | Makefile
15 | *-stamp
16 | systemback/sbsustart/sbsustart
17 | systemback/sbsysupgrade/sbsysupgrade
18 | systemback/sbscheduler/sbscheduler
19 | moc_*
20 | qrc_*
21 | ui_*
22 | systemback/systemback/systemback
23 | systemback/systemback-cli/systemback-cli
24 | *.ppa.upload
25 | .vscode
26 | *.buildinfo
27 | .qmake.stash
28 | systemback/systemback.pro.user
29 | *.buildinfo
30 | *-working-directory
31 | src
32 | /systemback-*
33 | !/systemback-bootfiles
34 | .qt_for_python
35 | /systemback/*.json
36 | pkg
37 | /libsystemback
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: shadichy
2 | pkgbase=systemback
3 | sb=$pkgbase
4 | pkgname=("lib${sb}" "${sb}-cli" "${sb}")
5 | pkgver=1.8.9
6 | pkgrel=4
7 | pkgdesc='Simple system backup and restore application with extra features'
8 | arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
9 | url='https://github.com/shadichy/systemback-archlinux'
10 | license=('GPL')
11 | depends=('util-linux' 'util-linux-libs' 'parted' 'qt5-base>=5.5.0' 'procps-ng' 'gnu-free-fonts' 'dosfstools' 'squashfs-tools' 'libxcrypt-compat')
12 | optdepends=('btrfs-progs' 'jfsutils' 'reiserfsprogs' 'xfsprogs' 'update-grub')
13 | makedepends=('ncurses' 'qt5-tools' 'make' 'procps-ng' 'libisoburn' 'gcc')
14 | # source=()
15 | # md5sums=('SKIP')
16 |
17 | build() {
18 | cd "../${sb}"
19 | qmake-qt5 $([ "$LLVM" ] && [ "$LLVM" != 0 ] && echo "-spec linux-clang")
20 | make -j$(nproc --all)
21 | lrelease-qt5 systemback.pro
22 | }
23 |
24 | package_libsystemback() {
25 | pkgdesc='Libary for Systemback'
26 |
27 | mkdir -p ${pkgdir}/usr/lib/${sb}
28 | mkdir -p ${pkgdir}/usr/include/lib${sb}
29 | mkdir -p ${pkgdir}/usr/share/${sb}/scripts
30 | mkdir -p ${pkgdir}/usr/share/licenses/${sb}
31 |
32 | cd "../${sb}"
33 |
34 | install -dm755 ${pkgdir}/usr/lib/${sb}
35 | install -dm755 ${pkgdir}/usr/include/lib${sb}
36 | install -dm755 ${pkgdir}/usr/share/${sb}/scripts
37 | install -dm755 ${pkgdir}/usr/share/licenses/${sb}
38 |
39 | install -m755 lib${sb}/lib${sb}.so* ${pkgdir}/usr/lib/${sb}
40 | install -m755 lib${sb}/*.hpp ${pkgdir}/usr/include/lib${sb}
41 | install -m755 lib${sb}/scripts/* ${pkgdir}/usr/share/${sb}/scripts
42 | install -m755 LICENSE ${pkgdir}/usr/share/licenses/${sb}
43 | }
44 | package_systemback-cli() {
45 | depends+=('ncurses' "lib${sb}")
46 |
47 | mkdir -p ${pkgdir}/usr/bin
48 | install -dm755 ${pkgdir}/usr/bin
49 |
50 | cd "../${sb}"
51 |
52 | install -m755 ${sb}-cli/${sb}-cli ${pkgdir}/usr/bin
53 | }
54 | package_systemback() {
55 | depends+=('libx11' 'zenity' "lib${sb}" 'grub' 'mtools' 'arch-install-scripts' 'mkinitcpio-live-boot' 'xz' 'zstd' 'xterm')
56 | optdepends+=('kdialog' 'amd-ucode' 'intel-ucode' 'systemback-efiboot')
57 |
58 | mkdir -p ${pkgdir}/etc/${sb}
59 | mkdir -p ${pkgdir}/etc/xdg/autostart
60 |
61 | mkdir -p ${pkgdir}/usr/bin
62 | mkdir -p ${pkgdir}/usr/lib/${sb}
63 |
64 | mkdir -p ${pkgdir}/usr/share/${sb}/lang
65 | mkdir -p ${pkgdir}/usr/share/polkit-1/actions/
66 | mkdir -p ${pkgdir}/usr/lib/initcpio/hooks
67 | mkdir -p ${pkgdir}/usr/lib/initcpio/install
68 |
69 | appdir=usr/share/applications
70 | mkdir -p ${pkgdir}/$appdir
71 |
72 | icondir=usr/share/icons/hicolor
73 | mkdir -p ${pkgdir}/$icondir/128x128/apps
74 | mkdir -p ${pkgdir}/$icondir/256x256/apps
75 | mkdir -p ${pkgdir}/$icondir/48x48/apps
76 | mkdir -p ${pkgdir}/$icondir/64x64/apps
77 |
78 | cd "../${sb}"
79 |
80 | install -dm664 ${pkgdir}/etc/${sb}
81 | install -dm644 ${pkgdir}/usr/share/${sb}/lang
82 | install -dm755 ${pkgdir}/usr/share/polkit-1/actions/
83 | install -dm755 ${pkgdir}/usr/lib/initcpio/hooks
84 | install -dm755 ${pkgdir}/usr/lib/initcpio/install
85 |
86 | install -dm755 ${pkgdir}/$icondir/128x128/apps
87 | install -dm755 ${pkgdir}/$icondir/256x256/apps
88 | install -dm755 ${pkgdir}/$icondir/48x48/apps
89 | install -dm755 ${pkgdir}/$icondir/64x64/apps
90 |
91 | install -dm755 ${pkgdir}/etc/xdg/autostart
92 | install -dm755 ${pkgdir}/$appdir
93 |
94 | install -dm755 ${pkgdir}/usr/lib/${sb}
95 | install -dm755 ${pkgdir}/usr/bin
96 |
97 | install -m660 ${sb}.conf ${pkgdir}/etc/${sb}
98 | install -m644 lang/*.qm ${pkgdir}/usr/share/${sb}/lang
99 | install -m644 org.${sb}.sbsustart.policy ${pkgdir}/usr/share/polkit-1/actions/
100 | install -m755 pacman/hooks/* ${pkgdir}/usr/lib/initcpio/hooks
101 | install -m755 pacman/install/* ${pkgdir}/usr/lib/initcpio/install
102 |
103 | install -m644 splash.png ${pkgdir}/usr/share/${sb}
104 | install -m644 icons/128x128/${sb}.png ${pkgdir}/$icondir/128x128/apps
105 | install -m644 icons/256x256/${sb}.png ${pkgdir}/$icondir/256x256/apps
106 | install -m644 icons/48x48/${sb}.png ${pkgdir}/$icondir/48x48/apps
107 | install -m644 icons/64x64/${sb}.png ${pkgdir}/$icondir/64x64/apps
108 |
109 | install -m755 sbschedule.desktop ${pkgdir}/etc/xdg/autostart
110 | install -m755 org.${sb}.${sb}.desktop ${pkgdir}/$appdir
111 | ln -s org.${sb}.${sb}.desktop ${pkgdir}/$appdir/${sb}.desktop
112 |
113 | install -m755 sbscheduler/sbscheduler \
114 | sbsustart/sbsustart \
115 | sbsysupgrade/sbsysupgrade \
116 | ${pkgdir}/usr/lib/${sb}
117 |
118 | install -m755 ../sbsustart \
119 | ${sb}/${sb} \
120 | ${pkgdir}/usr/bin
121 | }
122 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Systemback
2 |
3 | 
4 |
5 | This is a fork of [BluewhaleRobot/systemback](https://github.com/BluewhaleRobot/systemback), which is also a fork of the [original project](https://launchpad.net/systemback) (which is no longer maintained by the creator). This is made for [Arch Linux](http://archlinux.org/) and it's derivatives (Arch-based), such as [Manjaro](https://manjaro.org), [Garuda Linux](http://garudalinux.org/), [RebornOS](https://rebornos.org), [CachyOS](https://cachyos.org),... (and not for Debian or Ubuntu)
6 |
7 | 
8 |
9 | Simple system backup and restore application with extra features
10 |
11 | Systemback makes it easy to create backups of the system and the users configuration files. In case of problems you can easily restore the previous state of the system. There are extra features like system copying, system installation and Live system creation.
12 |
13 | ## Install
14 |
15 | ### With AUR helper
16 |
17 | ```bash
18 | pacman-key --recv-key 50B2C005A67B264F --keyserver 'hkp://keyserver.ubuntu.com:80'
19 | yay -S systemback # works with `paru` or any other aur helper
20 | ```
21 |
22 | ### Prebuilt binaries
23 |
24 | * Prebuilt binaries are available at [Yuunix AUR](https://github.com/shadichy/yuunix_aur) for both 32bit and 64bit x86 architecture
25 |
26 | add this to your `/etc/pacman.conf` with npacman or the ATT.
27 |
28 | ```conf
29 | [yuunix_aur]
30 | SigLevel = Optional TrustedOnly
31 | Server = Note:
48 | > for 32-bit users: it's recommended to use prebuilt systemback-efiboot-amd64
49 | > for clang nerds: `export LLVM=1` first
50 |
51 | ```bash
52 | makepkg -si
53 | ```
54 |
55 | #### Or
56 |
57 | ```bash
58 | cd systemback/
59 | dpkg-buildpackage # or debuild (on debian)
60 | cd ../
61 | debtap .deb
62 | ```
63 |
64 | Images of Systemback
65 | 
66 |
67 | ## Note
68 |
69 | > Build successful, installable, but some features may not work
70 |
71 | ## Jobs to to
72 |
73 | Arch support is still WIP:
74 |
75 | * ~~Move `apt` to `pacman`~~ (Done)
76 | * ~~Move `casper` | `live-boot` to `mkinitcpio-live-boot`~~ (Done)
77 | * ~~Move `initramfs-tools` to `mkinitcpio`~~ (Done)
78 | * ~~Add support for `overlayfs`, replacing `unionfs`~~ (Done)
79 | * Fix issues
80 | * Fetch updates from upstream
81 | * request upstream push :)
82 |
83 | ## Changelog
84 |
85 | 1.8.9
86 |
87 | * Fix support for NVMe
88 |
89 | 1.8.8
90 |
91 | * Merge from
92 | * Add support for NVMe
93 |
94 | ## Support me
95 |
96 | [](https://www.buymeacoffee.com/shadichy)
97 |
--------------------------------------------------------------------------------
/sbsustart:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | BASE_CMD="/usr/bin/systemback $@"
4 |
5 | unlock() {
6 | [ -f /var/lib/pacman/db.lck ] && rm /var/lib/pacman/db.lck
7 | [ -f /run/systemback.lock ] && rm /run/systemback.lock
8 | [ -f /run/sbscheduler.lock ] && rm /run/sbscheduler.lock
9 | }
10 |
11 | if [ "$(id -u)" != 0 ]; then
12 | ENABLE_XHOST_ROOT=yes
13 | GRANTED_XHOST_ROOT=no
14 | if [ "$ENABLE_XHOST_ROOT" = yes ] && xhost 1>/dev/null 2>&1 && ! xhost | grep -qi 'SI:localuser:root$'; then
15 | xhost +SI:localuser:root
16 | GRANTED_XHOST_ROOT=yes
17 | fi
18 |
19 | pkexec --disable-internal-agent /usr/bin/env \
20 | DISPLAY="$DISPLAY" \
21 | XDG_SESSION_TYPE="$XDG_SESSION_TYPE" \
22 | DESKTOP_SESSION="$DESKTOP_SESSION" \
23 | "$0" $@
24 | status=$?
25 |
26 | [ "$GRANTED_XHOST_ROOT" = yes ] && xhost -SI:localuser:root
27 |
28 | exit $status
29 | fi
30 |
31 | trap 'unlock' EXIT
32 |
33 | $BASE_CMD
34 |
--------------------------------------------------------------------------------
/systemback-bootfiles/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: shadichy
2 | pkgbase=systemback-efiboot
3 | pkgname=$pkgbase
4 | pkgver=0.0.4
5 | pkgrel=1
6 | pkgdesc='Boot files for Systemback'
7 | arch=('any')
8 | march=""
9 | url='https://github.com/shadichy/systemback-archlinux'
10 | license=('GPL')
11 | depends=('libisoburn' 'syslinux')
12 | optdepends=('cdrtools')
13 | makedepends=('grub' tar 'libarchive')
14 | # source=()
15 | # md5sums=('SKIP')
16 |
17 | build() {
18 | cd ${srcdir}
19 | grub-mkrescue -V "SBROOT" -o "grub.iso" --modules="part_msdos part_gpt part_apple fat exfat iso9660 hfs hfsplus ntfs crypto gzio zstd xzio lzopio" --themes=
20 | bsdtar -xf grub.iso
21 | rm -f grub.iso
22 | tar --zstd -cf efi.bootfiles ./*
23 | }
24 |
25 | package() {
26 | mkdir -p ${pkgdir}/usr/share/${sb}
27 | install -dm644 ${pkgdir}/usr/share/${sb}
28 | install -m644 ${srcdir}/efi.bootfiles ${pkgdir}/usr/share/${sb}
29 | }
30 |
--------------------------------------------------------------------------------
/systemback/LICENSE:
--------------------------------------------------------------------------------
1 | Upstream-Name: Systemback
2 | Source: https://github.com/shadichy/systemback-archlinux
3 |
4 | Files: *
5 | License: GPL-3+
6 | This package is free software; you can redistribute it and/or modify it under
7 | the terms of the GNU General Public License as published by the Free Software
8 | Foundation; either version 3 of the License, or (at your option) any later
9 | version.
10 | .
11 | This package is distributed in the hope that it will be useful, but WITHOUT ANY
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 | PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | .
15 | You should have received a copy of the GNU General Public License along with
16 | this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
17 | St, Fifth Floor, Boston, MA 02110-1301 USA
18 | .
19 | On Debian systems, the full text of the GNU General Public License version 3
20 | can be found in the file '/usr/share/common-licenses/GPL'.
21 |
--------------------------------------------------------------------------------
/systemback/debian/changelog:
--------------------------------------------------------------------------------
1 | systemback (1.8.9) release; urgency=low
2 |
3 | * 1.8.9
4 | * Add support for NVMe
5 |
6 | * 1.8.8
7 | * Merge from https://github.com/fconidi/Systemback_source-1.9.4
8 | * Add support for NVMe
9 |
10 | * 1.8.7
11 | * Fix symbol link missing after install system images
12 |
13 | * 1.8.6
14 | * Add sbignore file, set include user data as default, set autoiso as default
15 |
16 | * 1.8.5
17 | * Add support for Ubuntu 20.04 and large iso
18 |
19 | * 1.8.402
20 | * Fix Live creation when the '/snap' directory is missing
21 |
22 | * 1.8.400
23 | * Add support to installed Snap packages
24 | * Remove support to old (version 1.5 and below) restore points
25 | * Fix possible segmentation fault when checking directory mount status
26 | * Fix translation files detection in DBGLEV=3 mode
27 | * Fix source code compilation under Ubuntu 14.04
28 | * Import new Romanian translations
29 |
30 | * 1.8.300
31 | * Fix the possible conflict with the APT when updating the package index files
32 | * Import new EFI boot files from the Ubuntu 16.04 LTS
33 | * Import new Czech, English (United Kingdom), Hungarian, Romanian and Spanish
34 | translations
35 |
36 | * 1.8.202
37 | * Improve compatibility with apt 1.2
38 | * Update EFI boot files
39 | * Import new Spanish, Danish and Chinese (Simplified) translations
40 |
41 | * 1.8.201
42 | * Fix restore point creation when the storage dir path contains symbolic link
43 | * Fix some directory date and time settings when creating restore points
44 |
45 | * 1.8.200
46 | * Fix line breaking when printing the mounted filesystems in DBGLEV=3 mode
47 | * Fix error messages printing when upgrading the system
48 | * Fix the GRUB menu height on the Live when the system contains xorg.conf
49 | file(s)
50 | * Detect and takes into account the configuration file(s) in the
51 | /etc/X11/xorg.conf.d directory
52 | * Update EFI boot files
53 | * Import new Czech translations
54 |
55 | * 1.8.102
56 | * Fix possible segmentation fault when try to minimize the window with the
57 | button
58 |
59 | * 1.8.101
60 | * Fix partition information reading on Ubuntu 16.04
61 |
62 | * 1.8.100
63 | * Fix incorrect symlink following when creating a new incremental restore
64 | point (TeamViewer global.conf bug)
65 | * Add a new debug level (DBGLEV=3) for more debug information
66 | * Some minor fixes and improvements
67 | * Import new Hungarian translations
68 |
69 | -- Bluewhale Robot Fri, 07 Jan 2021 15:24:25 +0800
70 |
--------------------------------------------------------------------------------
/systemback/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/systemback/debian/control:
--------------------------------------------------------------------------------
1 | Source: systemback
2 | Section: admin
3 | Priority: optional
4 | Maintainer: Kende Krisztián , Zhang Weijia (randoms)
5 | Build-Depends: debhelper (>= 9),
6 | libblkid-dev,
7 | libmount-dev,
8 | libncursesw5-dev,
9 | libparted-dev,
10 | qtbase5-dev,
11 | qttools5-dev-tools
12 | Standards-Version: 3.9.7
13 |
14 | Package: systemback
15 | Architecture: amd64 i386
16 | Depends: ${misc:Depends},
17 | ${shlibs:Depends},
18 | dosfstools,
19 | fonts-freefont-ttf | ttf-freefont,
20 | xorriso,
21 | squashfs-tools,
22 | syslinux,
23 | syslinux (<< 3:5) | isolinux (>> 3:6),
24 | syslinux (<< 3:5) | syslinux-common (>> 3:6),
25 | syslinux (<< 3:5) | syslinux-utils (>> 3:6),
26 | systemback-efiboot-amd64 (= ${source:Version}) [amd64],
27 | systemback-scheduler (= ${binary:Version}),
28 | upstart | sysvinit (>= 2.88) | systemd | openrc | runit,
29 | xterm,
30 | zenity
31 | Recommends: grub,
32 | mkinitcpio-live-boot,
33 | systemback-cli (= ${binary:Version}),
34 | systemback-locales (= ${source:Version}),
35 | ttf-ubuntu-font-family
36 | Suggests: btrfs-progs,
37 | jfsutils,
38 | reiserfsprogs,
39 | xfsprogs,
40 | unionfs-fuse
41 | Description: Simple system backup and restore application with extra features
42 | Systemback makes it easy to create backups of the system and the users
43 | configuration files. In case of problems you can easily restore the previous
44 | state of the system. There are extra features like system copying, system
45 | installation and Live system creation.
46 | .
47 | This package contain a Qt5 graphical user interface for Systemback.
48 |
49 | Package: systemback-dbg
50 | Architecture: amd64 i386
51 | Section: debug
52 | Priority: extra
53 | Depends: ${misc:Depends},
54 | systemback (= ${binary:Version})
55 | Description: Debug symbols for systemback
56 | Systemback makes it easy to create backups of the system and the users
57 | configuration files. In case of problems you can easily restore the previous
58 | state of the system. There are extra features like system copying, system
59 | installation and Live system creation.
60 | .
61 | This package contains the debug symbols for systemback.
62 |
63 | Package: systemback-cli
64 | Architecture: amd64 i386
65 | Depends: ${misc:Depends},
66 | ${shlibs:Depends},
67 | upstart | sysvinit (>= 2.88) | systemd
68 | Recommends: grub2-common,
69 | grub-efi-amd64-bin | grub-pc-bin
70 | Description: Systemback command line interface
71 | Systemback makes it easy to create backups of the system and the users
72 | configuration files. In case of problems you can easily restore the previous
73 | state of the system. There are extra features like system copying, system
74 | installation and Live system creation.
75 | .
76 | This package contain a command line interface for Systemback.
77 |
78 | Package: systemback-cli-dbg
79 | Architecture: amd64 i386
80 | Section: debug
81 | Priority: extra
82 | Depends: ${misc:Depends},
83 | systemback-cli (= ${binary:Version})
84 | Description: Debug symbols for systemback-cli
85 | Systemback makes it easy to create backups of the system and the users
86 | configuration files. In case of problems you can easily restore the previous
87 | state of the system. There are extra features like system copying, system
88 | installation and Live system creation.
89 | .
90 | This package contains the debug symbols for systemback-cli.
91 |
92 | Package: systemback-scheduler
93 | Architecture: amd64 i386
94 | Depends: ${misc:Depends},
95 | ${shlibs:Depends}
96 | Breaks: systemback (<< 1.0.0)
97 | Replaces: systemback (<< 1.0.0)
98 | Description: Systemback scheduler daemon
99 | Systemback makes it easy to create backups of the system and the users
100 | configuration files. In case of problems you can easily restore the previous
101 | state of the system. There are extra features like system copying, system
102 | installation and Live system creation.
103 | .
104 | This package contain a scheduler daemon for Systemback.
105 |
106 | Package: systemback-scheduler-dbg
107 | Architecture: amd64 i386
108 | Section: debug
109 | Priority: extra
110 | Depends: ${misc:Depends},
111 | systemback-scheduler (= ${binary:Version})
112 | Description: Debug symbols for systemback-scheduler
113 | Systemback makes it easy to create backups of the system and the users
114 | configuration files. In case of problems you can easily restore the previous
115 | state of the system. There are extra features like system copying, system
116 | installation and Live system creation.
117 | .
118 | This package contains the debug symbols for systemback-scheduler.
119 |
120 | Package: libsystemback
121 | Architecture: amd64 i386
122 | Section: libs
123 | Depends: ${misc:Depends},
124 | ${shlibs:Depends},
125 | apt,
126 | procps
127 | Description: Systemback shared library
128 | Systemback makes it easy to create backups of the system and the users
129 | configuration files. In case of problems you can easily restore the previous
130 | state of the system. There are extra features like system copying, system
131 | installation and Live system creation.
132 | .
133 | This package contain a shared library for Systemback binaries.
134 |
135 | Package: libsystemback-dbg
136 | Architecture: amd64 i386
137 | Section: debug
138 | Priority: extra
139 | Depends: ${misc:Depends},
140 | libsystemback (= ${binary:Version})
141 | Description: Debug symbols for libsystemback
142 | Systemback makes it easy to create backups of the system and the users
143 | configuration files. In case of problems you can easily restore the previous
144 | state of the system. There are extra features like system copying, system
145 | installation and Live system creation.
146 | .
147 | This package contains the debug symbols for libsystemback.
148 |
149 | Package: systemback-efiboot-amd64
150 | Architecture: all
151 | Depends: ${misc:Depends},
152 | xz-utils
153 | Description: Systemback boot files
154 | Systemback makes it easy to create backups of the system and the users
155 | configuration files. In case of problems you can easily restore the previous
156 | state of the system. There are extra features like system copying, system
157 | installation and Live system creation.
158 | .
159 | This package contais 64-bit boot files for UEFI-based machines.
160 |
161 | Package: systemback-locales
162 | Architecture: all
163 | Depends: ${misc:Depends}
164 | Description: Systemback localizations files
165 | Systemback makes it easy to create backups of the system and the users
166 | configuration files. In case of problems you can easily restore the previous
167 | state of the system. There are extra features like system copying, system
168 | installation and Live system creation.
169 | .
170 | This package contains localizations files for Systemback.
171 |
--------------------------------------------------------------------------------
/systemback/debian/copyright:
--------------------------------------------------------------------------------
1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
2 | Upstream-Name: Systemback
3 | Source: https://github.com/shadichy/systemback-archlinux
4 |
5 | Files: *
6 | License: GPL-3+
7 | This package is free software; you can redistribute it and/or modify it under
8 | the terms of the GNU General Public License as published by the Free Software
9 | Foundation; either version 3 of the License, or (at your option) any later
10 | version.
11 | .
12 | This package is distributed in the hope that it will be useful, but WITHOUT ANY
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 | PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 | .
16 | You should have received a copy of the GNU General Public License along with
17 | this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
18 | St, Fifth Floor, Boston, MA 02110-1301 USA
19 | .
20 | On Debian systems, the full text of the GNU General Public License version 3
21 | can be found in the file '/usr/share/common-licenses/GPL'.
22 |
--------------------------------------------------------------------------------
/systemback/debian/libsystemback.install:
--------------------------------------------------------------------------------
1 | libsystemback/libsystemback.so* usr/lib/systemback
2 | libsystemback/scripts/* usr/share/systemback/scripts
3 |
--------------------------------------------------------------------------------
/systemback/debian/libsystemback.postrm:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | if [ "$1" = purge ] && [ -d /etc/systemback ]
4 | then
5 | echo "Deleting Systemback configuration files ..."
6 |
7 | if [ -f /etc/systemback/systemback.conf ]
8 | then
9 | sdir="$(grep ^storage_directory= /etc/systemback/systemback.conf | tail -c +19)"
10 | rm /etc/systemback/systemback.conf
11 |
12 | if [ "$sdir" ] && [ -d "$sdir"/Systemback ] && [ ! -d "$sdir"/Systemback/S01_* ] && [ ! -d "$sdir"/Systemback/H01_* ]
13 | then
14 | [ ! -e "$sdir"/Systemback/.sbschedule ] || rm "$sdir"/Systemback/.sbschedule
15 | ! rm -d "$sdir"/Systemback 2>/dev/null || echo "Deleting empty Systemback storage directory ..."
16 | fi
17 | fi
18 |
19 | rm -r /etc/systemback
20 | fi
21 | #DEBHELPER#
--------------------------------------------------------------------------------
/systemback/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | configure: configure-stamp
4 |
5 | configure-stamp:
6 | qmake-qt5
7 | touch configure-stamp
8 |
9 | build: build-arch build-indep
10 |
11 | build-arch: build-arch-stamp
12 |
13 | build-indep: build-indep-stamp
14 |
15 | build-arch-stamp: configure-stamp
16 | $(MAKE) -j $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
17 | touch build-arch-stamp
18 |
19 | build-indep-stamp:
20 | lrelease-qt5 systemback.pro
21 | touch build-indep-stamp
22 |
23 | clean:
24 | rm -f configure-stamp build-*-stamp lang/*.qm libsystemback/libmount.hpp
25 | [ ! -f Makefile ] || $(MAKE) distclean
26 | dh_clean
27 |
28 | binary-arch: build-arch
29 | dh_installdirs -a
30 | dh_install -a
31 | dh_installman debian/systemback.1 -p systemback
32 | dh_installman debian/systemback-cli.1 -p systemback-cli
33 | dh_strip --dbg-package=systemback-dbg -p systemback
34 | dh_strip --dbg-package=systemback-cli-dbg -p systemback-cli
35 | dh_strip --dbg-package=systemback-scheduler-dbg -p systemback-scheduler
36 | dh_strip --dbg-package=libsystemback-dbg -p libsystemback
37 | dh_link -a
38 | dh_fixperms -a
39 | chmod 4755 debian/systemback-scheduler/usr/lib/systemback/sbsustart
40 | dh_makeshlibs -nV "libsystemback (= $(shell dpkg-parsechangelog | sed -n 's/^Version: //p'))" -a
41 | dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -a
42 | dh_installdeb -a
43 | dh_gencontrol -a
44 | dh_installdocs -a
45 | dh_installchangelogs -a
46 | dh_lintian -a
47 | dh_compress -a
48 | dh_builddeb -a
49 |
50 | binary-indep: build-indep
51 | dh_install -i
52 | dh_fixperms -i
53 | dh_installdeb -i
54 | dh_gencontrol -i
55 | dh_installdocs -i
56 | dh_installchangelogs -i
57 | dh_compress -i
58 | dh_builddeb -i
59 |
60 | binary: binary-arch binary-indep
61 |
62 | .PHONY: configure build-arch build-indep clean binary-arch binary-indep binary
63 |
--------------------------------------------------------------------------------
/systemback/debian/source.lintian-overrides:
--------------------------------------------------------------------------------
1 | systemback source: newer-standards-version *
2 |
--------------------------------------------------------------------------------
/systemback/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-cli.1:
--------------------------------------------------------------------------------
1 | .TH Systemback 1 "02.02.2016."
2 |
3 | .SH NAME
4 | Systemback - Simple system backup and restore application with extra
5 | .br
6 | features
7 |
8 | .SH SYNOPSIS
9 | \fBsystemback-cli\fR [\fIOPTION\fR]
10 |
11 | .SH DESCRIPTION
12 |
13 | \fBSystemback\fR makes it easy to create backups of the system and the users
14 | configuration files. In case of problems you can easily restore the previous
15 | state of the system. There are extra features like system copying, system
16 | installation and Live system creation.
17 |
18 | .SH OPTIONS
19 | .TP
20 | .B -n, --newbackup
21 | create a new restore point
22 | .TP
23 | .B -s, --storagedir
24 | get or set restore points storage directory path
25 | .TP
26 | .B -u, --upgrade
27 | upgrade current system
28 | .br
29 | remove unnecessary files and packages
30 | .TP
31 | .B -v, --version
32 | output Systemback version number
33 | .TP
34 | .B -h, --help
35 | show help
36 |
37 | .SH ENVIRONMENT
38 | .TP
39 | .B DBGLEV
40 | set the debug level for the stdout printed error messages
41 | .br
42 | these will be redirected to the /tmp/systemback-cli_stderr
43 | .br
44 | 0 - no error messages
45 | .br
46 | 1 - print the error messages when a process has stopped because
47 | .br
48 | an error occurred (default)
49 | .br
50 | 2 - this is the same as level 1
51 | .br
52 | 3 - print the error messages with extra informations
53 |
54 | .SH FILES
55 | .SS /etc/systemback/systemback.conf
56 | configuration of GUI and CLI
57 | .br
58 | the possible variables and values are indicated in the file, all other changes
59 | are lost
60 |
61 | .SS /etc/systemback/systemback.excludes
62 | exclude hidden user files and directories from restore points
63 | .br
64 | exclude user data files and directories from Live system
65 |
66 | .SS /etc/systemback/systemback.includes
67 | include user data files and directories into the restore points
68 |
69 | .SH AUTHOR
70 | Krisztián Kende (nemh@freemail.hu)
71 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-cli.install:
--------------------------------------------------------------------------------
1 | systemback-cli/systemback-cli usr/bin
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-efiboot-amd64.install:
--------------------------------------------------------------------------------
1 | efi-amd64.bootfiles usr/share/systemback
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-locales.install:
--------------------------------------------------------------------------------
1 | lang/*.qm usr/share/systemback/lang
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-scheduler.install:
--------------------------------------------------------------------------------
1 | sbscheduler/sbscheduler usr/lib/systemback
2 | sbsustart/sbsustart usr/lib/systemback
3 | sbschedule.desktop etc/xdg/autostart
4 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-scheduler.lintian-overrides:
--------------------------------------------------------------------------------
1 | systemback-scheduler: setuid-binary
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback-scheduler.postrm:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | if [ -d /run ]
4 | then pfile=/run/sbscheduler.pid
5 | else pfile=/var/run/sbscheduler.pid
6 | fi
7 |
8 | if [ "$1" = upgrade ] && [ -s $pfile ]
9 | then printf restart > $pfile
10 | fi
11 | #DEBHELPER#
--------------------------------------------------------------------------------
/systemback/debian/systemback-scheduler.preinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | if [ "$1" = install ] && grep ^enabled=true /etc/systemback/systemback.conf >/dev/null 2>&1
4 | then
5 | echo "Disabling Systemback scheduler ..."
6 | sed -i s/^enabled=true/enabled=false/g /etc/systemback/systemback.conf
7 | fi
8 | #DEBHELPER#
--------------------------------------------------------------------------------
/systemback/debian/systemback-scheduler.prerm:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | if [ -d /run ]
4 | then dir=/run
5 | else dir=/var/run
6 | fi
7 |
8 | if [ "$1" = remove ] && [ -e $dir/sbscheduler.lock ] && [ -s $dir/sbscheduler.pid ]
9 | then
10 | echo "Stopping Systemback scheduler daemon ..."
11 |
12 | if kill $(cat $dir/sbscheduler.pid) >/dev/null 2>&1
13 | then rm $dir/sbscheduler.lock $dir/sbscheduler.pid
14 | fi
15 | fi
16 | #DEBHELPER#
--------------------------------------------------------------------------------
/systemback/debian/systemback.1:
--------------------------------------------------------------------------------
1 | .TH Systemback 1 "02.02.2016."
2 |
3 | .SH NAME
4 | Systemback - Simple system backup and restore application with extra
5 | .br
6 | features
7 |
8 | .SH SYNOPSIS
9 | \fBsystemback
10 |
11 | .SH DESCRIPTION
12 |
13 | \fBSystemback\fR makes it easy to create backups of the system and the users
14 | configuration files. In case of problems you can easily restore the previous
15 | state of the system. There are extra features like system copying, system
16 | installation and Live system creation.
17 |
18 | .SH ENVIRONMENT
19 | .TP
20 | .B DBGLEV
21 | set the debug level for the stdout printed error messages
22 | .br
23 | 0 - no error messages
24 | .br
25 | 1 - print the error messages when a process has stopped because
26 | .br
27 | an error occurred (default)
28 | .br
29 | 2 - print all error messages
30 | .br
31 | 3 - print all error messages with extra informations
32 |
33 | .SH FILES
34 | .SS /etc/systemback/systemback.conf
35 | configuration of GUI and CLI
36 | .br
37 | the possible variables and values are indicated in the file, all other changes
38 | are lost
39 |
40 | .SS /etc/systemback/systemback.excludes
41 | exclude hidden user files and directories from restore points
42 | .br
43 | exclude user data files and directories from Live system
44 |
45 | .SS /etc/systemback/systemback.includes
46 | include user data files and directories into the restore points
47 |
48 | .SH AUTHOR
49 | Krisztián Kende (nemh@freemail.hu)
50 |
--------------------------------------------------------------------------------
/systemback/debian/systemback.install:
--------------------------------------------------------------------------------
1 | systemback/systemback usr/bin
2 | sbsysupgrade/sbsysupgrade usr/lib/systemback
3 | splash.png usr/share/systemback
4 | logo.png usr/share/systemback
5 | org.systemback.systemback.desktop /usr/share/applications
6 | icons/128x128/systemback.png usr/share/icons/hicolor/128x128/apps
7 | icons/256x256/systemback.png usr/share/icons/hicolor/256x256/apps
8 | icons/48x48/systemback.png usr/share/icons/hicolor/48x48/apps
9 | icons/64x64/systemback.png usr/share/icons/hicolor/64x64/apps
10 |
--------------------------------------------------------------------------------
/systemback/debian/systemback.links:
--------------------------------------------------------------------------------
1 | /usr/lib/systemback/sbsustart /usr/bin/systemback-sustart
2 |
--------------------------------------------------------------------------------
/systemback/debian/systemback.lintian-overrides:
--------------------------------------------------------------------------------
1 | systemback: desktop-command-not-in-package
2 | systemback: binary-without-manpage
3 |
--------------------------------------------------------------------------------
/systemback/debuild.sh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 | # dpkg-buildpackage -d -us -uc
3 |
4 | qmake-qt5
5 | touch configure-stamp
6 |
7 | make -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
8 | touch build-arch-stamp
9 |
10 | lrelease-qt5 systemback.pro
11 | touch build-indep-stamp
12 |
13 | rm -f configure-stamp build-*-stamp lang/*.qm libsystemback/libmount.hpp
14 | [ ! -f Makefile ] || $(MAKE) distclean
15 | dh_clean
16 |
17 | dh_installdirs -a
18 | dh_install -a
19 | dh_installman debian/systemback.1 -p systemback
20 | dh_installman debian/systemback-cli.1 -p systemback-cli
21 | # dh_strip --dbg-package=systemback-dbg -p systemback
22 | # dh_strip --dbg-package=systemback-cli-dbg -p systemback-cli
23 | # dh_strip --dbg-package=systemback-scheduler-dbg -p systemback-scheduler
24 | # dh_strip --dbg-package=libsystemback-dbg -p libsystemback
25 | dh_link -a
26 | dh_fixperms -a
27 | chmod 4755 debian/systemback-scheduler/usr/lib/systemback/sbsustart
28 | dh_makeshlibs -nV "libsystemback (= $(shell dpkg-parsechangelog | sed -n 's/^Version: //p'))" -a
29 | dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -a
30 | dh_installdeb -a
31 | dh_gencontrol -a
32 | dh_installdocs -a
33 | dh_installchangelogs -a
34 | dh_lintian -a
35 | dh_compress -a
36 | dh_builddeb -a
37 |
38 | dh_install -i
39 | dh_fixperms -i
40 | dh_installdeb -i
41 | dh_gencontrol -i
42 | dh_installdocs -i
43 | dh_installchangelogs -i
44 | dh_compress -i
45 | dh_builddeb -i
46 |
--------------------------------------------------------------------------------
/systemback/efi-amd64.bootfiles:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/efi-amd64.bootfiles
--------------------------------------------------------------------------------
/systemback/efi-amd64.bootfiles.old:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/efi-amd64.bootfiles.old
--------------------------------------------------------------------------------
/systemback/icons/128x128/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/icons/128x128/systemback.png
--------------------------------------------------------------------------------
/systemback/icons/256x256/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/icons/256x256/systemback.png
--------------------------------------------------------------------------------
/systemback/icons/48x48/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/icons/48x48/systemback.png
--------------------------------------------------------------------------------
/systemback/icons/64x64/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/icons/64x64/systemback.png
--------------------------------------------------------------------------------
/systemback/libsystemback/bstr.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2015-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef BSTR_HPP
20 | #define BSTR_HPP
21 |
22 | #include "sbtypedef.hpp"
23 |
24 | class bstr
25 | {
26 | private:
27 | QBA ba;
28 |
29 | public:
30 | inline bstr() {}
31 | inline bstr(cchar *txt) : data(txt) {}
32 | inline bstr(cQBA &txt) : data(txt.constData()) {}
33 | inline bstr(cQStr &txt) : ba(txt.toUtf8()), data(ba.constData()) {}
34 | operator cchar *() const;
35 |
36 | cchar *data;
37 |
38 | cchar *rplc(cchar *bef, cchar *aft);
39 | };
40 |
41 | inline bstr::operator cchar *() const
42 | {
43 | return data;
44 | }
45 |
46 | inline cchar *bstr::rplc(cchar *bef, cchar *aft)
47 | {
48 | return ba.replace(bef, aft);
49 | }
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/systemback/libsystemback/lcheck.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright(C) 2015-2016, Krisztián Kende
4 | #
5 | # This file is part of the Systemback.
6 | #
7 | # The Systemback is free software; you can redistribute it and/or modify it under
8 | # the terms of the GNU General Public License as published by the Free Software
9 | # Foundation; either version 3 of the License, or (at your option) any later
10 | # version.
11 | #
12 | # The Systemback is distributed in the hope that it will be useful, but WITHOUT
13 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License along with the
17 | # Systemback. If not, see .
18 | #
19 |
20 | grep "*new)" /usr/include/libmount/libmount.h >/dev/null && sed "s/*new)/*new_table)/g" /usr/include/libmount/libmount.h > libmount.hpp
21 |
--------------------------------------------------------------------------------
/systemback/libsystemback/libsystemback.pro:
--------------------------------------------------------------------------------
1 | QT -= gui
2 |
3 | TARGET = systemback
4 |
5 | CONFIG += exceptions_off
6 |
7 | TEMPLATE = lib
8 |
9 | DEFINES += SYSTEMBACK_LIBRARY \
10 | _FILE_OFFSET_BITS=64
11 |
12 | system(./lcheck.sh):exists(libmount.hpp) {
13 | DEFINES += C_MNT_LIB
14 | }
15 |
16 | SOURCES += sblib.cpp
17 |
18 | HEADERS += sblib.hpp \
19 | sblib_global.hpp \
20 | sbtypedef.hpp \
21 | bstr.hpp
22 |
23 | RESOURCES += version.qrc
24 |
25 | QMAKE_CXXFLAGS += -g \
26 | -fno-rtti \
27 | -fvisibility=hidden \
28 | -fvisibility-inlines-hidden \
29 | -fno-asynchronous-unwind-tables
30 |
31 | QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-result
32 |
33 | CONFIG(debug, debug|release) {
34 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
35 | -Wshadow \
36 | -Werror
37 | }
38 |
39 | QMAKE_LFLAGS += -g \
40 | -Wl,-Bsymbolic-functions \
41 | -Wl,--as-needed \
42 | -fuse-ld=gold \
43 | -Wl,-z,relro
44 |
45 | ! equals(QMAKE_CXX, clang++) {
46 | QMAKE_CXXFLAGS += -flto
47 | #QMAKE_LFLAGS += -flto
48 | }
49 |
50 | LIBS += -lmount \
51 | -lblkid \
52 | -lparted
53 |
54 | # for arch linux with gcc 12
55 |
--------------------------------------------------------------------------------
/systemback/libsystemback/sblib.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SBLIB_HPP
20 | #define SBLIB_HPP
21 |
22 | #include "sblib_global.hpp"
23 | #include "bstr.hpp"
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | #define fnln __attribute__((always_inline))
35 | #define cfgfile "/etc/systemback/systemback.conf"
36 | #define excfile "/etc/systemback/systemback.excludes"
37 | #define incfile "/etc/systemback/systemback.includes"
38 |
39 | class SHARED_EXPORT_IMPORT sb : public QThread
40 | {
41 | Q_DECLARE_TR_FUNCTIONS(systemback)
42 |
43 | public:
44 | enum { Remove = 0, Copy = 1, Sync = 2, Mount = 3, Umount = 4, Readprttns = 5, Readlvdevs = 6, Ruuid = 7, Setpflag = 8, Mkptable = 9, Mkpart = 10, Delpart = 11, Crtrpoint = 12, Srestore = 13, Scopy = 14, Lvprpr = 15,
45 | MSDOS = 0, GPT = 1, Clear = 2, Primary = 3, Extended = 4, Logical = 5, Freespace = 6, Emptyspace = 7,
46 | Nodbg = 0, Errdbg = 1, Alldbg = 2, Extdbg = 3, Cextdbg = 4, Nulldbg = 5, Falsedbg = 6,
47 | Notexist = 0, Isfile = 1, Isdir = 2, Islink = 3, Isblock = 4, Unknown = 5,
48 | Noflag = 0, Silent = 1, Bckgrnd = 2, Prgrss = 4, Wait = 8,
49 | Sblock = 0, Alpmlock = 1, Schdlrlock = 2,
50 | False = 0, True = 1, Empty = 2, Include = 3,
51 | Crtdir = 0, Rmfile = 1, Crthlnk = 2,
52 | Read = 0, Write = 1, Exec = 2,
53 | Norm = 0, All = 1, Mixed = 2 };
54 |
55 | static sb SBThrd;
56 | static QStr ThrdStr[3], eout, sdir[3], schdlr[2], pnames[15], lang, style, wsclng;
57 | static ullong ThrdLng[2];
58 | static uchar dbglev, pnumber, ismpnt, schdle[6], waot, incrmtl, xzcmpr, autoiso, ecache;
59 | static schar Progress;
60 | static bool ExecKill, ThrdKill;
61 |
62 | static fnln QStr hunit(ullong size);
63 |
64 | static QStr mid(cQStr &txt, ushort start, ushort len),
65 | fload(cQStr &path, bool ascnt),
66 | right(cQStr &txt, short len),
67 | left(cQStr &txt, short len),
68 | gdetect(cQStr rdir = "/"),
69 | rndstr(uchar vlen = 10),
70 | ruuid(cQStr &part),
71 | appver(),
72 | dbginf();
73 |
74 | static QBA fload(cQStr &path);
75 | template static ullong dfree(const T &path);
76 | static fnln ullong fsize(cQStr &path);
77 |
78 | static fnln ushort instr(cQStr &txt, cQStr &stxt, ushort start = 1),
79 | rinstr(cQStr &txt, cQStr &stxt);
80 |
81 | template static uchar stype(const T &path, bool flink = false);
82 |
83 | static uchar exec(cQStr &cmd, uchar flag = Noflag, cQStr &envv = nullptr),
84 | exec(cQSL &cmds);
85 |
86 | static QStr execSTDOUT(cQStr &cmd);
87 |
88 | template
89 | static bool issmfs(const T1 &item1, const T2 &item2);
90 | template static fnln bool crtdir(const T &path);
91 | template static fnln bool rmfile(const T &file);
92 | template static bool exist(const T &path);
93 |
94 | static fnln bool islink(cQStr &path),
95 | isfile(cQStr &path),
96 | isdir(cQStr &path);
97 |
98 | static bool srestore(uchar mthd, cQStr &usr, cQStr &srcdir, cQStr &trgt, bool sfstab = false),
99 | mkpart(cQStr &dev, ullong start = 0, ullong len = 0, uchar type = Primary),
100 | mcheck(cQStr &item, cQStr &mnts = fload("/proc/self/mounts")),
101 | mount(cQStr &dev, cQStr &mpoint, cQStr &moptns = nullptr),
102 | like(cQStr &txt, cQSL &lst, uchar mode = Norm),
103 | execsrch(cQStr &fname, cQStr &ppath = nullptr),
104 | scopy(uchar mthd, cQStr &usr, cQStr &srcdir),
105 | mkptable(cQStr &dev, cQStr &type = "msdos"),
106 | crtfile(cQStr &path, cQStr &txt = nullptr),
107 | like(int num, cSIL &lst, bool all = false),
108 | access(cQStr &path, uchar mode = Read),
109 | copy(cQStr &srcfile, cQStr &newfile),
110 | setpflag(cQStr &part, cQStr &flags),
111 | rename(cQStr &opath, cQStr &npath),
112 | error(QStr txt, bool dbg = false),
113 | cfgwrite(cQStr &file = cfgfile),
114 | crtrpoint(cQStr &pname),
115 | islnxfs(cQStr &path),
116 | remove(cQStr &path),
117 | lvprpr(bool iudata),
118 | fopen(QFile &file),
119 | umount(cQStr &dev),
120 | isnum(cQStr &txt),
121 | lock(uchar type);
122 |
123 | static void readprttns(QSL &strlst),
124 | readlvdevs(QSL &strlst),
125 | delpart(cQStr &part),
126 | unlock(uchar type),
127 | delay(ushort msec),
128 | print(cQStr &txt),
129 | supgrade(),
130 | pupgrade(),
131 | thrdelay(),
132 | cfgread(),
133 | fssync(),
134 | ldtltr();
135 |
136 | protected:
137 | void run();
138 |
139 | private:
140 | sb();
141 | ~sb();
142 |
143 | static QTrn *SBtr;
144 | static QSL *ThrdSlst;
145 | static int sblock[4];
146 | static uchar ThrdType, ThrdChr;
147 | static bool ThrdBool, ThrdRslt;
148 |
149 | static QStr fdbg(cQStr &path1, cQStr &path2 = nullptr),
150 | rlink(cQStr &path, ushort blen);
151 |
152 | static ullong devsize(cQStr &dev);
153 |
154 | static bool rodir(QBA &ba, QUCL &ucl, cQStr &path, uchar hidden = False, cQSL &ilist = QSL(), uchar oplen = 0),
155 | rodir(cQStr &path, QBA &ba, QUCL &ucl, ullong id = 0, uchar oplen = 0),
156 | cerr(uchar type, cQStr &str1, cQStr &str2 = nullptr),
157 | rodir(QUCL &ucl, cQStr &path, uchar oplen = 0),
158 | rodir(QBA &ba, cQStr &path, uchar oplen = 0),
159 | inclcheck(cQSL &ilist, cQStr &item);
160 |
161 | uchar fcomp(cQStr &file1, cQStr &file2);
162 | template fnln bool crthlnk(const T1 &srclnk, const T2 &newlnk);
163 |
164 | bool odir(QBAL &balst, cQStr &path, uchar hidden = False, cQSL &ilist = QSL(), cQStr &ppath = nullptr),
165 | thrdsrestore(uchar mthd, cQStr &usr, cQStr &srcdir, cQStr &trgt, bool sfstab),
166 | cpertime(cQStr &srcitem, cQStr &newitem, bool skel = false),
167 | cpfile(cQStr &srcfile, cQStr &newfile, bool skel = false),
168 | thrdscopy(uchar mthd, cQStr &usr, cQStr &srcdir),
169 | recrmdir(cbstr &path, bool slimit = false),
170 | cplink(cQStr &srclink, cQStr &newlink),
171 | cpdir(cQStr &srcdir, cQStr &newdir),
172 | exclcheck(cQSL &elist, cQStr &item),
173 | lcomp(cQStr &link1, cQStr &link2),
174 | thrdcrtrpoint(cQStr &trgt),
175 | thrdlvprpr(bool iudata),
176 | umnt(cbstr &dev);
177 |
178 | void edetect(QSL &elst, bool spath = false);
179 | };
180 |
181 | inline QStr sb::left(cQStr &txt, short len)
182 | {
183 | return txt.length() > qAbs(len) ? txt.left(len > 0 ? len : txt.length() + len) : len > 0 ? txt : nullptr;
184 | }
185 |
186 | inline QStr sb::right(cQStr &txt, short len)
187 | {
188 | return txt.length() > qAbs(len) ? txt.right(len > 0 ? len : txt.length() + len) : len > 0 ? txt : nullptr;
189 | }
190 |
191 | inline QStr sb::mid(cQStr &txt, ushort start, ushort len)
192 | {
193 | return txt.length() >= start ? txt.length() - start + 1 > len ? txt.mid(start - 1, len) : txt.right(txt.length() - start + 1) : nullptr;
194 | }
195 |
196 | inline ushort sb::instr(cQStr &txt, cQStr &stxt, ushort start)
197 | {
198 | return txt.indexOf(stxt, start - 1) + 1;
199 | }
200 |
201 | inline ushort sb::rinstr(cQStr &txt, cQStr &stxt)
202 | {
203 | return txt.lastIndexOf(stxt) + 1;
204 | }
205 |
206 | inline bool sb::like(int num, cSIL &lst, bool all)
207 | {
208 | for(int val : lst)
209 | if(all ? num != val : num == val) return ! all;
210 |
211 | return all;
212 | }
213 |
214 | template inline bool sb::exist(const T &path)
215 | {
216 | struct stat istat;
217 | return ! lstat(bstr(path), &istat);
218 | }
219 |
220 | inline bool sb::islink(cQStr &path)
221 | {
222 | return QFileInfo(path).isSymLink();
223 | }
224 |
225 | inline bool sb::isfile(cQStr &path)
226 | {
227 | return QFileInfo(path).isFile();
228 | }
229 |
230 | inline bool sb::isdir(cQStr &path)
231 | {
232 | return QFileInfo(path).isDir();
233 | }
234 |
235 | template inline uchar sb::stype(const T &path, bool flink)
236 | {
237 | struct stat istat;
238 | if(flink ? stat(bstr(path), &istat) : lstat(bstr(path), &istat)) return Notexist;
239 |
240 | switch(istat.st_mode & S_IFMT) {
241 | case S_IFREG:
242 | return Isfile;
243 | case S_IFDIR:
244 | return Isdir;
245 | case S_IFLNK:
246 | return Islink;
247 | case S_IFBLK:
248 | return Isblock;
249 | default:
250 | return Unknown;
251 | }
252 | }
253 |
254 | inline ullong sb::fsize(cQStr &path)
255 | {
256 | return QFileInfo(path).size();
257 | }
258 |
259 | template ullong sb::dfree(const T &path)
260 | {
261 | struct statvfs dstat;
262 | return statvfs(bstr(path), &dstat) ? 0 : dstat.f_bavail * dstat.f_bsize;
263 | }
264 |
265 | inline QStr sb::hunit(ullong size)
266 | {
267 | return size < 1024 ? QStr(QStr::number(size) % " B") : size < 1048576 ? QStr::number(qRound64(size * 100.0 / 1024.0) / 100.0) % " KiB" : size < 1073741824 ? QStr::number(qRound64(size * 100.0 / 1024.0 / 1024.0) / 100.0) % " MiB" : size < 1073741824000 ? QStr::number(qRound64(size * 100.0 / 1024.0 / 1024.0 / 1024.0) / 100.0) % " GiB" : QStr::number(qRound64(size * 100.0 / 1024.0 / 1024.0 / 1024.0 / 1024.0) / 100.0) % " TiB";
268 | }
269 |
270 | template inline bool sb::issmfs(const T1 &item1, const T2 &item2)
271 | {
272 | struct stat istat[2];
273 | return ! (stat(bstr(item1), &istat[0]) || stat(bstr(item2), &istat[1])) && istat[0].st_dev == istat[1].st_dev;
274 | }
275 |
276 | template inline bool sb::crtdir(const T &path)
277 | {
278 | return mkdir(bstr(path), 0755) ? cerr(Crtdir, path) : true;
279 | }
280 |
281 | template inline bool sb::rmfile(const T &file)
282 | {
283 | return unlink(bstr(file)) ? cerr(Rmfile, file) : true;
284 | }
285 |
286 | inline bool sb::isnum(cQStr &txt)
287 | {
288 | for(uchar a(0) ; a < txt.length() ; ++a)
289 | if(! txt.at(a).isDigit()) return false;
290 |
291 | return ! txt.isEmpty();
292 | }
293 |
294 | #endif
295 |
--------------------------------------------------------------------------------
/systemback/libsystemback/sblib_global.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SBLIB_GLOBAL_HPP
20 | #define SBLIB_GLOBAL_HPP
21 |
22 | #include
23 |
24 | #ifdef SYSTEMBACK_LIBRARY
25 | #define SHARED_EXPORT_IMPORT Q_DECL_EXPORT
26 | #else
27 | #define SHARED_EXPORT_IMPORT Q_DECL_IMPORT
28 | #endif
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/systemback/libsystemback/sbtypedef.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SBTYPEDEF_HPP
20 | #define SBTYPEDEF_HPP
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | class bstr;
36 |
37 | typedef QTranslator QTrn;
38 | typedef QCursor *QCr;
39 | typedef QDesktopWidget *QDW;
40 | typedef QWidget *QWdt;
41 | typedef QTableWidget *QTblW;
42 | typedef QListWidget *QLW;
43 | typedef QPushButton *QPB;
44 | typedef QLineEdit *QLE;
45 | typedef QComboBox *QCbB;
46 | typedef QRadioButton *QRB;
47 | typedef QCheckBox *QCB;
48 | typedef QLabel *QLbl;
49 | typedef QTextStream QTS;
50 | typedef QList QWL;
51 | typedef QList QCbBL;
52 | typedef QList QLbL;
53 | typedef const QStringList cQSL;
54 | typedef QStringList QSL;
55 | typedef QList QBAL;
56 | typedef QList> QUCLL;
57 | typedef QList QLIL;
58 | typedef const QList cQUCL;
59 | typedef QList QUCL;
60 | typedef const std::initializer_list cSIL;
61 | typedef const QString cQStr;
62 | typedef QString QStr;
63 | typedef const QByteArray cQBA;
64 | typedef QByteArray QBA;
65 | typedef const QChar cQChar;
66 | typedef const QRect cQRect;
67 | typedef const QSize cQSize;
68 | typedef const QPoint cQPoint;
69 | typedef const bstr cbstr;
70 | typedef unsigned long long ullong;
71 | typedef long long llong;
72 | typedef const char cchar;
73 | typedef signed char schar;
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/systemback/libsystemback/scripts/upgrade.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | clear_cache() {
4 | echo "Clearing cache $([ $1 == 0 ] && echo "before" || echo "after") upgrade..."
5 | if ! pacman -Scc --noconfirm; then
6 | echo "Error: failed to clear package cache!"
7 | exit 1
8 | fi
9 | echo "Cache cleared!"
10 | }
11 |
12 | update_repo() {
13 | echo "Updating repositories..."
14 | if ! pacman -Sy; then
15 | echo "Error: failed to update repository!"
16 | exit 1
17 | fi
18 | echo "Repositories are up to date!"
19 | }
20 |
21 | remove_orphans() {
22 | echo 'Removing orphan (unneeded) packages'
23 | unneeded_packages=$(pacman -Qtdq)
24 | if [ "$unneeded_packages" ] && ! echo "${unneeded_packages}" | pacman -Rns --noconfirm -; then
25 | echo 'Error: failed to remove orphan (unneeded) packages'
26 | exit 1
27 | fi
28 | echo "Clean!"
29 | }
30 |
31 | upgrade_packages() {
32 | echo "Upgrading packages..."
33 | if ! pacman -Su --noconfirm; then
34 | echo "Error: failed to upgrade packages!"
35 | exit 1
36 | fi
37 | echo "All packages are up to date!"
38 | }
39 |
40 | fix_broken() {
41 | echo 'Fixing broken packages'
42 | broken_packages=$(pacman -Qentk 2>&1)
43 | if echo "${broken_packages}" | grep -Ev ' 0|warning' && ! echo "${broken_packages}" | grep 'warning' | grep -Ev ' 0|doc|man' | cut -d: -f2 | xargs -n1 | sort -u | pacman -Sdd --noconfirm --overwrite '*' -; then
44 | echo 'Error: failed to fix broken packages'
45 | exit 1
46 |
47 | fi
48 | echo "All packages are good!"
49 | }
50 |
51 | clear_cache 0
52 | update_repo || exit 1
53 | remove_orphans || exit 1
54 | upgrade_packages || exit 1
55 | fix_broken || exit 1
56 | clear_cache 1
57 |
58 | exit 0
59 |
--------------------------------------------------------------------------------
/systemback/libsystemback/version:
--------------------------------------------------------------------------------
1 | "1.8.5_06.18.2020"
2 |
--------------------------------------------------------------------------------
/systemback/libsystemback/version.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | version
4 |
5 |
6 |
--------------------------------------------------------------------------------
/systemback/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/logo.png
--------------------------------------------------------------------------------
/systemback/org.systemback.sbsustart.policy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | systemback
5 | https://github.com/shadichy/systemback-archlinux
6 |
7 | Run Systemback
8 | Authorize Systemback to run
9 | systemback
10 |
11 | auth_admin
12 | auth_admin
13 | auth_admin
14 |
15 | /usr/bin/sbsustart
16 | true
17 |
18 |
19 |
--------------------------------------------------------------------------------
/systemback/org.systemback.systemback.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Encoding=UTF-8
3 | Version=1.0
4 | Name=Systemback
5 | Comment=Simple system backup and restore application with extra features
6 | Comment[hu]=Egyszerű rendszermentő és visszaállító alkalmazás további extra funkciókkal
7 | Exec=/usr/bin/sbsustart systemback gtk+
8 | Type=Application
9 | Icon=systemback
10 | Terminal=false
11 | Categories=System;
12 |
--------------------------------------------------------------------------------
/systemback/pacman/hooks/sbnoxconf:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | run_latehook() {
4 | if grep noxconf /proc/cmdline >/dev/null 2>&1; then
5 | if [ -s /new_root/etc/X11/xorg.conf ]; then
6 | rm /new_root/etc/X11/xorg.conf
7 | fi
8 | if [ -d /new_root/etc/X11/xorg.conf.d ] && ls /new_root/etc/X11/xorg.conf.d | grep -E ".conf$" >/dev/null 2>&1; then
9 | rm /new_root/etc/X11/xorg.conf.d/*.conf 2>/dev/null
10 | fi
11 | fi
12 | }
13 |
--------------------------------------------------------------------------------
/systemback/pacman/install/sbfinstall:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # SPDX-License-Identifier: GPL-2.0-only
3 |
4 | build() {
5 | add_runscript
6 | }
7 |
8 | help() {
9 | cat <
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "sbscheduler.hpp"
20 | #include
21 |
22 | QDateTime scheduler::cfglmd;
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | QCoreApplication a(argc, argv);
27 | sb::ldtltr();
28 | scheduler s;
29 |
30 | QTimer::singleShot(0, &s,
31 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
32 | SLOT(main())
33 | #else
34 | &scheduler::main
35 | #endif
36 | );
37 |
38 | uchar rv(a.exec());
39 | return rv;
40 | }
41 |
--------------------------------------------------------------------------------
/systemback/sbscheduler/sbscheduler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "sbscheduler.hpp"
20 | #include
21 |
22 | void scheduler::main()
23 | {
24 | {
25 | QSL args(qApp->arguments());
26 |
27 | uchar rv(args.count() != 2 ? 1
28 | : sb::schdlr[1] != "false" && (sb::schdlr[1] == "everyone" || sb::right(sb::schdlr[1], -1).split(',').contains(args.at(1))) ? 2
29 | : getuid() + getgid() ? 3
30 | : sb::isfile("/cdrom/live/airoot.sfs") ? 4
31 | : ! sb::lock(sb::Schdlrlock) ? 5
32 | : daemon(0, 0) ? 6
33 | : [&]() -> uchar {
34 | sb::delay(100);
35 | return sb::lock(sb::Schdlrlock) && sb::crtfile(*(pfile = new QStr(sb::isdir("/run") ? "/run/sbscheduler.pid" : "/var/run/sbscheduler.pid")), QStr::number(qApp->applicationPid())) ? 0 : 255;
36 | }());
37 |
38 | if(rv)
39 | {
40 | if(rv < 255) sb::error("\n " % sb::tr("Cannot start the Systemback scheduler daemon!") % "\n\n " % [rv] {
41 | switch(rv) {
42 | case 1:
43 | return sb::tr("Missing, wrong or too much argument(s).");
44 | case 2:
45 | return sb::tr("The process is disabled for this user.");
46 | case 3:
47 | return sb::tr("Root privileges are required.");
48 | case 4:
49 | return sb::tr("This system is a Live.");
50 | case 5:
51 | return sb::tr("Already running.");
52 | default:
53 | return sb::tr("Unable to daemonize.");
54 | }
55 | }() % "\n\n");
56 |
57 | return qApp->exit(rv);
58 | }
59 | }
60 |
61 | QDateTime pflmd(QFileInfo(*pfile).lastModified());
62 | sleep(290);
63 |
64 | forever
65 | {
66 | sleep(10);
67 |
68 | if(! sb::isfile(*pfile) || (pflmd != QFileInfo(*pfile).lastModified() && sb::fload(*pfile) != QBA::number(qApp->applicationPid())))
69 | {
70 | sb::unlock(sb::Schdlrlock), sb::exec("sbscheduler " % qApp->arguments().at(1), sb::Silent | sb::Bckgrnd);
71 | break;
72 | }
73 |
74 | if(! sb::isfile(cfgfile) || cfglmd != QFileInfo(cfgfile).lastModified())
75 | sb::cfgread(),
76 | cfglmd = QFileInfo(cfgfile).lastModified();
77 |
78 | if(! (sb::isdir(sb::sdir[1]) && sb::access(sb::sdir[1], sb::Write)))
79 | sleep(50);
80 | else if(! sb::isfile(sb::sdir[1] % "/.sbschedule"))
81 | sb::crtfile(sb::sdir[1] % "/.sbschedule");
82 | else if(! sb::schdle[0])
83 | sleep(1790);
84 | else if(QFileInfo(sb::sdir[1] % "/.sbschedule").lastModified().secsTo(QDateTime::currentDateTime()) / 60 >= sb::schdle[1] * 1440 + sb::schdle[2] * 60 + sb::schdle[3] && sb::lock(sb::Sblock))
85 | {
86 | if(! sb::lock(sb::Alpmlock) || [] {
87 | sb::unlock(sb::Alpmlock);
88 | return true;
89 | }())
90 |
91 | sb::unlock(sb::Sblock);
92 | else
93 | {
94 | if(sb::schdle[5] || ! sb::execsrch("/usr/bin/systemback"))
95 | newrpnt();
96 | else
97 | {
98 | QStr xauth("/tmp/sbXauthority-" % sb::rndstr()), usrhm(qgetenv("HOME"));
99 |
100 | if((qEnvironmentVariableIsSet("XAUTHORITY") && QFile(qgetenv("XAUTHORITY")).copy(xauth)) || [&] {
101 | QStr path("/home/" % qApp->arguments().at(1) % "/.Xauthority");
102 | return (sb::isfile(path) && QFile(path).copy(xauth)) || (sb::isfile(path = usrhm % "/.Xauthority") && QFile(path).copy(xauth));
103 | }())
104 | sb::exec("/usr/bin/systemback schedule",
105 | sb::Wait, "XAUTHORITY=" % xauth),
106 | sb::rmfile(xauth);
107 | }
108 |
109 | sb::unlock(sb::Sblock), sb::unlock(sb::Alpmlock), sleep(50);
110 | }
111 | }
112 | }
113 |
114 | qApp->quit();
115 | }
116 |
117 | void scheduler::newrpnt()
118 | {
119 | sb::pupgrade();
120 |
121 | for(cQStr &item : QDir(sb::sdir[1]).entryList(QDir::Dirs | QDir::Hidden | QDir::NoSymLinks | QDir::NoDotAndDotDot))
122 | if(sb::like(item, {"_.DELETED_*", "_.S00_*"}) && ! sb::remove(sb::sdir[1] % '/' % item)) return;
123 |
124 | for(uchar a(9) ; a > 1 ; --a)
125 | if(! sb::pnames[a].isEmpty() && (a == 9 || a > 2 ? sb::pnumber < a + 2 : sb::pnumber == 3) && ! (QFile::rename(sb::sdir[1] % (a < 9 ? QStr("/S0" % QStr::number(a + 1)) : "/S10") % '_' % sb::pnames[a], sb::sdir[1] % "/.DELETED_" % sb::pnames[a]) && sb::remove(sb::sdir[1] % "/.DELETED_" % sb::pnames[a]))) return;
126 |
127 | QStr dtime(QDateTime().currentDateTime().toString("yyyy-MM-dd,hh.mm.ss"));
128 |
129 | if(sb::crtrpoint(dtime))
130 | {
131 | for(uchar a(0) ; a < 9 && sb::isdir(sb::sdir[1] % "/S0" % QStr::number(a + 1) % '_' % sb::pnames[a]) ; ++a)
132 | if(! QFile::rename(sb::sdir[1] % "/S0" % QStr::number(a + 1) % '_' % sb::pnames[a], sb::sdir[1] % (a < 8 ? "/S0" : "/S") % QStr::number(a + 2) % '_' % sb::pnames[a])) return;
133 |
134 | if(! QFile::rename(sb::sdir[1] % "/.S00_" % dtime, sb::sdir[1] % "/S01_" % dtime)) return;
135 | }
136 | else if(sb::dfree(sb::sdir[1]) < 204857600)
137 | sb::remove(sb::sdir[1] % "/.S00_" % dtime);
138 | else
139 | return;
140 |
141 | sb::crtfile(sb::sdir[1] % "/.sbschedule"), sb::fssync();
142 | if(sb::ecache) sb::crtfile("/proc/sys/vm/drop_caches", "3");
143 | }
144 |
--------------------------------------------------------------------------------
/systemback/sbscheduler/sbscheduler.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SBSCHEDULER_HPP
20 | #define SBSCHEDULER_HPP
21 |
22 | #include "../libsystemback/sblib.hpp"
23 | #include
24 | #include
25 |
26 | class scheduler : public QObject
27 | {
28 | Q_OBJECT
29 |
30 | public:
31 | inline scheduler() : pfile(nullptr) {}
32 | ~scheduler();
33 |
34 | static QDateTime cfglmd;
35 |
36 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
37 | public slots:
38 | #endif
39 | void main();
40 |
41 | private:
42 | QStr *pfile;
43 |
44 | void newrpnt();
45 | };
46 |
47 | inline scheduler::~scheduler()
48 | {
49 | if(pfile) delete pfile;
50 | }
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/systemback/sbscheduler/sbscheduler.pro:
--------------------------------------------------------------------------------
1 | QT -= gui
2 | QT += core
3 |
4 | TARGET = sbscheduler
5 |
6 | CONFIG -= app_bundle
7 | CONFIG += console \
8 | exceptions_off
9 |
10 | TEMPLATE = app
11 |
12 | DEFINES += _FILE_OFFSET_BITS=64
13 |
14 | SOURCES += main.cpp \
15 | sbscheduler.cpp
16 |
17 | HEADERS += sbscheduler.hpp
18 |
19 | QMAKE_CXXFLAGS += -g \
20 | -fno-rtti \
21 | -fvisibility=hidden \
22 | -fvisibility-inlines-hidden \
23 | -fno-asynchronous-unwind-tables
24 |
25 | CONFIG(debug, debug|release) {
26 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
27 | -Wshadow \
28 | -Werror
29 | }
30 |
31 | QMAKE_LFLAGS += -g \
32 | -Wl,-rpath=/usr/lib/systemback \
33 | -Wl,--as-needed \
34 | -fuse-ld=gold \
35 | -Wl,-z,relro
36 |
37 | ! equals(QMAKE_CXX, clang++) {
38 | QMAKE_CXXFLAGS += -flto
39 | QMAKE_LFLAGS += -flto
40 | }
41 |
42 | LIBS += -L../libsystemback \
43 | -lsystemback
44 |
45 | INCLUDEPATH = ../libsystemback
46 |
47 | # for arch linux with gcc 12
48 |
--------------------------------------------------------------------------------
/systemback/sbsustart/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "sbsustart.hpp"
20 | #include
21 |
22 | uint sustart::uid(getuid());
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | #if QT_VERSION >= QT_VERSION_CHECK(5, 3, 0)
27 | if(sustart::uid && setuid(0) && sustart::uid != geteuid())
28 | {
29 | QStr arg1(argv[1]);
30 |
31 | if(! sb::like(arg1, {"_systemback_", "_scheduler_"}))
32 | {
33 | sb::error("\n Missing, wrong or too much argument(s).\n\n");
34 | return 2;
35 | }
36 |
37 | QStr emsg("Cannot start Systemback " % QStr(arg1 == "systemback" ? "graphical user interface" : "scheduler daemon") % "!\n\nUnable to get root permissions.");
38 |
39 | if(seteuid(sustart::uid))
40 | sb::error("\n " % emsg.replace("\n\n", "\n\n ") % "\n\n");
41 | else
42 | sb::exec((sb::execsrch("zenity") ? "zenity --title=Systemback --error --text=\"" : "kdialog --title=Systemback --error=\"") % emsg % '\"', sb::Bckgrnd);
43 |
44 | return 1;
45 | }
46 | #endif
47 |
48 | QCoreApplication a(argc, argv);
49 | if(sb::dbglev) sb::dbglev = sb::Nodbg;
50 | sb::ldtltr();
51 | sustart s;
52 |
53 | QTimer::singleShot(0, &s,
54 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
55 | SLOT(main())
56 | #else
57 | &sustart::main
58 | #endif
59 | );
60 |
61 | uchar rv(a.exec());
62 | return rv;
63 | }
64 |
--------------------------------------------------------------------------------
/systemback/sbsustart/sbsustart.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "sbsustart.hpp"
20 | #include
21 |
22 | void sustart::main()
23 | {
24 | bool silent;
25 |
26 | {
27 | QSL args(qApp->arguments());
28 |
29 | uchar mode([&] {
30 | switch(args.count()) {
31 | case 1:
32 | if(args.at(0).endsWith("systemback-sustart"))
33 | {
34 | silent = false;
35 | return Systemback;
36 | }
37 |
38 | break;
39 | case 2 ... 3:
40 | silent = true;
41 |
42 | if(args.at(1) == "systemback")
43 | return Systemback;
44 | else if(args.at(1) == "finstall")
45 | return Finstall;
46 | else if(args.at(1) == "scheduler")
47 | return Scheduler;
48 | }
49 |
50 | return Unknown;
51 | }()), rv(mode ? [&, mode] {
52 | QStr uname, usrhm;
53 |
54 | if(! uid)
55 | uname = "root", usrhm = "/root";
56 | else
57 | {
58 | QFile file("/etc/passwd");
59 |
60 | if(sb::fopen(file))
61 | while(! file.atEnd())
62 | {
63 | QStr line(file.readLine().trimmed());
64 |
65 | if(line.contains("x:" % QStr::number(uid) % ':'))
66 | {
67 | QSL uslst(line.split(':'));
68 | uname = uslst.at(0), usrhm = uslst.at(5);
69 | break;
70 | }
71 | }
72 |
73 | if(uname.isEmpty() || usrhm.isEmpty()) return 3;
74 | }
75 |
76 | bool uidinr(getuid()), gidinr(getgid());
77 |
78 | if(uidinr || gidinr)
79 | {
80 | if((uidinr && setuid(0)) || (gidinr && setgid(0))) return 3;
81 |
82 | auto clrenv([](cQBA &uhm, cQStr &xpath = nullptr) {
83 | QSL excl{"_DISPLAY_", "_PATH_", "_LANG_", "_XAUTHORITY_", "_DBGLEV_"};
84 |
85 | for(cQStr &cvar : QProcess::systemEnvironment())
86 | {
87 | QStr var(sb::left(cvar, sb::instr(cvar, "=") - 1));
88 | if(! (sb::like(var, excl) || qunsetenv(bstr(var)))) return false;
89 | }
90 |
91 | if(! (qputenv("USER", "root") && qputenv("HOME", uhm) && qputenv("LOGNAME", "root") && qputenv("SHELL", "/bin/bash") && (xpath.isEmpty() || qputenv("XAUTHORITY", xpath.toUtf8())))) return false;
92 | return true;
93 | });
94 |
95 | if(mode == Scheduler)
96 | {
97 | if(! clrenv(usrhm.toUtf8())) return 3;
98 | cmd = new QStr("sbscheduler " % uname);
99 | }
100 | else
101 | {
102 | QStr xauth("/tmp/sbXauthority-" % sb::rndstr());
103 | if((qEnvironmentVariableIsEmpty("XAUTHORITY") || ! QFile(qgetenv("XAUTHORITY")).copy(xauth)) && ! ((sb::isfile("/home/" % uname % "/.Xauthority") && QFile("/home/" % uname % "/.Xauthority").copy(xauth)) || (sb::isfile(usrhm % "/.Xauthority") && QFile(usrhm % "/.Xauthority").copy(xauth)))) return 4;
104 | if(! clrenv("/root", xauth)) return 3;
105 | cmd = new QStr("systemback " % (mode == Finstall ? QStr("finstall ") : "authorization " % uname));
106 | }
107 | }
108 | else
109 | cmd = new QStr(mode == Scheduler ? [&]() -> QStr {
110 | qputenv("HOME", usrhm.toUtf8());
111 | return "sbscheduler " % uname;
112 | }() : "systemback" % QStr(mode == Finstall ? " finstall" : nullptr));
113 |
114 | return 0;
115 | }() : 2);
116 |
117 | if(rv)
118 | {
119 | if(rv == 2)
120 | sb::error("\n " % sb::tr("Missing, wrong or too much argument(s).") % "\n\n");
121 | else
122 | {
123 | QStr emsg((mode == Scheduler ? sb::tr("Cannot start the Systemback scheduler daemon!") : sb::tr("Cannot start the Systemback graphical user interface!")) % "\n\n" % (rv == 3 ? sb::tr("Unable to get root permissions.") : sb::tr("Unable to connect to the X server.")));
124 |
125 | #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
126 | if(uid != geteuid() && seteuid(uid))
127 | sb::error("\n " % emsg.replace("\n\n", "\n\n ") % "\n\n");
128 | else
129 | #endif
130 | sb::exec((sb::execsrch("zenity") ? "zenity --title=Systemback --error --text=\"" : "kdialog --title=Systemback --error=\"") % emsg % '\"', sb::Bckgrnd);
131 | }
132 |
133 | return qApp->exit(rv);
134 | }
135 |
136 | if(args.count() == 3 && args.at(2) == "gtk+") qputenv("QT_STYLE_OVERRIDE", "gtk+");
137 | }
138 |
139 | qApp->exit(silent ? sb::exec(*cmd, sb::Silent | sb::Wait, "DBGLEV=0") : sb::exec(*cmd, sb::Wait));
140 | }
141 |
--------------------------------------------------------------------------------
/systemback/sbsustart/sbsustart.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SBSUSTART_HPP
20 | #define SBSUSTART_HPP
21 |
22 | #include "../libsystemback/sblib.hpp"
23 | #include
24 |
25 | class sustart : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | inline sustart() : cmd(nullptr) {}
31 | ~sustart();
32 |
33 | static uint uid;
34 |
35 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
36 | public slots:
37 | #endif
38 | void main();
39 |
40 | private:
41 | enum { Unknown = 0, Systemback = 1, Finstall = 2, Scheduler = 3 };
42 |
43 | QStr *cmd;
44 | };
45 |
46 | inline sustart::~sustart()
47 | {
48 | if(cmd) delete cmd;
49 | }
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/systemback/sbsustart/sbsustart.pro:
--------------------------------------------------------------------------------
1 | QT -= gui
2 | QT += core
3 |
4 | TARGET = sbsustart
5 |
6 | CONFIG -= app_bundle
7 | CONFIG += console \
8 | exceptions_off
9 |
10 | TEMPLATE = app
11 |
12 | DEFINES += _FILE_OFFSET_BITS=64
13 |
14 | SOURCES += main.cpp \
15 | sbsustart.cpp
16 |
17 | HEADERS += sbsustart.hpp
18 |
19 | QMAKE_CXXFLAGS += -g \
20 | -fno-rtti \
21 | -fvisibility=hidden \
22 | -fvisibility-inlines-hidden \
23 | -fno-asynchronous-unwind-tables
24 |
25 | CONFIG(debug, debug|release) {
26 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
27 | -Wshadow \
28 | -Werror
29 | }
30 |
31 | QMAKE_LFLAGS += -g \
32 | -Wl,-rpath=/usr/lib/systemback \
33 | -Wl,--as-needed \
34 | -fuse-ld=gold \
35 | -Wl,-z,relro
36 |
37 | ! equals(QMAKE_CXX, clang++) {
38 | QMAKE_CXXFLAGS += -flto
39 | QMAKE_LFLAGS += -flto
40 | }
41 |
42 | LIBS += -L../libsystemback \
43 | -lsystemback
44 |
45 | INCLUDEPATH = ../libsystemback
46 |
47 | # for arch linux with gcc 12
48 |
--------------------------------------------------------------------------------
/systemback/sbsysupgrade/sbsysupgrade.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "../libsystemback/sblib.hpp"
20 |
21 | int main(int argc, char *argv[])
22 | {
23 | QCoreApplication a(argc, argv);
24 | sb::ldtltr(), sb::supgrade();
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/systemback/sbsysupgrade/sbsysupgrade.pro:
--------------------------------------------------------------------------------
1 | QT -= gui
2 | QT += core
3 |
4 | TARGET = sbsysupgrade
5 |
6 | CONFIG -= app_bundle
7 | CONFIG += console \
8 | exceptions_off
9 |
10 | TEMPLATE = app
11 |
12 | DEFINES += _FILE_OFFSET_BITS=64
13 |
14 | SOURCES += sbsysupgrade.cpp
15 |
16 | QMAKE_CXXFLAGS += -g \
17 | -fno-rtti \
18 | -fvisibility=hidden \
19 | -fvisibility-inlines-hidden \
20 | -fno-asynchronous-unwind-tables
21 |
22 | CONFIG(debug, debug|release) {
23 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
24 | -Wshadow \
25 | -Werror
26 | }
27 |
28 | QMAKE_LFLAGS += -g \
29 | -Wl,-rpath=/usr/lib/systemback \
30 | -Wl,--as-needed \
31 | -fuse-ld=gold \
32 | -Wl,-z,relro
33 |
34 | ! equals(QMAKE_CXX, clang++) {
35 | QMAKE_CXXFLAGS += -flto
36 | QMAKE_LFLAGS += -flto
37 | }
38 |
39 | LIBS += -L../libsystemback \
40 | -lsystemback
41 |
42 | # for arch linux with gcc 12
43 |
--------------------------------------------------------------------------------
/systemback/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/splash.png
--------------------------------------------------------------------------------
/systemback/splash.png.old:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/splash.png.old
--------------------------------------------------------------------------------
/systemback/systemback-cli/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "systemback-cli.hpp"
20 |
21 | int main(int argc, char *argv[])
22 | {
23 | switch(sb::dbglev) {
24 | case sb::Alldbg:
25 | sb::dbglev = sb::Nulldbg;
26 | break;
27 | case sb::Extdbg:
28 | sb::dbglev = sb::Cextdbg;
29 | }
30 |
31 | QCoreApplication a(argc, argv);
32 | sb::ldtltr();
33 | systemback c;
34 |
35 | QTimer::singleShot(0, &c,
36 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
37 | SLOT(main())
38 | #else
39 | &systemback::main
40 | #endif
41 | );
42 |
43 | uchar rv(a.exec());
44 | return rv;
45 | }
46 |
--------------------------------------------------------------------------------
/systemback/systemback-cli/systemback-cli.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "systemback-cli.hpp"
20 | #include
21 | #include
22 | #include
23 | // #include
24 | #include
25 |
26 | #ifdef timeout
27 | #undef timeout
28 | #endif
29 |
30 | #ifdef instr
31 | #undef instr
32 | #endif
33 |
34 | void systemback::main()
35 | {
36 | auto help([]
37 | { return tr("Usage: systemback-cli [option]\n\n"
38 | " Options:\n\n"
39 | " -n, --newbackup create a new restore point\n\n"
40 | " -s, --storagedir get or set the restore points storage directory path\n\n"
41 | " -u, --upgrade upgrade the current system\n"
42 | " remove the unnecessary files and packages\n\n"
43 | " -v, --version output the Systemback version number\n\n"
44 | " -h, --help show this help"); });
45 |
46 | uchar rv([&]
47 | {
48 | QSL args(qApp->arguments());
49 |
50 | if(args.count() == 1 || [&] {
51 | if(sb::like(args.at(1), {"_-h_", "_--help_"}))
52 | sb::print("\n " % help() % "\n\n");
53 | else if(sb::like(args.at(1), {"_-v_", "_--version_"}))
54 | sb::print("\n " % sb::appver() % "\n\n");
55 | else
56 | return true;
57 |
58 | return false;
59 | }()) return sb::isfile("/cdrom/live/airoot.sfs") ? 2
60 | : getuid() + getgid() ? 3
61 | : ! sb::lock(sb::Sblock) ? 4
62 | : ! sb::lock(sb::Alpmlock) ? 5
63 | : [&] {
64 | auto startui([this](bool crtrpt = false) -> uchar {
65 | if(! (isatty(fileno(stdin)) && isatty(fileno(stdout)) && isatty(fileno(stderr)))) return 255;
66 | initscr();
67 |
68 | uchar crv(! has_colors() ? 7
69 | : LINES < 24 || COLS < 80 ? 8
70 | : [crtrpt, this]() -> uchar {
71 | noecho(),
72 | raw(),
73 | curs_set(0),
74 | attron(A_BOLD),
75 | start_color(),
76 | assume_default_colors(COLOR_BLUE, COLOR_BLACK),
77 | init_pair(1, COLOR_WHITE, COLOR_BLACK),
78 | init_pair(2, COLOR_BLUE, COLOR_BLACK),
79 | init_pair(3, COLOR_GREEN, COLOR_BLACK),
80 | init_pair(4, COLOR_YELLOW, COLOR_BLACK),
81 | init_pair(5, COLOR_RED, COLOR_BLACK),
82 | sbtxt = bstr("Systemback " % tr("basic restore UI")), blgn = COLS / 2 - 6 - tr("basic restore UI").length() / 2;
83 | if(! crtrpt) return clistart();
84 | sb::pupgrade();
85 | return newrpnt() ? 0 : sb::dfree(sb::sdir[1]) < 204857600 ? 12 : 13;
86 | }());
87 |
88 | endwin();
89 | return crv;
90 | });
91 |
92 | return args.count() == 1 ? startui()
93 | : sb::like(args.at(1), {"_-n_", "_--newrestorepoint_"}) ? sb::isdir(sb::sdir[1]) && sb::access(sb::sdir[1], sb::Write) ? startui(true) : 14
94 | : sb::like(args.at(1), {"_-s_", "_--storagedir_"}) ? storagedir(args)
95 | : sb::like(args.at(1), {"_-u_", "_--upgrade_"}) ? [] {
96 | sb::unlock(sb::Alpmlock),
97 | sb::supgrade();
98 | return 0;
99 | }() : 1;
100 | }();
101 |
102 | return 0; }());
103 |
104 | if (!sb::like(rv, {0, 255}))
105 | sb::error("\n " % [=]() -> QStr
106 | {
107 | auto dbg([](cQStr &txt)
108 | {
109 | if(! sb::eout.isEmpty()) sb::crtfile("/tmp/systemback-cli_stderr", QStr((sb::dbglev == sb::sb::Cextdbg ? sb::dbginf() : nullptr) % sb::eout).trimmed().replace("\n\n\n", "\n\n").replace("\n ", "\n") % '\n');
110 | return txt; });
111 |
112 | switch (rv)
113 | {
114 | case 1:
115 | return help();
116 | case 2:
117 | return tr("The Systemback command line interface cannot be used on a Live system!");
118 | case 3:
119 | return tr("Root privileges are required for running the Systemback!");
120 | case 4:
121 | return tr("An another Systemback process is currently running, please wait until it finishes.");
122 | case 5:
123 | return tr("Unable to get exclusive lock!") % "\n\n " % tr("First, close all package manager.");
124 | case 6:
125 | return tr("The re-synchronization of package index files currently in progress, please wait until it finishes.");
126 | case 7:
127 | return tr("This stupid terminal does not support color!");
128 | case 8:
129 | return tr("This terminal is too small!") % " (< 80x24)";
130 | case 9:
131 | return tr("The specified storage directory path has not been set!");
132 | case 10:
133 | return tr("The restoration is aborted!");
134 | case 11:
135 | return dbg(tr("The restoration is completed, but an error occurred while reinstalling the GRUB!"));
136 | case 12:
137 | return dbg(tr("The restore point creation is aborted!") % "\n\n " % tr("Not enough free disk space to complete the process."));
138 | case 13:
139 | return dbg(tr("The restore point creation is aborted!") % "\n\n " % tr("There has been critical changes in the file system during this operation."));
140 | case 14:
141 | return dbg(tr("The restore points storage directory is not available or not writable!"));
142 | default:
143 | return dbg(tr("The restore point deletion is aborted!") % "\n\n " % tr("An error occurred while during the process."));
144 | }
145 | }() %
146 | "\n\n");
147 |
148 | qApp->exit(rv);
149 | }
150 |
151 | uchar systemback::clistart()
152 | {
153 | mvprintw(0, blgn, "%s", sbtxt.data),
154 | attron(COLOR_PAIR(1)),
155 | printw("%s", bstr("\n\n " % tr("Available restore point(s):") % "\n\n").data),
156 | sb::pupgrade(),
157 | attron(COLOR_PAIR(3));
158 | if (!sb::pnames[0].isEmpty())
159 | printw("%s", bstr(" 1 ─ " % sb::left(sb::pnames[0], COLS - 7) % '\n').data);
160 | if (!sb::pnames[1].isEmpty())
161 | printw("%s", bstr(" 2 ─ " % sb::left(sb::pnames[1], COLS - 7) % '\n').data);
162 | if (sb::pnumber == 3)
163 | attron(COLOR_PAIR(5));
164 | if (!sb::pnames[2].isEmpty())
165 | printw("%s", bstr(" 3 ─ " % sb::left(sb::pnames[2], COLS - 7) % '\n').data);
166 | if (sb::pnumber == 4)
167 | attron(COLOR_PAIR(5));
168 | if (!sb::pnames[3].isEmpty())
169 | printw("%s", bstr(" 4 ─ " % sb::left(sb::pnames[3], COLS - 7) % '\n').data);
170 | if (sb::pnumber == 5)
171 | attron(COLOR_PAIR(5));
172 | if (!sb::pnames[4].isEmpty())
173 | printw("%s", bstr(" 5 ─ " % sb::left(sb::pnames[4], COLS - 7) % '\n').data);
174 | if (sb::pnumber == 6)
175 | attron(COLOR_PAIR(5));
176 | if (!sb::pnames[5].isEmpty())
177 | printw("%s", bstr(" 6 ─ " % sb::left(sb::pnames[5], COLS - 7) % '\n').data);
178 | if (sb::pnumber == 7)
179 | attron(COLOR_PAIR(5));
180 | if (!sb::pnames[6].isEmpty())
181 | printw("%s", bstr(" 7 ─ " % sb::left(sb::pnames[6], COLS - 7) % '\n').data);
182 | if (sb::pnumber == 8)
183 | attron(COLOR_PAIR(5));
184 | if (!sb::pnames[7].isEmpty())
185 | printw("%s", bstr(" 8 ─ " % sb::left(sb::pnames[7], COLS - 7) % '\n').data);
186 | if (sb::pnumber == 9)
187 | attron(COLOR_PAIR(5));
188 | if (!sb::pnames[8].isEmpty())
189 | printw("%s", bstr(" 9 ─ " % sb::left(sb::pnames[8], COLS - 7) % '\n').data);
190 | if (sb::pnumber == 10)
191 | attron(COLOR_PAIR(5));
192 | if (!sb::pnames[9].isEmpty())
193 | printw("%s", bstr(" A ─ " % sb::left(sb::pnames[9], COLS - 7) % '\n').data);
194 | attron(COLOR_PAIR(3));
195 | if (!sb::pnames[10].isEmpty())
196 | printw("%s", bstr(" B ─ " % sb::left(sb::pnames[10], COLS - 7) % '\n').data);
197 | if (!sb::pnames[11].isEmpty())
198 | printw("%s", bstr(" C ─ " % sb::left(sb::pnames[11], COLS - 7) % '\n').data);
199 | if (!sb::pnames[12].isEmpty())
200 | printw("%s", bstr(" D ─ " % sb::left(sb::pnames[12], COLS - 7) % '\n').data);
201 | if (!sb::pnames[13].isEmpty())
202 | printw("%s", bstr(" E ─ " % sb::left(sb::pnames[13], COLS - 7) % '\n').data);
203 | if (!sb::pnames[14].isEmpty())
204 | printw("%s", bstr(" F ─ " % sb::left(sb::pnames[14], COLS - 7) % '\n').data);
205 | printw("%s", bstr("\n G ─ " % tr("Create new") % "\n Q ─ " % tr("Quit") % '\n').data),
206 | attron(COLOR_PAIR(2)),
207 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
208 | refresh();
209 | if (!sb::eout.isEmpty())
210 | sb::eout.clear();
211 | if (!pname.isEmpty())
212 | pname.clear();
213 |
214 | do
215 | {
216 | int gtch(getch());
217 |
218 | switch (gtch)
219 | {
220 | case '1' ... '9':
221 | {
222 | QStr cstr(gtch);
223 | cpoint = "S0" % cstr;
224 | uchar num(cstr.toUShort() - 1);
225 | if (!sb::pnames[num].isEmpty())
226 | pname = sb::pnames[num];
227 | break;
228 | }
229 | case 'a':
230 | case 'A':
231 | cpoint = "S10";
232 | if (!sb::pnames[9].isEmpty())
233 | pname = sb::pnames[9];
234 | break;
235 | case 'b':
236 | case 'B':
237 | cpoint = "H01";
238 | if (!sb::pnames[10].isEmpty())
239 | pname = sb::pnames[10];
240 | break;
241 | case 'c':
242 | case 'C':
243 | cpoint = "H02";
244 | if (!sb::pnames[11].isEmpty())
245 | pname = sb::pnames[11];
246 | break;
247 | case 'd':
248 | case 'D':
249 | cpoint = "H03";
250 | if (!sb::pnames[12].isEmpty())
251 | pname = sb::pnames[12];
252 | break;
253 | case 'e':
254 | case 'E':
255 | cpoint = "H04";
256 | if (!sb::pnames[13].isEmpty())
257 | pname = sb::pnames[13];
258 | break;
259 | case 'f':
260 | case 'F':
261 | cpoint = "H05";
262 | if (!sb::pnames[14].isEmpty())
263 | pname = sb::pnames[14];
264 | break;
265 | case 'g':
266 | case 'G':
267 | if (!newrpnt())
268 | return sb::dfree(sb::sdir[1]) < 204857600 ? 12 : 13;
269 | clear();
270 | return clistart();
271 | case 'q':
272 | case 'Q':
273 | return 0;
274 | }
275 | } while (pname.isEmpty());
276 |
277 | clear(),
278 | mvprintw(0, blgn, "%s", sbtxt.data),
279 | attron(COLOR_PAIR(1)),
280 | printw("%s", bstr("\n\n " % tr("Selected restore point:")).data),
281 | attron(COLOR_PAIR(4)),
282 | printw("%s", bstr("\n\n " % sb::left(pname, COLS - 3)).data),
283 | attron(COLOR_PAIR(3)),
284 | printw("%s", bstr("\n\n 1 ─ " % tr("Delete") % "\n 2 ─ " % tr("System restore") % " ▸\n B ─ ◂ " % tr("Back")).data),
285 | attron(COLOR_PAIR(2)),
286 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
287 | refresh();
288 |
289 | forever switch (getch())
290 | {
291 | case '1':
292 | pset(2), progress(Start);
293 |
294 | if (!(sb::rename(sb::sdir[1] % '/' % cpoint % '_' % pname, sb::sdir[1] % "/.DELETED_" % pname) && sb::remove(sb::sdir[1] % "/.DELETED_" % pname)))
295 | {
296 | progress(Stop);
297 | return 15;
298 | }
299 |
300 | emptycache(),
301 | progress(Stop),
302 | clear();
303 | return clistart();
304 | case '2':
305 | clear();
306 | return restore();
307 | case 'b':
308 | case 'B':
309 | clear();
310 | return clistart();
311 | }
312 | }
313 |
314 | uchar systemback::storagedir(cQSL &args)
315 | {
316 | if (args.count() == 2)
317 | sb::print("\n " % sb::sdir[0] % "\n\n");
318 | else
319 | {
320 | QStr ndir;
321 |
322 | {
323 | QStr cpath, idir(args.at(2));
324 |
325 | if (args.count() > 3)
326 | for (uchar a(3); a < args.count(); ++a)
327 | idir.append(' ' % args.at(a));
328 |
329 | QSL excl{"*/Systemback_", "*/Systemback/*", "*/_", "_/bin_", "_/bin/*", "_/boot_", "_/boot/*", "_/cdrom_", "_/cdrom/*", "_/dev_", "_/dev/*", "_/etc_", "_/etc/*", "_/lib_", "_/lib/*", "_/lib32_", "_/lib32/*", "_/lib64_", "_/lib64/*", "_/opt_", "_/opt/*", "_/proc_", "_/proc/*", "_/root_", "_/root/*", "_/run_", "_/run/*", "_/sbin_", "_/sbin/*", "_/selinux_", "_/selinux/*", "_/snap_", "_/snap/*", "_/srv_", "_/srv/*_", "_/sys_", "_/sys/*", "_/tmp_", "_/tmp/*", "_/usr_", "_/usr/*", "_/var_", "_/var/*"};
330 | if (sb::like(ndir = QDir::cleanPath(idir), excl) || sb::like(cpath = QDir(idir).canonicalPath(), excl) || sb::like(sb::fload("/etc/passwd"), {"*:" % idir % ":*", "*:" % ndir % ":*", "*:" % cpath % ":*"}) || !sb::islnxfs(cpath))
331 | return 9;
332 | }
333 |
334 | if (sb::sdir[0] != ndir)
335 | {
336 | if (sb::isdir(sb::sdir[1]))
337 | {
338 | QSL dlst(QDir(sb::sdir[1]).entryList(QDir::AllEntries | QDir::Hidden | QDir::NoDotAndDotDot));
339 |
340 | if (!dlst.count())
341 | rmdir(bstr(sb::sdir[1]));
342 | else if (dlst.count() == 1 && sb::isfile(sb::sdir[1] % "/.sbschedule"))
343 | sb::remove(sb::sdir[1]);
344 | }
345 |
346 | sb::sdir[0] = ndir, sb::sdir[1] = sb::sdir[0] % "/Systemback", sb::ismpnt = !sb::issmfs(sb::sdir[0], sb::sdir[0].count('/') == 1 ? "/" : sb::left(sb::sdir[0], sb::rinstr(sb::sdir[0], "/") - 1));
347 | if (!sb::cfgwrite())
348 | return 9;
349 | }
350 |
351 | if (!(sb::isdir(sb::sdir[1]) || sb::crtdir(sb::sdir[1])))
352 | sb::rename(sb::sdir[1], sb::sdir[1] % '_' % sb::rndstr()),
353 | sb::crtdir(sb::sdir[1]);
354 |
355 | if (!sb::isfile(sb::sdir[1] % "/.sbschedule"))
356 | sb::crtfile(sb::sdir[1] % "/.sbschedule");
357 | sb::print("\n " % twrp(tr("The specified storage directory path is set.")) % "\n\n");
358 | }
359 |
360 | return 0;
361 | }
362 |
363 | void systemback::emptycache()
364 | {
365 | pset(1),
366 | sb::fssync();
367 | if (sb::ecache)
368 | sb::crtfile("/proc/sys/vm/drop_caches", "3");
369 | }
370 |
371 | bool systemback::newrpnt()
372 | {
373 | auto end([this](bool rv = true)
374 | {
375 | progress(Stop);
376 | return rv; });
377 |
378 | progress(Start);
379 |
380 | for (cQStr &item : QDir(sb::sdir[1]).entryList(QDir::Dirs | QDir::Hidden | QDir::NoSymLinks | QDir::NoDotAndDotDot))
381 | if (sb::like(item, {"_.DELETED_*", "_.S00_*"}))
382 | {
383 | if (prun.type != 3)
384 | pset(3);
385 | if (!sb::remove(sb::sdir[1] % '/' % item))
386 | return end(false);
387 | }
388 |
389 | for (uchar a(9); a > 1; --a)
390 | if (!sb::pnames[a].isEmpty() && (a == 9 || a > 2 ? sb::pnumber < a + 2 : sb::pnumber == 3))
391 | {
392 | if (prun.type != 4)
393 | pset(4);
394 | if (!(sb::rename(sb::sdir[1] % (a < 9 ? QStr("/S0" % QStr::number(a + 1)) : "/S10") % '_' % sb::pnames[a], sb::sdir[1] % "/.DELETED_" % sb::pnames[a]) && sb::remove(sb::sdir[1] % "/.DELETED_" % sb::pnames[a])))
395 | return end(false);
396 | }
397 |
398 | pset(5);
399 | QStr dtime(QDateTime().currentDateTime().toString("yyyy-MM-dd,hh.mm.ss"));
400 | if (!sb::crtrpoint(dtime))
401 | return end(false);
402 |
403 | for (uchar a(0); a < 9 && sb::isdir(sb::sdir[1] % "/S0" % QStr::number(a + 1) % '_' % sb::pnames[a]); ++a)
404 | if (!sb::rename(sb::sdir[1] % "/S0" % QStr::number(a + 1) % '_' % sb::pnames[a], sb::sdir[1] % (a < 8 ? "/S0" : "/S") % QStr::number(a + 2) % '_' % sb::pnames[a]))
405 | return end(false);
406 |
407 | if (!sb::rename(sb::sdir[1] % "/.S00_" % dtime, sb::sdir[1] % "/S01_" % dtime))
408 | return end(false);
409 | sb::crtfile(sb::sdir[1] % "/.sbschedule"),
410 | emptycache();
411 | return end();
412 | }
413 |
414 | uchar systemback::restore()
415 | {
416 | mvprintw(0, blgn, "%s", sbtxt.data),
417 | attron(COLOR_PAIR(1));
418 | uchar mthd(0), fsave(0), greinst(0);
419 |
420 | {
421 | bstr rtxt[3]{bstr("\n\n " % tr("Restore with the following restore point:")), bstr("\n\n " % pname), bstr("\n\n " % tr("Restore with the following restore method:"))};
422 | printw("%s", rtxt[0].data),
423 | attron(COLOR_PAIR(4)),
424 | printw("%s", rtxt[1].data),
425 | attron(COLOR_PAIR(1)),
426 | printw("%s", rtxt[2].data),
427 | attron(COLOR_PAIR(3)),
428 | printw("%s", bstr("\n\n 1 ─ " % tr("Full restore") % "\n 2 ─ " % tr("System files restore")).data),
429 | attron(COLOR_PAIR(1)),
430 | printw("%s", bstr("\n\n " % tr("Users configuration files restore")).data),
431 | attron(COLOR_PAIR(3)),
432 | printw("%s", bstr("\n\n 3 ─ " % tr("Complete configuration files restore") % "\n 4 ─ " % tr("Keep newly installed configuration files") % "\n\n C ─ " % tr("Cancel")).data),
433 | attron(COLOR_PAIR(2)),
434 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
435 | refresh();
436 |
437 | do
438 | {
439 | int gtch(getch());
440 |
441 | switch (gtch)
442 | {
443 | case 'c':
444 | case 'C':
445 | clear();
446 | return clistart();
447 | case '1' ... '4':
448 | mthd = QStr(gtch).toUShort();
449 | }
450 | } while (!mthd);
451 |
452 | clear(),
453 | mvprintw(0, blgn, "%s", sbtxt.data),
454 | attron(COLOR_PAIR(1)),
455 | printw("%s", rtxt[0].data),
456 | attron(COLOR_PAIR(4)),
457 | printw("%s", rtxt[1].data),
458 | attron(COLOR_PAIR(1)),
459 | printw("%s", rtxt[2].data),
460 | attron(COLOR_PAIR(4));
461 |
462 | printw("%s", bstr("\n\n " % [mthd]
463 | {
464 | switch(mthd) {
465 | case 1:
466 | return tr("Full restore");
467 | case 2:
468 | return tr("System files restore");
469 | case 3:
470 | return tr("Complete configuration files restore");
471 | default:
472 | return tr("Configuration files restore");
473 | } }()).data);
474 |
475 | attron(COLOR_PAIR(3));
476 |
477 | if (mthd < 3)
478 | {
479 | if (sb::isfile("/etc/fstab"))
480 | {
481 | printw("%s", bstr("\n\n " % tr("You want to keep the current fstab file?") % ' ' % tr("(Y/N)")).data),
482 | attron(COLOR_PAIR(2)),
483 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
484 | refresh();
485 |
486 | do
487 | {
488 | QChar gtch(getch());
489 |
490 | if (sb::like(gtch.toUpper(), {"_Y_", '_' % yn[0] % '_'}))
491 | fsave = 1;
492 | else if (sb::like(gtch.toUpper(), {"_N_", '_' % yn[1] % '_'}))
493 | fsave = 2;
494 | } while (!fsave);
495 |
496 | clear(),
497 | mvprintw(0, blgn, "%s", sbtxt.data),
498 | attron(COLOR_PAIR(1)),
499 | printw("%s", rtxt[0].data),
500 | attron(COLOR_PAIR(4)),
501 | printw("%s", rtxt[1].data),
502 | attron(COLOR_PAIR(1)),
503 | printw("%s", rtxt[2].data),
504 | attron(COLOR_PAIR(4)),
505 | printw("%s", bstr("\n\n " % (mthd == 1 ? tr("Full restore") : tr("System files restore")) % "\n\n " % tr("You want to keep the current fstab file?") % ' ' % tr("(Y/N)") % ' ' % yn[fsave == 1 ? 0 : 1]).data),
506 | attron(COLOR_PAIR(3));
507 |
508 | if (sb::execsrch("update-grub", sb::sdir[1] % '/' % cpoint % '_' % pname))
509 | {
510 | printw("%s", bstr("\n\n " % tr("Reinstall the GRUB 2 bootloader?") % ' ' % tr("(Y/N)")).data),
511 | attron(COLOR_PAIR(2)),
512 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
513 | refresh();
514 |
515 | do
516 | {
517 | QChar gtch(getch());
518 |
519 | if (sb::like(gtch.toUpper(), {"_Y_", '_' % yn[0] % '_'}))
520 | greinst = 1;
521 | else if (sb::like(gtch.toUpper(), {"_N_", '_' % yn[1] % '_'}))
522 | greinst = 2;
523 | } while (!greinst);
524 |
525 | clear(),
526 | mvprintw(0, blgn, "%s", sbtxt.data),
527 | attron(COLOR_PAIR(1)),
528 | printw("%s", rtxt[0].data),
529 | attron(COLOR_PAIR(4)),
530 | printw("%s", rtxt[1].data),
531 | attron(COLOR_PAIR(1)),
532 | printw("%s", rtxt[2].data),
533 | attron(COLOR_PAIR(4)),
534 | printw("%s", bstr("\n\n " % (mthd == 1 ? tr("Full restore") : tr("System files restore")) % "\n\n " % tr("You want to keep the current fstab file?") % ' ' % tr("(Y/N)") % ' ' % yn[fsave == 1 ? 0 : 1] % "\n\n " % tr("Reinstall the GRUB 2 bootloader?") % ' ' % tr("(Y/N)") % ' ' % yn[greinst == 1 ? 0 : 1]).data);
535 | }
536 | }
537 | else if (sb::execsrch("update-grub", sb::sdir[1] % '/' % cpoint % '_' % pname))
538 | {
539 | printw("%s", bstr("\n\n " % tr("Reinstall the GRUB 2 bootloader?") % ' ' % tr("(Y/N)")).data),
540 | attron(COLOR_PAIR(2)),
541 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
542 | refresh();
543 |
544 | do
545 | {
546 | QChar gtch(getch());
547 |
548 | if (sb::like(gtch.toUpper(), {"_Y_", '_' % yn[0] % '_'}))
549 | greinst = 1;
550 | else if (sb::like(gtch.toUpper(), {"_N_", '_' % yn[1] % '_'}))
551 | greinst = 2;
552 | } while (!greinst);
553 |
554 | clear(),
555 | mvprintw(0, blgn, "%s", sbtxt.data),
556 | attron(COLOR_PAIR(1)),
557 | printw("%s", rtxt[0].data),
558 | attron(COLOR_PAIR(4)),
559 | printw("%s", rtxt[1].data),
560 | attron(COLOR_PAIR(1)),
561 | printw("%s", rtxt[2].data),
562 | attron(COLOR_PAIR(4)),
563 | printw("%s", bstr("\n\n " % (mthd == 1 ? tr("Full restore") : tr("System files restore")) % "\n\n " % tr("Reinstall the GRUB 2 bootloader?") % ' ' % tr("(Y/N)") % ' ' % yn[greinst == 1 ? 0 : 1]).data);
564 | }
565 | }
566 | }
567 |
568 | attron(COLOR_PAIR(3)),
569 | printw("%s", bstr("\n\n " % tr("Start the restore?") % ' ' % tr("(Y/N)")).data),
570 | attron(COLOR_PAIR(2)),
571 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
572 | refresh();
573 | bool rstart(false);
574 |
575 | do
576 | {
577 | QChar gtch(getch());
578 |
579 | if (sb::like(gtch.toUpper(), {"_Y_", '_' % yn[0] % '_'}))
580 | rstart = true;
581 | else if (sb::like(gtch.toUpper(), {"_N_", '_' % yn[1] % '_'}))
582 | return 10;
583 | } while (!rstart);
584 |
585 | pset(mthd + 5),
586 | progress(Start);
587 | bool sfstab(fsave == 1);
588 | sb::srestore(mthd, nullptr, sb::sdir[1] % '/' % cpoint % '_' % pname, nullptr, sfstab);
589 | {
590 | bool err(greinst == 1 && sb::exec("sh -c \"grub-mkconfig -o /boot/grub/grub.cfg ; grub-install --force " % sb::gdetect() % '\"', sb::Silent));
591 | progress(Stop);
592 | if (err)
593 | return 11;
594 | }
595 | clear(),
596 | mvprintw(0, blgn, "%s", sbtxt.data),
597 | attron(COLOR_PAIR(1));
598 |
599 | printw("%s", bstr("\n\n " % twrp([mthd]
600 | {
601 | switch(mthd) {
602 | case 1:
603 | return tr("The full system restoration is completed.");
604 | case 2:
605 | return tr("The system files restoration are completed.");
606 | case 3:
607 | return tr("The users configuration files full restoration are completed.");
608 | default:
609 | return tr("The users configuration files restoration are completed.");
610 | } }())).data);
611 |
612 | attron(COLOR_PAIR(3)),
613 | printw("%s", bstr("\n\n " % twrp(mthd < 3 ? tr("Press 'ENTER' key to reboot the computer, or 'Q' to quit.") : tr("Press 'ENTER' key to quit."))).data),
614 | attron(COLOR_PAIR(2)),
615 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
616 | refresh();
617 |
618 | forever switch (getch())
619 | {
620 | case '\n':
621 | if (mthd < 3)
622 | sb::exec(sb::execsrch("reboot") ? "reboot" : "sh -c '$(ps -o cmd --no-headers -p 1) 6'", sb::Bckgrnd);
623 | return 0;
624 | case 'q':
625 | case 'Q':
626 | if (mthd < 3)
627 | return 0;
628 | }
629 | }
630 |
631 | void systemback::pset(uchar type)
632 | {
633 | prun.txt = [type]() -> QStr
634 | {
635 | switch (type)
636 | {
637 | case 1:
638 | return sb::ecache ? tr("Emptying cache") : tr("Flushing filesystem buffers");
639 | case 2:
640 | return tr("Deleting restore point");
641 | case 3:
642 | return tr("Deleting incomplete restore point");
643 | case 4:
644 | return tr("Deleting old restore point(s)");
645 | case 5:
646 | return tr("Creating restore point");
647 | case 6:
648 | return tr("Restoring the full system");
649 | case 7:
650 | return tr("Restoring the system files");
651 | default:
652 | return tr("Restoring the users configuration files");
653 | }
654 | }();
655 |
656 | prun.type = type;
657 | }
658 |
659 | void systemback::progress(uchar status)
660 | {
661 | switch (status)
662 | {
663 | case Start:
664 | connect(ptimer = new QTimer, SIGNAL(timeout()), this, SLOT(progress())),
665 | QTimer::singleShot(0, this, SLOT(progress())),
666 | ptimer->start(2000);
667 | if (sb::dbglev == sb::Nulldbg)
668 | sb::dbglev = sb::Errdbg;
669 | return;
670 | case Inprog:
671 | for (uchar a(0); a < 4; ++a)
672 | {
673 | switch (prun.type)
674 | {
675 | case 5 ... 9:
676 | {
677 | schar cperc(sb::Progress);
678 |
679 | if (cperc == -1)
680 | prun.pbar = prun.pbar == " (?%)" ? " ( %)" : " (?%)";
681 | else if (cperc > 99)
682 | {
683 | if (prun.cperc < 100)
684 | prun.cperc = 100, prun.pbar = " (100%)";
685 | }
686 | else if (prun.cperc < cperc)
687 | prun.pbar = " (" % QStr::number(prun.cperc = cperc) % "%)";
688 | else if (!(prun.cperc || prun.pbar == " (0%)"))
689 | prun.pbar = " (0%)";
690 | else if (sb::like(99, {cperc, prun.cperc}, true))
691 | prun.pbar = " (100%)", prun.cperc = 100;
692 |
693 | break;
694 | }
695 | default:
696 | if (!prun.pbar.isEmpty())
697 | prun.pbar.clear();
698 | }
699 |
700 | if (!ptimer)
701 | return;
702 | clear(),
703 | attron(COLOR_PAIR(2)),
704 | mvprintw(0, blgn, "%s", sbtxt.data),
705 | attron(COLOR_PAIR(1));
706 |
707 | mvprintw(LINES / 2 - 1, COLS / 2 - (prun.txt.length() + prun.pbar.length() + 4) / 2, "%s", bstr(prun.txt % prun.pbar % [a]
708 | {
709 | switch(a) {
710 | case 0:
711 | return " ";
712 | case 1:
713 | return " . ";
714 | case 2:
715 | return " .. ";
716 | default:
717 | return " ...";
718 | } }()).data);
719 |
720 | attron(COLOR_PAIR(2)),
721 | mvprintw(LINES - 1, COLS - 13, "Kendek, GPLv3"),
722 | refresh();
723 | if (a < 3)
724 | sb::delay(500);
725 | }
726 |
727 | break;
728 | case Stop:
729 | delete ptimer, ptimer = nullptr;
730 | prun.txt.clear();
731 | if (!prun.pbar.isEmpty())
732 | prun.pbar.clear();
733 | if (prun.cperc)
734 | prun.cperc = 0;
735 | if (sb::Progress > -1)
736 | sb::Progress = -1;
737 | }
738 | }
739 |
--------------------------------------------------------------------------------
/systemback/systemback-cli/systemback-cli.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SYSTEMBACKCLI_HPP
20 | #define SYSTEMBACKCLI_HPP
21 |
22 | #include "../libsystemback/sblib.hpp"
23 | #include
24 |
25 | class systemback : public QObject
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | systemback();
31 | ~systemback();
32 |
33 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
34 | public slots:
35 | #endif
36 | void main();
37 |
38 | private:
39 | enum { Inprog = 0, Start = 1, Stop = 2 };
40 |
41 | struct {
42 | QStr txt, pbar;
43 | uchar type, cperc;
44 | } prun;
45 |
46 | QTimer *ptimer;
47 | QStr pname, cpoint;
48 | QChar yn[2];
49 | bstr sbtxt;
50 | uchar blgn;
51 |
52 | QStr twrp(cQStr &txt);
53 | uchar storagedir(cQSL &args);
54 |
55 | uchar clistart(),
56 | restore();
57 |
58 | bool newrpnt();
59 |
60 | void pset(uchar type),
61 | emptycache();
62 |
63 | private slots:
64 | void progress(uchar status = Inprog);
65 | };
66 |
67 | inline systemback::systemback() : ptimer(nullptr)
68 | {
69 | QStr yns(tr("(Y/N)"));
70 | yn[0] = yns.at(1), yn[1] = yns.at(3), prun.cperc = 0;
71 | }
72 |
73 | inline systemback::~systemback()
74 | {
75 | if(ptimer) delete ptimer;
76 | }
77 |
78 | inline QStr systemback::twrp(cQStr &txt)
79 | {
80 | return txt.length() > 78 ? QStr(txt).replace(txt.left(78).lastIndexOf(' '), 1, "\n ") : txt;
81 | }
82 |
83 | #endif
84 |
--------------------------------------------------------------------------------
/systemback/systemback-cli/systemback-cli.pro:
--------------------------------------------------------------------------------
1 | QT -= gui
2 | QT += core
3 |
4 | TARGET = systemback-cli
5 |
6 | CONFIG -= app_bundle
7 | CONFIG += console \
8 | exceptions_off
9 |
10 | TEMPLATE = app
11 |
12 | DEFINES += _FILE_OFFSET_BITS=64
13 |
14 | SOURCES += main.cpp \
15 | systemback-cli.cpp
16 |
17 | HEADERS += systemback-cli.hpp
18 |
19 | QMAKE_CXXFLAGS += -g \
20 | -fno-rtti \
21 | -fvisibility=hidden \
22 | -fvisibility-inlines-hidden \
23 | -fno-asynchronous-unwind-tables
24 |
25 | CONFIG(debug, debug|release) {
26 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
27 | -Wshadow \
28 | -Werror
29 | }
30 |
31 | QMAKE_LFLAGS += -g \
32 | -Wl,-rpath=/usr/lib/systemback \
33 | -Wl,--as-needed \
34 | -fuse-ld=gold \
35 | -Wl,-z,relro
36 |
37 | ! equals(QMAKE_CXX, clang++) {
38 | QMAKE_CXXFLAGS += -flto
39 | QMAKE_LFLAGS += -flto
40 | }
41 |
42 | LIBS += -L../libsystemback \
43 | -lsystemback \
44 | -lncursesw
45 |
46 | # for arch linux with gcc 12
47 |
48 |
--------------------------------------------------------------------------------
/systemback/systemback.conf:
--------------------------------------------------------------------------------
1 | ### Restore points settings
2 |
3 | # storage_directory=
4 | # storage_dir_is_mount_point=[true/false]
5 | # max_temporary_restore_points=[3-10]
6 | # use_incremental_backup_method=[true/false]
7 |
8 |
9 |
10 | ### Live system settings
11 |
12 | # working_directory=
13 | # use_xz_compressor=[true/false]
14 | # auto_iso_images=[true/false]
15 |
16 |
17 |
18 | ### Scheduler settigns
19 |
20 | # enabled=[true/false]
21 | # schedule=[0-7]:[0-23]:[0-59]:[10-99]
22 | # silent=[true/false]
23 | # window_position=[topleft/topright/center/bottomleft/bottomright]
24 | # disable_starting_for_users=[false/everyone/:]
25 |
26 |
27 |
28 | ### User interface settings
29 |
30 | # language=[auto/]
31 |
32 |
33 |
34 | ### Graphical user interface settings
35 |
36 | # style=[auto/]
37 | # window_scaling_factor=[auto/1/1.5/2]
38 | # always_on_top=[true/false]
39 |
40 |
41 |
42 | ### Host system settings
43 |
44 | # disable_cache_emptying=[true/false]
45 |
46 |
--------------------------------------------------------------------------------
/systemback/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback.png
--------------------------------------------------------------------------------
/systemback/systemback.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = subdirs
2 |
3 | SUBDIRS += libsystemback \
4 | sbscheduler \
5 | sbsysupgrade \
6 | sbsustart \
7 | systemback \
8 | systemback-cli
9 |
10 | sbscheduler.depends = libsystemback
11 | sbsysupgrade.depends = libsystemback
12 | sbsustart.depends = libsystemback
13 | systemback.depends = libsystemback
14 | systemback-cli.depends = libsystemback
15 |
16 | TRANSLATIONS = lang/systemback_hu.ts \
17 | lang/systemback_ar_EG.ts \
18 | lang/systemback_ca_ES.ts \
19 | lang/systemback_cs.ts \
20 | lang/systemback_da_DK.ts \
21 | lang/systemback_de.ts \
22 | lang/systemback_en_GB.ts \
23 | lang/systemback_es.ts \
24 | lang/systemback_fi.ts \
25 | lang/systemback_fr.ts \
26 | lang/systemback_gl_ES.ts \
27 | lang/systemback_id.ts \
28 | lang/systemback_pl.ts \
29 | lang/systemback_pt_BR.ts \
30 | lang/systemback_ro.ts \
31 | lang/systemback_ru.ts \
32 | lang/systemback_tr.ts \
33 | lang/systemback_uk.ts \
34 | lang/systemback_vi.ts \
35 | lang/systemback_zh_CN.ts
36 |
--------------------------------------------------------------------------------
/systemback/systemback/bttnevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef BTTNEVENT_HPP
20 | #define BTTNEVENT_HPP
21 |
22 | #include
23 |
24 | class bttnevent : public QPushButton
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | inline bttnevent(QWidget *prnt) : QPushButton(prnt) {}
30 |
31 | protected:
32 | void leaveEvent(QEvent *);
33 |
34 | signals:
35 | void Mouse_Leave();
36 | };
37 |
38 | inline void bttnevent::leaveEvent(QEvent *)
39 | {
40 | emit Mouse_Leave();
41 | }
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/systemback/systemback/chckbxevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef CHCKBXEVENT_HPP
20 | #define CHCKBXEVENT_HPP
21 |
22 | #include
23 |
24 | class chckbxevent : public QCheckBox
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | inline chckbxevent(QWidget *prnt) : QCheckBox(prnt) {}
30 |
31 | protected:
32 | void enterEvent(QEvent *),
33 | leaveEvent(QEvent *);
34 |
35 | signals:
36 | void Mouse_Enter();
37 | void Mouse_Leave();
38 | };
39 |
40 | inline void chckbxevent::enterEvent(QEvent *)
41 | {
42 | emit Mouse_Enter();
43 | }
44 |
45 | inline void chckbxevent::leaveEvent(QEvent *)
46 | {
47 | emit Mouse_Leave();
48 | }
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/systemback/systemback/lblevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef LBLEVENT_HPP
20 | #define LBLEVENT_HPP
21 |
22 | #include
23 | #include
24 |
25 | class lblevent : public QLabel
26 | {
27 | Q_OBJECT
28 |
29 | public:
30 | inline lblevent(QWidget *prnt) : QLabel(prnt) {}
31 | static ushort MouseX, MouseY;
32 |
33 | protected:
34 | void mouseDoubleClickEvent(QMouseEvent *ev),
35 | mouseReleaseEvent(QMouseEvent *ev),
36 | mousePressEvent(QMouseEvent *ev),
37 | mouseMoveEvent(QMouseEvent *),
38 | enterEvent(QEvent *),
39 | leaveEvent(QEvent *);
40 |
41 | private:
42 | bool MousePressed;
43 |
44 | signals:
45 | void Mouse_Released();
46 | void Mouse_DblClick();
47 | void Mouse_Pressed();
48 | void Mouse_Click();
49 | void Mouse_Enter();
50 | void Mouse_Leave();
51 | void Mouse_Move();
52 | };
53 |
54 | inline void lblevent::mousePressEvent(QMouseEvent *ev)
55 | {
56 | if(ev->button() == Qt::LeftButton)
57 | {
58 | MouseX = ev->x(), MouseY = ev->y(), MousePressed = true;
59 | emit Mouse_Pressed();
60 | }
61 | }
62 |
63 | inline void lblevent::mouseMoveEvent(QMouseEvent *)
64 | {
65 | if(MousePressed) emit Mouse_Move();
66 | }
67 |
68 | inline void lblevent::mouseReleaseEvent(QMouseEvent *ev)
69 | {
70 | if(ev->button() == Qt::LeftButton)
71 | {
72 | MousePressed = false;
73 | emit Mouse_Released();
74 | }
75 |
76 | emit Mouse_Click();
77 | }
78 |
79 | inline void lblevent::mouseDoubleClickEvent(QMouseEvent *ev)
80 | {
81 | if(ev->button() == Qt::LeftButton) emit Mouse_DblClick();
82 | }
83 |
84 | inline void lblevent::enterEvent(QEvent *)
85 | {
86 | emit Mouse_Enter();
87 | }
88 |
89 | inline void lblevent::leaveEvent(QEvent *)
90 | {
91 | emit Mouse_Leave();
92 | }
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/systemback/systemback/lndtevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef LNDTEVENT_HPP
20 | #define LNDTEVENT_HPP
21 |
22 | #include
23 |
24 | class lndtevent : public QLineEdit
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | inline lndtevent(QWidget *prnt) : QLineEdit(prnt) {}
30 |
31 | protected:
32 | void focusOutEvent(QFocusEvent *ev);
33 |
34 | signals:
35 | void Focus_Out();
36 | };
37 |
38 | inline void lndtevent::focusOutEvent(QFocusEvent *ev)
39 | {
40 | QLineEdit::focusOutEvent(ev);
41 | emit Focus_Out();
42 | }
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/systemback/systemback/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #include "systemback.hpp"
20 | #include
21 | // #include
22 |
23 | int main(int argc, char *argv[])
24 | {
25 | QApplication a(argc, argv);
26 | sb::ldtltr();
27 |
28 | uchar rv([&a] {
29 |
30 | // if(qgetenv("XAUTHORITY").startsWith("/home/") && ! getuid())
31 | // {
32 | // sb::error("\n " % sb::tr("Unsafe X Window authorization!") % "\n\n " % sb::tr("Please do not run systemback as pure root.") % "\n\n");
33 | // return 1;
34 | // }
35 |
36 | systemback w;
37 | w.fscrn ? w.showFullScreen() : w.show();
38 | return a.exec();
39 | }());
40 |
41 | return rv;
42 | }
43 |
--------------------------------------------------------------------------------
/systemback/systemback/pictures.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | pictures/back.png
4 | pictures/dialogerror.png
5 | pictures/dialoginfo.png
6 | pictures/dialogquestion.png
7 | pictures/dir.png
8 | pictures/dirx.png
9 | pictures/down.png
10 | pictures/error.png
11 | pictures/isdir.png
12 | pictures/leftarrow.png
13 | pictures/leftgreenarrow.png
14 | pictures/logo.png
15 | pictures/menuback.png
16 | pictures/menunext.png
17 | pictures/next.png
18 | pictures/ok.png
19 | pictures/passwordlogo.png
20 | pictures/refresh.png
21 | pictures/resize.png
22 | pictures/rightarrow.png
23 | pictures/systemback.png
24 | pictures/up.png
25 |
26 |
27 |
--------------------------------------------------------------------------------
/systemback/systemback/pictures/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/back.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/dialogerror.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/dialogerror.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/dialoginfo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/dialoginfo.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/dialogquestion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/dialogquestion.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/dir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/dir.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/dirx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/dirx.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/down.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/error.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/isdir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/isdir.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/leftarrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/leftarrow.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/leftgreenarrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/leftgreenarrow.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/logo.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/menuback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/menuback.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/menunext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/menunext.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/next.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/ok.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/passwordlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/passwordlogo.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/refresh.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/resize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/resize.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/rightarrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/rightarrow.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/systemback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/systemback.png
--------------------------------------------------------------------------------
/systemback/systemback/pictures/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shadichy/systemback-archlinux/a1354209aa026083e4ead84a6711cd2ba51c1ade/systemback/systemback/pictures/up.png
--------------------------------------------------------------------------------
/systemback/systemback/pnlevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef PNLEVENT_HPP
20 | #define PNLEVENT_HPP
21 |
22 | #include
23 |
24 | class pnlevent : public QWidget
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | inline pnlevent(QWidget *prnt) : QWidget(prnt) {}
30 |
31 | protected:
32 | void mouseMoveEvent(QMouseEvent *),
33 | resizeEvent(QResizeEvent *),
34 | moveEvent(QMoveEvent *),
35 | hideEvent(QHideEvent *),
36 | leaveEvent(QEvent *);
37 |
38 | signals:
39 | void Mouse_Leave();
40 | void Mouse_Move();
41 | void Resize();
42 | void Move();
43 | void Hide();
44 | };
45 |
46 | inline void pnlevent::mouseMoveEvent(QMouseEvent *)
47 | {
48 | emit Mouse_Move();
49 | }
50 |
51 | inline void pnlevent::resizeEvent(QResizeEvent *)
52 | {
53 | emit Resize();
54 | }
55 |
56 | inline void pnlevent::moveEvent(QMoveEvent *)
57 | {
58 | emit Move();
59 | }
60 |
61 | inline void pnlevent::hideEvent(QHideEvent *)
62 | {
63 | emit Hide();
64 | }
65 |
66 | inline void pnlevent::leaveEvent(QEvent *)
67 | {
68 | emit Mouse_Leave();
69 | }
70 |
71 | #endif
72 |
--------------------------------------------------------------------------------
/systemback/systemback/systemback.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef SYSTEMBACK_HPP
20 | #define SYSTEMBACK_HPP
21 |
22 | #include "../libsystemback/sblib.hpp"
23 | #include
24 | #include
25 | #include
26 |
27 | #define QTblWI QTableWidgetItem
28 | #define QLWI QListWidgetItem
29 | #define QTrWI QTreeWidgetItem
30 | #define cQTrWI const QTreeWidgetItem
31 |
32 | namespace Ui {
33 | class systemback;
34 | }
35 |
36 | class systemback : public QMainWindow
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | systemback();
42 | ~systemback();
43 |
44 | bool fscrn;
45 |
46 | protected:
47 | bool eventFilter(QObject *, QEvent *ev);
48 |
49 | void keyReleaseEvent(QKeyEvent *ev),
50 | keyPressEvent(QKeyEvent *ev),
51 | closeEvent(QCloseEvent *ev);
52 |
53 | private:
54 | enum { Normal = 100, High = 147, Max = 200 };
55 |
56 | Ui::systemback *ui;
57 |
58 | struct {
59 | QStr txt;
60 | uchar type, pnts;
61 | } prun;
62 |
63 | struct {
64 | QStr name;
65 | QStr arch;
66 | bool isEFI;
67 | } grub;
68 |
69 | QWdt wndw, fwdgt;
70 | QFont bfnt;
71 | QTimer utimer, *shdltimer, *dlgtimer, *intrptimer;
72 | QStr cpoint, pname, hash;
73 | QBA ocfg;
74 | ushort dialog;
75 | short wgeom[4], cpos;
76 | uchar busycnt, ppipe, sfctr, icnt;
77 | bool sislive, wismax, wmblck, uchkd, nrxth, ickernel, irblck, utblck, nohmcpy[2], sstart, intrrpt;
78 |
79 | QLE getpoint(uchar num);
80 | QCB getppipe(uchar num);
81 |
82 | QStr guname(),
83 | ckname(),
84 | rkernel(),
85 | ugrubcmd(),
86 | mkisocmd(cQStr &path, cQStr &out),
87 | rebootcmd();
88 |
89 | bool cpdir(cQStr &src, cQStr &newdir);
90 |
91 | QRect sgeom(bool rdc = false, QDW dtp = nullptr);
92 | ushort ss(ushort dsize);
93 | template bool cfmod(const T &path, ushort mode);
94 |
95 | bool minside(cQRect &rct),
96 | minside(QWdt wgt);
97 |
98 |
99 | void windowmove(ushort nwidth, ushort nheight, bool fxdw = true),
100 | dialogopen(ushort dlg = 0, cbstr &dev = nullptr),
101 | ilstupdt(bool inc = false, cQStr &dir = nullptr),
102 | pset(uchar type, cbstr &tend = nullptr),
103 | dirxpnd(QTrWI *item, bool inc = false),
104 | ptxtchange(uchar num, cQStr &txt),
105 | setwontop(bool state = true),
106 | busy(bool state = true),
107 | pnmchange(uchar num),
108 | pntupgrade(),
109 | emptycache(),
110 | statustart(),
111 | systemcopy(),
112 | livewrite(),
113 | rmntcheck(),
114 | stschange(),
115 | bttnsshow(),
116 | bttnshide(),
117 | restore(),
118 | repair();
119 |
120 | #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
121 | private slots:
122 | #endif
123 | void dialogtimer();
124 |
125 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
126 | private slots:
127 | #endif
128 | void schedulertimer();
129 | void unitimer();
130 |
131 | private slots:
132 | void benter(bool click = false);
133 | void abtreleased();
134 | void wbreleased();
135 | void wreleased();
136 | void rreleased();
137 | void mpressed();
138 | void rpressed();
139 | void wpressed();
140 | void bpressed();
141 | void wbenter();
142 | void wbleave();
143 | void foutpnt();
144 | void renter();
145 | void rleave();
146 | void wmove();
147 | void rmove();
148 | void bmove();
149 |
150 | void on_partitionsettings_currentItemChanged(QTblWI *crrnt, QTblWI *prvs);
151 | void on_livedevices_currentItemChanged(QTblWI *crrnt, QTblWI *prvs);
152 | void on_grubreinstallrestore_currentIndexChanged(const QStr &arg1);
153 | void on_grubreinstallrepair_currentIndexChanged(const QStr &arg1);
154 | void on_grubinstallcopy_currentIndexChanged(const QStr &arg1);
155 | void on_repairpartition_currentIndexChanged(const QStr &arg1);
156 | void on_repairmountpoint_currentTextChanged(const QStr &arg1);
157 | void on_windowposition_currentIndexChanged(const QStr &arg1);
158 | void on_includeusers_currentIndexChanged(const QStr &arg1);
159 | void on_excludeitemslist_currentItemChanged(QTrWI *crrnt);
160 | void on_includeitemslist_currentItemChanged(QTrWI *crrnt);
161 | void on_filesystem_currentIndexChanged(const QStr &arg1);
162 | void on_languages_currentIndexChanged(const QStr &arg1);
163 | void on_mountpoint_currentTextChanged(const QStr &arg1);
164 | void on_excludedlist_currentItemChanged(QLWI *crrnt);
165 | void on_includedlist_currentItemChanged(QLWI *crrnt);
166 | void on_styles_currentIndexChanged(const QStr &arg1);
167 | void on_admins_currentIndexChanged(const QStr &arg1);
168 | void on_adminpassword_textChanged(const QStr &arg1);
169 | void on_rootpassword1_textChanged(const QStr &arg1);
170 | void on_users_currentIndexChanged(const QStr &arg1);
171 | void on_excludeitemslist_itemCollapsed(QTrWI *item);
172 | void on_dirchoose_currentItemChanged(QTrWI *crrnt);
173 | void on_excludeitemslist_itemExpanded(QTrWI *item);
174 | void on_includeitemslist_itemExpanded(QTrWI *item);
175 | void on_livelist_currentItemChanged(QLWI *crrnt);
176 | void on_password1_textChanged(const QStr &arg1);
177 | void on_usersettingscopy_stateChanged(int arg1);
178 | void on_autorestoreoptions_clicked(bool chckd);
179 | void on_incrementaldisable_clicked(bool chckd);
180 | void on_livename_textChanged(const QStr &arg1);
181 | void on_fullname_textChanged(const QStr &arg1);
182 | void on_username_textChanged(const QStr &arg1);
183 | void on_hostname_textChanged(const QStr &arg1);
184 | void on_autorepairoptions_clicked(bool chckd);
185 | void on_point10_textChanged(const QStr &arg1);
186 | void on_point11_textChanged(const QStr &arg1);
187 | void on_point12_textChanged(const QStr &arg1);
188 | void on_point13_textChanged(const QStr &arg1);
189 | void on_point14_textChanged(const QStr &arg1);
190 | void on_point15_textChanged(const QStr &arg1);
191 | void on_skipfstabrestore_clicked(bool chckd);
192 | void on_languageoverride_clicked(bool chckd);
193 | void on_schedulerdisable_clicked(bool chckd);
194 | void on_cachemptydisable_clicked(bool chckd);
195 | void on_point1_textChanged(const QStr &arg1);
196 | void on_point2_textChanged(const QStr &arg1);
197 | void on_point3_textChanged(const QStr &arg1);
198 | void on_point4_textChanged(const QStr &arg1);
199 | void on_point5_textChanged(const QStr &arg1);
200 | void on_point6_textChanged(const QStr &arg1);
201 | void on_point7_textChanged(const QStr &arg1);
202 | void on_point8_textChanged(const QStr &arg1);
203 | void on_point9_textChanged(const QStr &arg1);
204 | void on_skipfstabrepair_clicked(bool chckd);
205 | void on_userdatainclude_clicked(bool chckd);
206 | void on_usexzcompressor_clicked(bool chckd);
207 | void on_dirchoose_itemExpanded(QTrWI *item);
208 | void on_configurationfilesrestore_clicked();
209 | void on_styleoverride_clicked(bool chckd);
210 | void on_autoisocreate_clicked(bool chckd);
211 | void on_repairpartitionrefresh_clicked();
212 | void on_alwaysontop_clicked(bool chckd);
213 | void on_silentmode_clicked(bool chckd);
214 | void on_livedevicesrefresh_clicked();
215 | void on_liveworkdirbutton_clicked();
216 | void on_rootpassword2_textChanged();
217 | void on_partitionrefresh2_clicked();
218 | void on_partitionrefresh3_clicked();
219 | void on_excluderemoveitem_clicked();
220 | void on_includeremoveitem_clicked();
221 | void on_format_clicked(bool chckd);
222 | void on_functionmenunext_clicked();
223 | void on_functionmenuback_clicked();
224 | void on_storagedirbutton_clicked();
225 | void on_partitionrefresh_clicked();
226 | void on_fullname_editingFinished();
227 | void on_schedulerrefresh_clicked();
228 | void on_passwordinputok_clicked();
229 | void on_dirchoosecancel_clicked();
230 | void on_changepartition_clicked();
231 | void on_newrestorepoint_clicked();
232 | void on_partitiondelete_clicked();
233 | void on_schedulerstart_clicked();
234 | void on_schedulerstate_clicked();
235 | void on_pointhighlight_clicked();
236 | void on_livewritestart_clicked();
237 | void on_schedulerlater_clicked();
238 | void on_excludeadditem_clicked();
239 | void on_includeadditem_clicked();
240 | void on_systemupgrade_clicked();
241 | void on_systemrestore_clicked();
242 | void on_password2_textChanged();
243 | void on_schedulerback_clicked();
244 | void on_unmountdelete_clicked();
245 | void on_dialogcancel_clicked();
246 | void on_schedulemenu_clicked();
247 | void on_pointexclude_clicked();
248 | void on_systemrepair_clicked();
249 | void on_newpartition_clicked();
250 | void on_settingsmenu_clicked();
251 | void on_settingsback_clicked();
252 | void on_startcancel_clicked();
253 | void on_restoremenu_clicked();
254 | void on_installmenu_clicked();
255 | void on_excludemenu_clicked();
256 | void on_includemenu_clicked();
257 | void on_restoreback_clicked();
258 | void on_installback_clicked();
259 | void on_excludeback_clicked();
260 | void on_licensemenu_clicked();
261 | void on_licenseback_clicked();
262 | void on_pointpipe10_clicked();
263 | void on_pointpipe11_clicked();
264 | void on_pointpipe12_clicked();
265 | void on_pointpipe13_clicked();
266 | void on_pointpipe14_clicked();
267 | void on_pointpipe15_clicked();
268 | void on_pointrename_clicked();
269 | void on_dirchooseok_clicked();
270 | void on_fullrestore_clicked();
271 | void on_restorenext_clicked();
272 | void on_installnext_clicked();
273 | void on_repairmount_clicked();
274 | void on_liveexclude_clicked();
275 | void on_pointdelete_clicked();
276 | void on_liveconvert_clicked();
277 | void on_scalingdown_clicked();
278 | void on_includeback_clicked();
279 | void on_repairmenu_clicked();
280 | void on_repairback_clicked();
281 | void on_pointpipe1_clicked();
282 | void on_pointpipe2_clicked();
283 | void on_pointpipe3_clicked();
284 | void on_pointpipe4_clicked();
285 | void on_pointpipe5_clicked();
286 | void on_pointpipe6_clicked();
287 | void on_pointpipe7_clicked();
288 | void on_pointpipe8_clicked();
289 | void on_pointpipe9_clicked();
290 | void on_livedelete_clicked();
291 | void on_fullrepair_clicked();
292 | void on_grubrepair_clicked();
293 | void on_repairnext_clicked();
294 | void on_minutedown_clicked();
295 | void on_seconddown_clicked();
296 | void on_dirrefresh_clicked();
297 | void on_pnumber10_clicked();
298 | void on_aboutmenu_clicked();
299 | void on_aboutback_clicked();
300 | void on_interrupt_clicked();
301 | void on_scalingup_clicked();
302 | void on_pnumber3_clicked();
303 | void on_pnumber4_clicked();
304 | void on_pnumber5_clicked();
305 | void on_pnumber6_clicked();
306 | void on_pnumber7_clicked();
307 | void on_pnumber8_clicked();
308 | void on_pnumber9_clicked();
309 | void on_copymenu_clicked();
310 | void on_copyback_clicked();
311 | void on_livemenu_clicked();
312 | void on_liveback_clicked();
313 | void on_dialogok_clicked();
314 | void on_copynext_clicked();
315 | void on_hourdown_clicked();
316 | void on_minuteup_clicked();
317 | void on_secondup_clicked();
318 | void on_livenew_clicked();
319 | void on_daydown_clicked();
320 | void on_unmount_clicked();
321 | void on_adduser_clicked();
322 | void on_hourup_clicked();
323 | void on_dayup_clicked();
324 | };
325 |
326 | template bool systemback::cfmod(const T &path, ushort mode)
327 | {
328 | return chmod(bstr(path), mode) ? sb::error("\n " % tr("An error occurred while changing the access permissions of the following file:") % "\n\n " % QStr(path) % "\n\n") : true;
329 | }
330 |
331 | #endif
332 |
--------------------------------------------------------------------------------
/systemback/systemback/systemback.pro:
--------------------------------------------------------------------------------
1 | QT += core \
2 | gui \
3 | widgets
4 |
5 | TARGET = systemback
6 |
7 | CONFIG += exceptions_off
8 |
9 | TEMPLATE = app
10 |
11 | DEFINES += _FILE_OFFSET_BITS=64
12 |
13 | SOURCES += main.cpp \
14 | systemback.cpp
15 |
16 | HEADERS += systemback.hpp \
17 | bttnevent.hpp \
18 | chckbxevent.hpp \
19 | lblevent.hpp \
20 | lndtevent.hpp \
21 | pnlevent.hpp \
22 | tblwdgtevent.hpp
23 |
24 | FORMS += systemback.ui
25 |
26 | RESOURCES += pictures.qrc
27 |
28 | QMAKE_CXXFLAGS += -g \
29 | -fno-rtti \
30 | -fvisibility=hidden \
31 | -fvisibility-inlines-hidden \
32 | -fno-asynchronous-unwind-tables
33 |
34 | CONFIG(debug, debug|release) {
35 | QMAKE_CXXFLAGS_WARN_ON += -Wextra \
36 | -Wshadow \
37 | -Werror
38 | }
39 |
40 | QMAKE_LFLAGS += -g \
41 | -Wl,-rpath=/usr/lib/systemback \
42 | -Wl,--as-needed \
43 | -fuse-ld=gold \
44 | -Wl,-z,relro
45 |
46 | ! equals(QMAKE_CXX, clang++) {
47 | QMAKE_CXXFLAGS += -flto
48 | QMAKE_LFLAGS += -flto
49 | }
50 |
51 | LIBS += -L../libsystemback \
52 | -lsystemback \
53 | -lcrypt \
54 | -lX11
55 |
56 | # for arch linux with gcc 12
57 |
--------------------------------------------------------------------------------
/systemback/systemback/tblwdgtevent.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright(C) 2014-2016, Krisztián Kende
3 | *
4 | * This file is part of the Systemback.
5 | *
6 | * The Systemback is free software; you can redistribute it and/or modify it under
7 | * the terms of the GNU General Public License as published by the Free Software
8 | * Foundation; either version 3 of the License, or (at your option) any later
9 | * version.
10 | *
11 | * The Systemback is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License along with the
16 | * Systemback. If not, see .
17 | */
18 |
19 | #ifndef TBLWDGTEVENT_HPP
20 | #define TBLWDGTEVENT_HPP
21 |
22 | #include
23 |
24 | class tblwdgtevent : public QTableWidget
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | inline tblwdgtevent(QWidget *prnt) : QTableWidget(prnt) {}
30 |
31 | protected:
32 | void focusInEvent(QFocusEvent *ev),
33 | focusOutEvent(QFocusEvent *ev);
34 |
35 | signals:
36 | void Focus_In();
37 | void Focus_Out();
38 | };
39 |
40 | inline void tblwdgtevent::focusInEvent(QFocusEvent *ev)
41 | {
42 | QTableWidget::focusInEvent(ev);
43 | emit Focus_In();
44 | }
45 |
46 | inline void tblwdgtevent::focusOutEvent(QFocusEvent *ev)
47 | {
48 | QTableWidget::focusOutEvent(ev);
49 | emit Focus_Out();
50 | }
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------