From: <ef...@sy...> - 2007-04-27 15:21:32
|
Author: efocht Date: 2007-04-27 10:21:20 -0500 (Fri, 27 Apr 2007) New Revision: 4042 Modified: trunk/initrd_source/skel/init Log: Delete all files from the rootfs which otherwise remain in RAM. The files in initramfs are in cache as dirty buffers, but they have no backing storage device, i.e. can never be flushed. Modified: trunk/initrd_source/skel/init =================================================================== --- trunk/initrd_source/skel/init 2007-04-27 14:05:51 UTC (rev 4041) +++ trunk/initrd_source/skel/init 2007-04-27 15:21:20 UTC (rev 4042) @@ -6,11 +6,16 @@ echo "initramfs detected: init called" +delete_rootfs_files() { + sleep 10 + rm -rf / +} + mkdir -p /new_root || shellout mount tmpfs /new_root -t tmpfs $tmpfs_opts || shellout cd / || shellout cp -a `/bin/ls | grep -v new_root` /new_root/ || shellout cd /new_root || shellout mkdir -p old_root || shellout - +delete_rootfs_files >/dev/null </dev/null 2>&1 & mount --move . / && exec chroot . /linuxrc |