Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakub Panek
aports
Commits
60258b46
Commit
60258b46
authored
16 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
initram: retry mount root incase its an usb device
parent
a5f1bed0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
initramfs-init
+13
-6
13 additions, 6 deletions
initramfs-init
with
13 additions
and
6 deletions
initramfs-init
+
13
−
6
View file @
60258b46
...
...
@@ -53,6 +53,15 @@ find_ovl() {
echo
"
$ovl
"
}
retry_mount
()
{
# usb might need some time to settle so we retry a few times
for
i
in
$(
seq
0 19
)
;
do
mount
$@
2>&1
&&
return
0
sleep
1
done
return
1
}
# gotta start from somewhere :)
echo
"Alpine Init
$VERSION
"
...
...
@@ -116,7 +125,9 @@ eend 0
# check if root=... was set
if
[
-n
"
$KOPT_root
"
]
;
then
mount
$KOPT_root
$NEWROOT
ebegin
"Mounting root"
retry_mount
$KOPT_root
$NEWROOT
2>/dev/null
eend
$?
cat
/proc/mounts |
while
read
DEV DIR TYPE OPTS
;
do
if
[
"
$DIR
"
!=
"/"
-a
"
$DIR
"
!=
"
$NEWROOT
"
-a
-d
"
$DIR
"
]
;
then
mkdir
-p
$NEWROOT
/
$DIR
...
...
@@ -136,11 +147,7 @@ if [ -n "$ALPINE_DEV_FS" ]; then
mount_opts
=
"-t
$ALPINE_DEV_FS
"
fi
# usb might need some time to settle so we retry a few times
for
i
in
$(
seq
0 19
)
;
do
mount
$mount_opts
/dev/
$ALPINE_DEV
$ALPINE_MNT
>
/dev/null 2>&1
&&
break
sleep
1
done
retry_mount
$mount_opts
/dev/
$ALPINE_DEV
$ALPINE_MNT
>
/dev/null 2>&1
eend
$?
ebegin
"Mounting loopback device for kernel modules"
...
...
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