"make release" draft
This commit is contained in:
21
alpine/sync-loop.sh
Executable file
21
alpine/sync-loop.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
DEVICE="$1"
|
||||
FAKE_DEV="/tmp/dev"
|
||||
|
||||
mkdir -p "$FAKE_DEV"
|
||||
|
||||
echo "Refreshing partition table..."
|
||||
partx -u "$DEVICE" 2>/dev/null || partx -a "$DEVICE"
|
||||
|
||||
# Find partitions and their Major:Minor numbers
|
||||
lsblk -rn -o NAME,MAJ:MIN "$DEVICE" | while read -r NAME MAJMIN; do
|
||||
# Skip the parent loop0
|
||||
if [[ "$NAME" == "loop0" ]]; then continue; fi
|
||||
|
||||
PART_PATH="$FAKE_DEV/$NAME"
|
||||
MAJOR=$(echo $MAJMIN | cut -d: -f1)
|
||||
MINOR=$(echo $MAJMIN | cut -d: -f2)
|
||||
|
||||
echo "Creating node: $PART_PATH (b $MAJOR $MINOR)"
|
||||
mknod "$PART_PATH" b "$MAJOR" "$MINOR"
|
||||
done
|
||||
Reference in New Issue
Block a user