Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 639fc03

Browse files
committed
Workflows: Use LVM to combine disks
1 parent 3c85054 commit 639fc03

7 files changed

Lines changed: 63 additions & 28 deletions

File tree

.github/workflows/bcm27xx-bcm2708.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/bcm27xx-bcm2709.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/bcm27xx-bcm2710.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/bcm27xx-bcm2711.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/ipq40xx-generic.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/rockchip-armv8.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

.github/workflows/x86-64.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,19 @@ jobs:
204204
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
205205
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
206206
sudo fallocate -l $ROOT_LOOP_BYTES /root.img
207-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
207+
export ROOT_LOOP_DEVNAME=$(sudo losetup -Pf --show /root.img)
208+
sudo pvcreate -f $ROOT_LOOP_DEVNAME
208209
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
209210
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
210211
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
211212
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
212-
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
213-
sudo mkfs.btrfs -f -d single -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
214-
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE
213+
export MNT_LOOP_DEVNAME=$(sudo losetup -Pf --show /mnt/mnt.img)
214+
sudo pvcreate -f $MNT_LOOP_DEVNAME
215+
sudo vgcreate vgstorage $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
216+
sudo lvcreate -n lvstorage -l 100%FREE vgstorage
217+
export LV_DEVNAME=$(sudo lvscan | awk -F "'" '{print $2}')
218+
sudo mkfs.btrfs -L combinedisk $LV_DEVNAME
219+
sudo mount -o compress=zstd $LV_DEVNAME $GITHUB_WORKSPACE
215220
sudo chown -R runner:runner $GITHUB_WORKSPACE
216221
mkdir $GITHUB_WORKSPACE/tmp
217222
chmod 777 $GITHUB_WORKSPACE/tmp

0 commit comments

Comments
 (0)