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
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
c0f28ffe
Commit
c0f28ffe
authored
Jan 12, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-disk: detect if root device is lvm
We need to add the lvm feature to initramfs image if root is lvm
parent
494c77df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
setup-disk.in
setup-disk.in
+17
-2
No files found.
setup-disk.in
View file @
c0f28ffe
...
...
@@ -60,6 +60,11 @@ is_xen() {
[
-d
/proc/xen
]
}
# return true (0) if given device is lvm
is_lvm
()
{
lvs
"
$1
"
>
/dev/null 2>&1
}
# Find the disk device from given partition
disk_from_part
()
{
# we need convert cciss/c0d0* cciss!c0d0*...
...
...
@@ -134,7 +139,7 @@ supported_boot_fs() {
install_mounted_root
()
{
local
mnt
=
"
$1
"
mnt_boot
=
"
$1
"
boot_fs
=
root_fs
=
local
features
=
"ata base bootchart cdrom ext2 ext3 ext4 ide scsi usb
"
local
initfs_features
=
"ata base ide scsi usb virtio
"
rootdev
=
$(
find_mount_dev
"
$mnt
"
)
if
[
-z
"
$rootdev
"
]
;
then
...
...
@@ -142,6 +147,12 @@ install_mounted_root() {
return
1
fi
root_fs
=
$(
find_mount_fs
"
$mnt
"
)
initfs_features
=
"
$initfs_features
$root_fs
"
if
is_lvm
"
$rootdev
"
;
then
initfs_features
=
"
$initfs_features
lvm"
fi
bootdev
=
$(
find_mount_dev
"
$mnt
"
/boot
)
if
[
-z
"
$bootdev
"
]
;
then
...
...
@@ -156,7 +167,7 @@ install_mounted_root() {
mbrdisk
=
$(
disk_from_part
$bootdev
)
if
[
-e
"/sys/block/
${
rootdev
#/dev/
}
/md"
]
;
then
local
md
=
${
rootdev
#/dev/
}
features
=
"
$
features
raid"
initfs_features
=
"
$initfs_
features
raid"
raidmod
=
$(
cat
/sys/block/
$md
/md/level
)
raidmod
=
",
$raidmod
"
raidopt
=
"-r"
...
...
@@ -186,6 +197,10 @@ install_mounted_root() {
unpack_apkovl
"
$APKOVL
"
"
$mnt
"
||
return
1
fi
# generate mkinitfs.conf
mkdir
-p
"
$mnt
"
/etc/mkinitfs
echo
"features=
\"
$initfs_features
\"
"
>
"
$mnt
"
/etc/mkinitfs/mkinitfs.conf
# generate the fstab
if
[
-f
"
$mnt
"
/etc/fstab
]
;
then
mv
"
$mnt
"
/etc/fstab
"
$mnt
"
/etc/fstab.old
...
...
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