|
@@ -33,6 +33,9 @@ supivot() { # <new_root> <old_root>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
switch_to_ramfs() {
|
|
switch_to_ramfs() {
|
|
|
|
|
+ RAMFS_COPY_LOSETUP="$(command -v losetup)"
|
|
|
|
|
+ RAMFS_COPY_LVM="$(command -v lvm)"
|
|
|
|
|
+
|
|
|
for binary in \
|
|
for binary in \
|
|
|
/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
|
|
/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
|
|
|
pivot_root mount_root reboot sync kill sleep \
|
|
pivot_root mount_root reboot sync kill sleep \
|
|
@@ -43,6 +46,7 @@ switch_to_ramfs() {
|
|
|
ubiupdatevol ubiattach ubiblock ubiformat \
|
|
ubiupdatevol ubiattach ubiblock ubiformat \
|
|
|
ubidetach ubirsvol ubirmvol ubimkvol \
|
|
ubidetach ubirsvol ubirmvol ubimkvol \
|
|
|
snapshot snapshot_tool date \
|
|
snapshot snapshot_tool date \
|
|
|
|
|
+ $RAMFS_COPY_LOSETUP $RAMFS_COPY_LVM \
|
|
|
$RAMFS_COPY_BIN
|
|
$RAMFS_COPY_BIN
|
|
|
do
|
|
do
|
|
|
local file="$(command -v "$binary" 2>/dev/null)"
|
|
local file="$(command -v "$binary" 2>/dev/null)"
|
|
@@ -60,6 +64,12 @@ switch_to_ramfs() {
|
|
|
/bin/mount -o remount,ro /mnt
|
|
/bin/mount -o remount,ro /mnt
|
|
|
/bin/umount -l /mnt
|
|
/bin/umount -l /mnt
|
|
|
|
|
|
|
|
|
|
+ [ "$RAMFS_COPY_LOSETUP" ] && losetup -D
|
|
|
|
|
+ [ "$RAMFS_COPY_LVM" ] && {
|
|
|
|
|
+ mkdir -p /tmp/lvm/cache
|
|
|
|
|
+ $RAMFS_COPY_LVM vgchange -aln --ignorelockingfailure
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
grep /overlay /proc/mounts > /dev/null && {
|
|
grep /overlay /proc/mounts > /dev/null && {
|
|
|
/bin/mount -o noatime,remount,ro /overlay
|
|
/bin/mount -o noatime,remount,ro /overlay
|
|
|
/bin/umount -l /overlay
|
|
/bin/umount -l /overlay
|