diff options
-rw-r--r-- | src/initrd/btrfs-create.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh index 567ad97..f47dfaf 100644 --- a/src/initrd/btrfs-create.sh +++ b/src/initrd/btrfs-create.sh | |||
@@ -71,6 +71,19 @@ init_samizdat() | |||
71 | initialize_root_filesystem || return | 71 | initialize_root_filesystem || return |
72 | } | 72 | } |
73 | 73 | ||
74 | movemounts() | ||
75 | { | ||
76 | # Move mounted filesystems to the future root filesystem | ||
77 | while read dev mp rest; do | ||
78 | case "$mp" in | ||
79 | /root/*|/root|/|/proc|/dev|/dev/pts|/sys|/run) continue ;; | ||
80 | *) target=/root/$mp ;; | ||
81 | esac | ||
82 | mkdir -p "$target" | ||
83 | mount -n -o move "$mp" "$target" | ||
84 | done </proc/mounts | ||
85 | } | ||
86 | |||
74 | samizdat_movemounts() | 87 | samizdat_movemounts() |
75 | { | 88 | { |
76 | local imgfile="$1" mountpoint | 89 | local imgfile="$1" mountpoint |
@@ -83,6 +96,7 @@ samizdat_movemounts() | |||
83 | mkdir /root/cdrom | 96 | mkdir /root/cdrom |
84 | mount -o move /cdrom /root/cdrom | 97 | mount -o move /cdrom /root/cdrom |
85 | umount /plaintext | 98 | umount /plaintext |
99 | movemounts | ||
86 | true | 100 | true |
87 | } | 101 | } |
88 | 102 | ||