[BusyBox] init: sysinfo [PATCH]

Shaun Jackman sjackman at gmail.com
Tue Jul 5 21:55:02 UTC 2005


Does anyone use the check_memory/swapon feature of init? If not, I'll
submit a patch to remove the feature and shave a few hundred bytes
from init.

Cheers,
Shaun

On 7/5/05, Jason Schoon <floydpink at gmail.com> wrote:
> I would agree with addition of a config option, rather than a unconditional
> call to check_memory().  None of my embedded systems use swap, so attempting
> to swapon will be of no use.
>  
>  Granted, I really don't want to be starting the system with less than a meg
> of RAM, but swapon() wouldn't fix the problem either.
>  
> On 7/4/05, Shaun Jackman <sjackman at gmail.com> wrote:
> > 
> > init uses sysinfo to check if the amount of memory is less than one
> > megabyte, and if so attempts to swapon.
> > 
> > According to the sysinfo(2) man page...
> >        This function is Linux-specific, and should not be  used  in  pro-
> >        grams intended to be portable.
> > 
> > So I suggest armouring its use in an ifdef. I used ifdef
> > _LINUX_TYPES_H, but I'd like to hear any suggestions of a better test.
> > 
> > I find altering the behaviour of init based on the amount of installed 
> > memory a bit of a hack though. I'd rather see check_memory removed
> > altogether. If the swapon functionality of init is useful to people,
> > perhaps a swapon switch to init would be called for.
> > 
> > Cheers,
> > Shaun



More information about the busybox mailing list