The following threads suggest that the way to reclaim memory occupied by initramfs is to remove files from it: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&frame=right&th=c6cb846bba1a7aea&seekm=SAUO.51B.21%40gated-at.bofh.it#link1 http://seclists.org/lists/linux-kernel/2003/Dec/0707.html However, there is no way to do it using utilities provided by klibs. Could you please include the "unlink" and "rmdir" programs into the distribution? Just put the attached *.c files in klibc/utils and adjust the PROGS target in the Makefile there. Also, to make life for script-writers simpler, we could consider writing a "glue" program that has the following synopsis: glue real_root program args The "glue" program removes all files except "real_root" directory from the / directory (including itself), remounts that directory on the root directory, chroots there and execs the specified program with the remaining arguments. Rationale: without this, it is impossible to completely reclaim the initramfs memory from the script since at least the "chroot" binary must exist before chrooting from a script, and it can't be removed after chroot. -- Alexander E. Patrakov
Alexander E. Patrakov wrote:> > Also, to make life for script-writers simpler, we could consider writing > a "glue" program that has the following synopsis: > > glue real_root program args > > The "glue" program removes all files except "real_root" directory from > the / directory (including itself), remounts that directory on the root > directory, chroots there and execs the specified program with the > remaining arguments. > > Rationale: without this, it is impossible to completely reclaim the > initramfs memory from the script since at least the "chroot" binary must > exist before chrooting from a script, and it can't be removed after chroot. >This seems like it should move into kinit, I'm not sure... opinions? -hpa
Alexander E. Patrakov wrote:> The following threads suggest that the way to reclaim memory occupied by > initramfs is to remove files from it: > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&frame=right&th=c6cb846bba1a7aea&seekm=SAUO.51B.21%40gated-at.bofh.it#link1 > > http://seclists.org/lists/linux-kernel/2003/Dec/0707.html > > However, there is no way to do it using utilities provided by klibs. > > Could you please include the "unlink" and "rmdir" programs into the > distribution? Just put the attached *.c files in klibc/utils and adjust > the PROGS target in the Makefile there. >I just added a "nuke" program, which does the equivalent of "rm -rf". Do we also need unlink/rmdir? The nuke program is in klibc-0.122. -hpa
Possibly Parallel Threads
- Resampler set_rate improvements
- Syslinux 5.00 - Doesn't boot my system / Not passing the kernel options to the kernel?
- Re: [systemd-devel] systemd-udevd: excessive I/O usage
- dom0 linux system consoles; running domU problems
- Register parameters are unsafe with gcc 3.3.2