Autoload kernel module if necessary.
Submitted by: mr
This commit is contained in:
parent
f4db0cbe58
commit
ad3cb316b3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120877
@ -53,7 +53,10 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <crypto/rijndael/rijndael.h>
|
#include <crypto/rijndael/rijndael.h>
|
||||||
#include <crypto/sha2/sha2.h>
|
#include <crypto/sha2/sha2.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/linker.h>
|
||||||
|
|
||||||
|
#define GBDEMOD "geom_bde"
|
||||||
#define KASSERT(foo, bar) do { if(!(foo)) { warn bar ; exit (1); } } while (0)
|
#define KASSERT(foo, bar) do { if(!(foo)) { warn bar ; exit (1); } } while (0)
|
||||||
|
|
||||||
#include <geom/geom.h>
|
#include <geom/geom.h>
|
||||||
@ -669,6 +672,12 @@ main(int argc, char **argv)
|
|||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
usage("Too few arguments\n");
|
usage("Too few arguments\n");
|
||||||
|
|
||||||
|
if ((i = kldfind(GBDEMOD)) < 0) {
|
||||||
|
/* need to load the gbde module */
|
||||||
|
if (kldload(GBDEMOD) < 0 || kldfind(GBDEMOD) < 0) {
|
||||||
|
usage(GBDEMOD ": Kernel module not available");
|
||||||
|
}
|
||||||
|
}
|
||||||
doopen = 0;
|
doopen = 0;
|
||||||
if (!strcmp(argv[1], "attach")) {
|
if (!strcmp(argv[1], "attach")) {
|
||||||
action = ACT_ATTACH;
|
action = ACT_ATTACH;
|
||||||
|
Loading…
Reference in New Issue
Block a user