aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrc.sysinit9
1 files changed, 7 insertions, 2 deletions
diff --git a/rc.sysinit b/rc.sysinit
index e9dad36..af6bcf5 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -39,8 +39,13 @@ if [ -e /initrd/dev/mapper/root ]; then
mkdir /dev/mapper 2>/dev/null
cp -a /initrd/dev/mapper/root /dev/mapper/root
fi
-# Unmount the old initrd, if it exists
-[ -d /initrd ] && umount /initrd 2>/dev/null
+# Unmount and free up the old initrd if it exists
+if [ -f /initrd/linuxrc ]; then
+ stat_busy "Freeing memory from initial ramdisk"
+ umount /initrd 2>/dev/null
+ /sbin/blockdev --flushbufs /dev/rd/0 2>/dev/null
+ stat_done
+fi
# TODO: set up non-root encrypted partition mappings