summaryrefslogtreecommitdiff
path: root/src/initrd/btrfs-create.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/initrd/btrfs-create.sh')
-rw-r--r--src/initrd/btrfs-create.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh
index cdf73ef..9604340 100644
--- a/src/initrd/btrfs-create.sh
+++ b/src/initrd/btrfs-create.sh
@@ -58,7 +58,8 @@ cdrom_has_rootfs()
58 58
59losetup_layers() 59losetup_layers()
60{ 60{
61 if cdrom_has_rootfs; then 61 if cdrom_has_rootfs
62 then
62 # TODO: This is some kind of shortcut or short circuit to find these 63 # TODO: This is some kind of shortcut or short circuit to find these
63 # files, that ought to be found through the grok-block system (i.e., 64 # files, that ought to be found through the grok-block system (i.e.,
64 # event-driven rather than polling). 65 # event-driven rather than polling).
@@ -68,14 +69,23 @@ losetup_layers()
68 dd if=/dev/zero of="$fs_rw" bs=1M count=10 69 dd if=/dev/zero of="$fs_rw" bs=1M count=10
69 losetup_snapshot "$fs" "$fs_rw" || return 70 losetup_snapshot "$fs" "$fs_rw" || return
70 done 71 done
72 elif [ -e /dev/disk/by-partlabel/samizdat-rootfs ]
73 then
74 local dev
75 for dev in samizdat-rootfs
76 do
77 umount /dev/disk/by-partlabel/$dev
78 dd if=/dev/zero of=/$dev.rw bs=1M count=10
79 dm_snapshot /dev/disk/by-partlabel/$dev /$dev.rw
80 done
71 else 81 else
72 bootwait samizdat-nbd-dev 82 bootwait samizdat-nbd-dev
73 local dev 83 local dev
74 for dev in nbd0 nbd1; do 84 for dev in nbd0 nbd1
85 do
75 dd if=/dev/zero of=/$dev.rw bs=1M count=10 86 dd if=/dev/zero of=/$dev.rw bs=1M count=10
76 dm_snapshot /dev/$dev /$dev.rw 87 dm_snapshot /dev/$dev /$dev.rw
77 done 88 done
78 return
79 fi 89 fi
80} 90}
81 91