Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Build error when crypto and swcrypto are omitted from kernel



On Sun, 10 May 2020, Michael van Elst wrote:

paul%whooppee.com@localhost (Paul Goyette) writes:

the kernel.  Without this, the kernel fails to link, with undefined
references to several symbols:
	rijndael_cipherInit
	rijndael_blockEncrypt
	rijndael_blockDecrypt
	rijndael_makeKey

Since the two crypto devices are optional (and run-time loadable)
components of the kernel, it seems to me that encrypted-swap should
also be optional.

rijndael isn't (yet) optional as it is required by ipsec and wlan code.
We just miss the dependency for the encrypted swap functionality.

Prior to the encrypted-swap commit, a kernel configured without the
``pseudo-device crypto'' was able to link and run successfully.  (Any
attempt to use rijndael results in an auto-load of the crypto module.)

Here is a patch that makes encrypted swap (but not rijndael) optional:

http://ftp.netbsd.org/pub/NetBSD/misc/mlelstv/uvm_swap.diff

which might be useful to create small kernels (it's just about 16kB).

Otherwise you could just add the dependency to uvm unconditionally.

Seems to me that any attempt to enable encrypted-swap should also
trigger an auto-load for the crypto module.  Appropriate module hooks
should be used to avoid the undefined symbols.


+--------------------+--------------------------+-----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost     |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost   |
+--------------------+--------------------------+-----------------------+


Home | Main Index | Thread Index | Old Index