aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-11-09 21:21:17 +0000
committerJudd Vinet <judd@archlinux.org>2005-11-09 21:21:17 +0000
commit71468248567e6bf1e794094d9b5f87ac61de033a (patch)
tree78b6f678577e5c76554cd97bc357565a5bcb525f /rc.sysinit
parentf947ecffc4a9109d0790e5b2853e2a835b4cf81b (diff)
downloadinitscripts-71468248567e6bf1e794094d9b5f87ac61de033a.tar.xz
added logic to free up initrd memory once it's not needed anymore
Diffstat (limited to 'rc.sysinit')
-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