Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
7deb6c0e
Commit
7deb6c0e
authored
Jun 18, 2021
by
Adriaan de Groot
Browse files
Options
Downloads
Patches
Plain Diff
[partition] Improve logging in clearmounts job
parent
432154e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/partition/jobs/ClearTempMountsJob.cpp
+11
-6
11 additions, 6 deletions
src/modules/partition/jobs/ClearTempMountsJob.cpp
with
11 additions
and
6 deletions
src/modules/partition/jobs/ClearTempMountsJob.cpp
+
11
−
6
View file @
7deb6c0e
...
...
@@ -43,6 +43,7 @@ ClearTempMountsJob::prettyStatusMessage() const
Calamares
::
JobResult
ClearTempMountsJob
::
exec
()
{
Logger
::
Once
o
;
// Fetch a list of current mounts to Calamares temporary directories.
QList
<
QPair
<
QString
,
QString
>
>
lst
;
QFile
mtab
(
"/etc/mtab"
);
...
...
@@ -51,23 +52,27 @@ ClearTempMountsJob::exec()
return
Calamares
::
JobResult
::
error
(
tr
(
"Cannot get list of temporary mounts."
)
);
}
c
Debug
()
<<
"Opened mtab. Lines:"
;
c
Verbose
()
<<
o
<<
"Opened mtab. Lines:"
;
QTextStream
in
(
&
mtab
);
QString
lineIn
=
in
.
readLine
();
while
(
!
lineIn
.
isNull
()
)
{
QStringList
line
=
lineIn
.
split
(
' '
,
SplitSkipEmptyParts
);
c
Debug
()
<<
line
.
join
(
' '
);
c
Verbose
()
<<
o
<<
line
.
join
(
' '
);
QString
device
=
line
.
at
(
0
);
QString
mountPoint
=
line
.
at
(
1
);
if
(
mountPoint
.
startsWith
(
"/tmp/calamares-"
)
)
{
cDebug
()
<<
"INSERTING pair (device, mountPoint)"
<<
device
<<
mountPoint
;
lst
.
append
(
qMakePair
(
device
,
mountPoint
)
);
}
lineIn
=
in
.
readLine
();
}
if
(
lst
.
empty
()
)
{
return
Calamares
::
JobResult
::
ok
();
}
std
::
sort
(
lst
.
begin
(),
lst
.
end
(),
[](
const
QPair
<
QString
,
QString
>&
a
,
const
QPair
<
QString
,
QString
>&
b
)
->
bool
{
return
a
.
first
>
b
.
first
;
...
...
@@ -76,10 +81,10 @@ ClearTempMountsJob::exec()
QStringList
goodNews
;
QProcess
process
;
for
each
(
auto
line
,
lst
)
for
(
const
auto
&
line
:
qAsConst
(
lst
)
)
{
QString
partPath
=
line
.
second
;
cDebug
()
<<
"Will try to umount path"
<<
partPath
;
cDebug
()
<<
o
<<
"Will try to umount path"
<<
partPath
;
process
.
start
(
"umount"
,
{
"-lv"
,
partPath
}
);
process
.
waitForFinished
();
if
(
process
.
exitCode
()
==
0
)
...
...
@@ -92,7 +97,7 @@ ClearTempMountsJob::exec()
ok
.
setMessage
(
tr
(
"Cleared all temporary mounts."
)
);
ok
.
setDetails
(
goodNews
.
join
(
"
\n
"
)
);
cDebug
()
<<
"ClearTempMountsJob finished. Here's what was done:
\n
"
<<
goodNews
.
join
(
"
\n
"
);
cDebug
()
<<
o
<<
"ClearTempMountsJob finished. Here's what was done:
\n
"
<<
Logger
::
DebugList
(
goodNews
);
return
ok
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment