Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
installer
Commits
41a656af
Commit
41a656af
authored
2 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Ignore live disks and partitions in TUI
parent
fadb0a1c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/installer_tui.rs
+17
-5
17 additions, 5 deletions
src/bin/installer_tui.rs
with
17 additions
and
5 deletions
src/bin/installer_tui.rs
+
17
−
5
View file @
41a656af
...
@@ -35,6 +35,11 @@ fn disk_paths(paths: &mut Vec<(String, u64)>) {
...
@@ -35,6 +35,11 @@ fn disk_paths(paths: &mut Vec<(String, u64)>) {
if
let
Ok
(
path_str
)
=
path
.into_os_string
()
.into_string
()
{
if
let
Ok
(
path_str
)
=
path
.into_os_string
()
.into_string
()
{
let
scheme
=
path_str
.trim_start_matches
(
':'
)
.trim_matches
(
'/'
);
let
scheme
=
path_str
.trim_start_matches
(
':'
)
.trim_matches
(
'/'
);
if
scheme
.starts_with
(
"disk"
)
{
if
scheme
.starts_with
(
"disk"
)
{
if
scheme
==
"disk/live"
{
// Skip live disks
continue
;
}
schemes
.push
(
format!
(
"{}:"
,
scheme
));
schemes
.push
(
format!
(
"{}:"
,
scheme
));
}
}
}
}
...
@@ -53,11 +58,18 @@ fn disk_paths(paths: &mut Vec<(String, u64)>) {
...
@@ -53,11 +58,18 @@ fn disk_paths(paths: &mut Vec<(String, u64)>) {
match
fs
::
read_dir
(
&
scheme
)
{
match
fs
::
read_dir
(
&
scheme
)
{
Ok
(
entries
)
=>
for
entry_res
in
entries
{
Ok
(
entries
)
=>
for
entry_res
in
entries
{
if
let
Ok
(
entry
)
=
entry_res
{
if
let
Ok
(
entry
)
=
entry_res
{
if
let
Ok
(
path
)
=
entry
.path
()
.into_os_string
()
.into_string
()
{
if
let
Ok
(
file_name
)
=
entry
.file_name
()
.into_string
()
{
if
let
Ok
(
metadata
)
=
entry
.metadata
()
{
if
file_name
.contains
(
'p'
)
{
let
size
=
metadata
.len
();
// Skip partitions
if
size
>
0
{
continue
;
paths
.push
((
path
,
size
));
}
if
let
Ok
(
path
)
=
entry
.path
()
.into_os_string
()
.into_string
()
{
if
let
Ok
(
metadata
)
=
entry
.metadata
()
{
let
size
=
metadata
.len
();
if
size
>
0
{
paths
.push
((
path
,
size
));
}
}
}
}
}
}
}
...
...
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