[Buildroot] swapoff, but no swapon in initab

Arnout Vandecappelle arnout at mind.be
Tue Jun 19 21:51:45 UTC 2018



On 12-06-18 16:50, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout at mind.be> writes:
> 
>  >> But it does require people to add swapon/swapoff to their busybox config
>  >> even if they aren't using swap, otherwise they would get error messages
> 
>  >  I think if people start customizing the busybox config and remove stuff from
>  > it, then it's only reasonable that they also modify the default
>  > inittab.
> 
> Correct.
> 
>  > Swaponand swapoff are both enabled in our busybox.config and busybox-minimal.config.
> 
> Hmm, does swap work on nommu? I would guess not. Looking at the kernel
> option:

 Doesn't matter if it works or not; if the swapon executable exists, then the
swapon in inittab will pass without error (if you don't have swap configured in
fstab). Clearly, the swapon will fail if you indeed have swap enabled in fstab
on a NOMMU system, but I don't think we have to protect against that situation,
right? It will anyway also fail if you don't have swap enabled in the kernel.
Just like mounting the ext2 rootfs will fail if you don't have ext2/3/4 enabled
in your kernel...

 Regards,
 Arnout

> 
> git grep -A3 'config SWAP' init/Kconfig
> init/Kconfig:config SWAP
> init/Kconfig-   bool "Support for paging of anonymous memory (swap)"
> init/Kconfig-   depends on MMU && BLOCK
> init/Kconfig-   default y
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF


More information about the buildroot mailing list