Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
c3eeebd0
Commit
c3eeebd0
authored
Oct 18, 2017
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-bootable: do cleanup via exit trap
parent
75475f7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
setup-bootable.in
setup-bootable.in
+16
-6
No files found.
setup-bootable.in
View file @
c3eeebd0
...
...
@@ -3,6 +3,9 @@
prog
=
${
0
##*/
}
version
=
@VERSION@
files_to_move
=
"boot efi apks syslinux.cfg .alpine-release"
read_only_mounts
=
umounts
=
uninstalls
=
cleanup_mounts
()
{
local
i
=
...
...
@@ -12,24 +15,34 @@ cleanup_mounts() {
for
i
in
$read_only_mounts
;
do
mount
-o
remount,ro
"
$i
"
||
echo
"Warning: Failed to remount as read-only. Is modloop mounted?"
done
read_only_mounts
=
""
if
[
-n
"
$umounts
"
]
;
then
umount
$umounts
umounts
=
""
fi
}
cleanup_installs
()
{
if
[
-n
"
$uninstalls
"
]
;
then
apk del
--quiet
syslinux
apk del
--quiet
$uninstalls
uninstalls
=
""
fi
}
die
()
{
echo
"
$@
"
>
&2
cleanup
()
{
cleanup_mounts
cleanup_installs
}
trap
cleanup EXIT
trap
"exit 2"
INT TERM QUIT
die
()
{
echo
"
$@
"
>
&2
exit
1
}
# find device for mountpoint
find_dev
()
{
local
mnt
=
"
${
1
%/
}
"
# strip trailing /
...
...
@@ -377,8 +390,6 @@ check_syslinux
# If we only copy then we are done.
if
[
-n
"
$upgrade
"
]
&&
[
-z
"
$syslinux
"
]
;
then
cleanup_installs
cleanup_mounts
exit
0
fi
...
...
@@ -406,4 +417,3 @@ if [ -b $parent_dev ]; then
else
echo
"Warning: Could not find the parent device for
$dest
"
fi
cleanup_installs
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment