Skip to content

Commit 6f4d263

Browse files
ojafuenfigorpecovnik
authored andcommitted
fix(lvm): Use $ROOT_FS_LABEL instead of armbi_root
1 parent 1b606fa commit 6f4d263

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/lvm.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ function prepare_root_device__create_volume_group() {
6969

7070
function label_partition() {
7171
if [ "$ROOTFS_TYPE" == "ext4" ]; then
72-
e2label "/dev/mapper/${LVM_VG_NAME}-root" armbi_root
72+
e2label "/dev/mapper/${LVM_VG_NAME}-root" "${ROOT_FS_LABEL}"
7373
elif [ "$ROOTFS_TYPE" == "btrfs" ]; then
74-
btrfs filesystem label "$(mount | grep "/dev/mapper/${LVM_VG_NAME}-root" | awk '{print $3}')" armbi_root
75-
elif [ "$ROOTFS_TYPE" == "nilfs" ]; then
76-
nilfs-tune -L armbi_root "/dev/mapper/${LVM_VG_NAME}-root"
74+
btrfs filesystem label "$(mount | grep "/dev/mapper/${LVM_VG_NAME}-root" | awk '{print $3}')" "${ROOT_FS_LABEL}"
75+
elif [ "$ROOTFS_TYPE" == "nilfs2" ]; then
76+
nilfs-tune -L "${ROOT_FS_LABEL}" "/dev/mapper/${LVM_VG_NAME}-root"
7777
elif [ "$ROOTFS_TYPE" == "xfs" ]; then
78-
xfs_io -c "label -s armbi_root" "$(mount | grep "/dev/mapper/${LVM_VG_NAME}-root" | awk '{print $3}')"
78+
xfs_io -c "label -s \"${ROOT_FS_LABEL}\"" "$(mount | grep "/dev/mapper/${LVM_VG_NAME}-root" | awk '{print $3}')"
7979
fi
8080
}
8181

8282
function format_partitions__format_lvm() {
83-
# Skip unknown/unsupported filesystems. nfs does not support labels and f2fs labels cannot be changed online
84-
if echo "ext4 btrfs nilfs xfs" | grep -v -w -q "$ROOTFS_TYPE"; then
83+
# Skip unknown filesystems
84+
if echo "ext4 btrfs nilfs2 xfs" | grep -v -w -q "$ROOTFS_TYPE"; then
8585
display_alert "LVM partition labels skipped" "${EXTENSION}" "info"
8686
return
8787
fi

0 commit comments

Comments
 (0)