Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
5ed0f8e6
Commit
5ed0f8e6
authored
Nov 22, 2017
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-disk: use uuid for swap in fstab
also fix potential issue where we may have multiple swap devices
parent
7d226111
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
setup-disk.in
setup-disk.in
+9
-5
No files found.
setup-disk.in
View file @
5ed0f8e6
...
...
@@ -439,9 +439,12 @@ install_mounted_root() {
mv
"
$mnt
"
/etc/fstab
"
$mnt
"
/etc/fstab.old
fi
enumerate_fstab
"
$mnt
"
>>
"
$mnt
"
/etc/fstab
if
[
-n
"
$SWAP_DEVICE
"
]
;
then
echo
-e
"
${
SWAP_DEVICE
}
\t
swap
\t
swap
\t
defaults
\t
0 0"
\
>>
"
$mnt
"
/etc/fstab
if
[
-n
"
$SWAP_DEVICES
"
]
;
then
local
swap_dev
for
swap_dev
in
$SWAP_DEVICES
;
do
echo
-e
"
$(
uuid_or_device
${
swap_dev
}
)
\t
swap
\t
swap
\t
defaults
\t
0 0"
\
>>
"
$mnt
"
/etc/fstab
done
fi
cat
>>
"
$mnt
"
/etc/fstab
<<-
__EOF__
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
...
...
@@ -766,11 +769,12 @@ setup_lvm_volume_group() {
setup_swap_dev
()
{
local
swap_dev
=
sed
-i
-e
'/swap/d'
/etc/fstab
SWAP_DEVICES
=
for
swap_dev
in
"
$@
"
;
do
mkswap
$swap_dev
>
/dev/null
echo
-e
"
$swap_dev
\t
swap
\t\t
swap
\t
defaults 0 0"
>>
/etc/fstab
echo
-e
"
$(
uuid_or_device
$swap_dev
)
\t
swap
\t\t
swap
\t
defaults 0 0"
>>
/etc/fstab
SWAP_DEVICES
=
"
$SWAP_DEVICES
$swap_dev
"
done
SWAP_DEVICE
=
"
$(
uuid_or_device
$swap_dev
)
"
swapon
-a
rc-update
--quiet
add swap boot
}
...
...
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