-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Convert LVM to zpool (with secure init/trim). Poweroff comma…
…nd. Bug fixes (#4) * Pin ZBM tag * Bug fixes. Feature: Convert LVM root to ZFS root
- Loading branch information
Showing
14 changed files
with
376 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ tailscaled.state* | |
cache | ||
*test* | ||
*ssh_host* | ||
.code-workspace | ||
*.code-workspace | ||
authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
recipes/zquick_core/fs/libexec/hooks/early-setup.d/lvm_setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
log() { | ||
echo "zquick: $1" > /dev/kmsg | ||
} | ||
|
||
if command -v lvm >/dev/null 2>&1; then | ||
|
||
log "Scanning for LVM" | ||
modprobe dm_thin_pool | ||
lvm vgscan -v 2>/dev/null | ||
lvm vgchange -a y 2>/dev/null | ||
|
||
lvm_volumes=$(lvm lvscan 2>/dev/null | awk '{print $2}' | tr -d "'") | ||
for volume in $lvm_volumes; do | ||
# Get the logical volume path | ||
lv_path=$(lvm lvdisplay "${volume}" 2>/dev/null | grep "LV Path" | awk '{print $3}') | ||
|
||
if [[ $(lsblk -no FSTYPE "${lv_path}") = "swap" ]]; then | ||
log "Skipping swap: ${lv_path}" | ||
continue; | ||
fi | ||
|
||
# Get the volume path | ||
volume=$(echo "${lv_path}" | awk -F'/' '{for(i=3;i<=NF;i++) printf "/%s", $i}') | ||
|
||
# Create the mount point directory | ||
mkdir -p "/mnt${volume}" | ||
|
||
# Mount the volume | ||
log "Mounting ${lv_path} on /mnt${volume}" | ||
mount "${lv_path}" "/mnt${volume}" | ||
done | ||
else | ||
log "Skipping LVM setup, lvm not part of this image" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
build() { | ||
rm -rf "${BUILDROOT}/input" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
help: "Required - last thing to be built" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.