kernel compilation: generate modules.dep and map files
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I am compiling linux kernel on Debian Stretch:
cd linux-4.9.59/
make menuconfig
make
so far so good.
normally, I would then issue make modules_install
, to copy the modules to /lib/modules/
.
But this kernel is intended for another machine, so I don't want to copy the modules locally. Besides, I am not compiling as root, so writing to /lib/modules/
would not work anyway.
export INSTALL_MOD_PATH="../MY_NEW_KERNEL"
mkdir -vp "$INSTALL_MOD_PATH
make modules_install
The above copies the newly compiled modules to directory ../MY_NEW_KERNEL/lib/modules/
. But it does not generate the modules.dep and map files in ../MY_NEW_KERNEL/lib/modules/
Normally, if this was currently running kernel, I could run depmod
to generate it in /lib/modules/
. But I am not running this kernel on current machine.
And even when I copy bzImage and modules to the target machine, I would have to restart into the new kernel first, and then run depmod
.
But the problem is, the kernel will not boot because it cannot find the modules, because I did not run depmod
.
How can I run depmod
for kernel modules, when the kernel is not currently running ?
debian linux-kernel kernel-modules
add a comment |Â
up vote
2
down vote
favorite
I am compiling linux kernel on Debian Stretch:
cd linux-4.9.59/
make menuconfig
make
so far so good.
normally, I would then issue make modules_install
, to copy the modules to /lib/modules/
.
But this kernel is intended for another machine, so I don't want to copy the modules locally. Besides, I am not compiling as root, so writing to /lib/modules/
would not work anyway.
export INSTALL_MOD_PATH="../MY_NEW_KERNEL"
mkdir -vp "$INSTALL_MOD_PATH
make modules_install
The above copies the newly compiled modules to directory ../MY_NEW_KERNEL/lib/modules/
. But it does not generate the modules.dep and map files in ../MY_NEW_KERNEL/lib/modules/
Normally, if this was currently running kernel, I could run depmod
to generate it in /lib/modules/
. But I am not running this kernel on current machine.
And even when I copy bzImage and modules to the target machine, I would have to restart into the new kernel first, and then run depmod
.
But the problem is, the kernel will not boot because it cannot find the modules, because I did not run depmod
.
How can I run depmod
for kernel modules, when the kernel is not currently running ?
debian linux-kernel kernel-modules
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am compiling linux kernel on Debian Stretch:
cd linux-4.9.59/
make menuconfig
make
so far so good.
normally, I would then issue make modules_install
, to copy the modules to /lib/modules/
.
But this kernel is intended for another machine, so I don't want to copy the modules locally. Besides, I am not compiling as root, so writing to /lib/modules/
would not work anyway.
export INSTALL_MOD_PATH="../MY_NEW_KERNEL"
mkdir -vp "$INSTALL_MOD_PATH
make modules_install
The above copies the newly compiled modules to directory ../MY_NEW_KERNEL/lib/modules/
. But it does not generate the modules.dep and map files in ../MY_NEW_KERNEL/lib/modules/
Normally, if this was currently running kernel, I could run depmod
to generate it in /lib/modules/
. But I am not running this kernel on current machine.
And even when I copy bzImage and modules to the target machine, I would have to restart into the new kernel first, and then run depmod
.
But the problem is, the kernel will not boot because it cannot find the modules, because I did not run depmod
.
How can I run depmod
for kernel modules, when the kernel is not currently running ?
debian linux-kernel kernel-modules
I am compiling linux kernel on Debian Stretch:
cd linux-4.9.59/
make menuconfig
make
so far so good.
normally, I would then issue make modules_install
, to copy the modules to /lib/modules/
.
But this kernel is intended for another machine, so I don't want to copy the modules locally. Besides, I am not compiling as root, so writing to /lib/modules/
would not work anyway.
export INSTALL_MOD_PATH="../MY_NEW_KERNEL"
mkdir -vp "$INSTALL_MOD_PATH
make modules_install
The above copies the newly compiled modules to directory ../MY_NEW_KERNEL/lib/modules/
. But it does not generate the modules.dep and map files in ../MY_NEW_KERNEL/lib/modules/
Normally, if this was currently running kernel, I could run depmod
to generate it in /lib/modules/
. But I am not running this kernel on current machine.
And even when I copy bzImage and modules to the target machine, I would have to restart into the new kernel first, and then run depmod
.
But the problem is, the kernel will not boot because it cannot find the modules, because I did not run depmod
.
How can I run depmod
for kernel modules, when the kernel is not currently running ?
debian linux-kernel kernel-modules
asked Oct 28 '17 at 22:48
Martin Vegter
1,00731110218
1,00731110218
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
To answer your question, this should work. The System.map was created in the just-built source directory and is required:
$ depmod -b "$INSTALL_MOD_PATH" -F System.map 4.9.59
Where 4.9.59 is your new non-running kernel's version.
Now, even the plain vanilla linux kernel source allows to build debian packages.
$ make help|grep deb
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
e,g: Instead of make
and make modules_install
(as normal user, root isn't needed):
stretch-amd64:~/linux-source-4.13.10$ make bindeb-pkg -j4
[... way later ...]
stretch-amd64:~/linux-source-4.13.10$ $ ls -1 ../*4.13.10*deb
../linux-headers-4.13.10_4.13.10-1_amd64.deb
../linux-image-4.13.10_4.13.10-1_amd64.deb
../linux-libc-dev_4.13.10-1_amd64.deb
Of course this might require a few additional debian packages, like dpkg-dev
, fakeroot
and a few related, but if the destination is a debian too, that's then perhaps easier to install it there.
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
To answer your question, this should work. The System.map was created in the just-built source directory and is required:
$ depmod -b "$INSTALL_MOD_PATH" -F System.map 4.9.59
Where 4.9.59 is your new non-running kernel's version.
Now, even the plain vanilla linux kernel source allows to build debian packages.
$ make help|grep deb
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
e,g: Instead of make
and make modules_install
(as normal user, root isn't needed):
stretch-amd64:~/linux-source-4.13.10$ make bindeb-pkg -j4
[... way later ...]
stretch-amd64:~/linux-source-4.13.10$ $ ls -1 ../*4.13.10*deb
../linux-headers-4.13.10_4.13.10-1_amd64.deb
../linux-image-4.13.10_4.13.10-1_amd64.deb
../linux-libc-dev_4.13.10-1_amd64.deb
Of course this might require a few additional debian packages, like dpkg-dev
, fakeroot
and a few related, but if the destination is a debian too, that's then perhaps easier to install it there.
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
add a comment |Â
up vote
2
down vote
accepted
To answer your question, this should work. The System.map was created in the just-built source directory and is required:
$ depmod -b "$INSTALL_MOD_PATH" -F System.map 4.9.59
Where 4.9.59 is your new non-running kernel's version.
Now, even the plain vanilla linux kernel source allows to build debian packages.
$ make help|grep deb
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
e,g: Instead of make
and make modules_install
(as normal user, root isn't needed):
stretch-amd64:~/linux-source-4.13.10$ make bindeb-pkg -j4
[... way later ...]
stretch-amd64:~/linux-source-4.13.10$ $ ls -1 ../*4.13.10*deb
../linux-headers-4.13.10_4.13.10-1_amd64.deb
../linux-image-4.13.10_4.13.10-1_amd64.deb
../linux-libc-dev_4.13.10-1_amd64.deb
Of course this might require a few additional debian packages, like dpkg-dev
, fakeroot
and a few related, but if the destination is a debian too, that's then perhaps easier to install it there.
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
To answer your question, this should work. The System.map was created in the just-built source directory and is required:
$ depmod -b "$INSTALL_MOD_PATH" -F System.map 4.9.59
Where 4.9.59 is your new non-running kernel's version.
Now, even the plain vanilla linux kernel source allows to build debian packages.
$ make help|grep deb
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
e,g: Instead of make
and make modules_install
(as normal user, root isn't needed):
stretch-amd64:~/linux-source-4.13.10$ make bindeb-pkg -j4
[... way later ...]
stretch-amd64:~/linux-source-4.13.10$ $ ls -1 ../*4.13.10*deb
../linux-headers-4.13.10_4.13.10-1_amd64.deb
../linux-image-4.13.10_4.13.10-1_amd64.deb
../linux-libc-dev_4.13.10-1_amd64.deb
Of course this might require a few additional debian packages, like dpkg-dev
, fakeroot
and a few related, but if the destination is a debian too, that's then perhaps easier to install it there.
To answer your question, this should work. The System.map was created in the just-built source directory and is required:
$ depmod -b "$INSTALL_MOD_PATH" -F System.map 4.9.59
Where 4.9.59 is your new non-running kernel's version.
Now, even the plain vanilla linux kernel source allows to build debian packages.
$ make help|grep deb
deb-pkg - Build both source and binary deb kernel packages
bindeb-pkg - Build only the binary kernel deb package
e,g: Instead of make
and make modules_install
(as normal user, root isn't needed):
stretch-amd64:~/linux-source-4.13.10$ make bindeb-pkg -j4
[... way later ...]
stretch-amd64:~/linux-source-4.13.10$ $ ls -1 ../*4.13.10*deb
../linux-headers-4.13.10_4.13.10-1_amd64.deb
../linux-image-4.13.10_4.13.10-1_amd64.deb
../linux-libc-dev_4.13.10-1_amd64.deb
Of course this might require a few additional debian packages, like dpkg-dev
, fakeroot
and a few related, but if the destination is a debian too, that's then perhaps easier to install it there.
edited Oct 29 '17 at 16:06
GAD3R
22.7k154895
22.7k154895
answered Oct 28 '17 at 23:59
A.B
3,4901621
3,4901621
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
add a comment |Â
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
that works. Thank you.
â Martin Vegter
Oct 29 '17 at 13:36
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f401138%2fkernel-compilation-generate-modules-dep-and-map-files%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password