From 71468248567e6bf1e794094d9b5f87ac61de033a Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Wed, 9 Nov 2005 21:21:17 +0000 Subject: added logic to free up initrd memory once it's not needed anymore --- rc.sysinit | 9 +++++++-- 1 file 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 -- cgit v1.2.3