On Tue, Jan 16, 2018 at 11:56 AM, enexis <[email protected]> wrote:
> On Tuesday, January 16, 2018 at 5:06:27 PM UTC+2, David Michael wrote:
>> On Tue, Jan 16, 2018 at 7:56 AM, enexis <[email protected]> wrote:
>> > Hi all,
>> >
>> > I was trying to build new kernel module (what is missing in the current
>> > releases) following this guide:
>> > https://coreos.com/os/docs/latest/kernel-modules.html
>> >
>> > All good except the fact when I start the container with nspawn there is
>> > only a limited 2.9GB root disk space available which fills up quickly :
>> >
>> > coreos_developer_container ~ # df -h
>> > Filesystem      Size  Used Avail Use% Mounted on
>> > /dev/loop5p9    2.9G  2.9G     0 100% /
>> > tmpfs           2.0G     0  2.0G   0% /tmp
>> > tmpfs           2.0G     0  2.0G   0% /dev
>> > tmpfs           2.0G     0  2.0G   0% /dev/shm
>> > tmpfs           2.0G  4.0K  2.0G   1% /run
>> > tmpfs           2.0G  428K  2.0G   1% /run/systemd/nspawn/incoming
>> > overlay          47G  6.4G   38G  15% /usr/lib64/modules
>> > tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
>> >
>> > Been tried a few nspawn options none works, so I'm struggling there.
>> >
>> > Any advise ?
>>
>> You can bind a local directory over /usr/src or wherever you are
>> running the compilation with something like --bind="$PWD/src:/us/src".
>> Make sure to emerge coreos-sources again if you're reusing the same
>> containe
>>
>> Thanks.
>>
>> David
>
>
>
> Hi David,
> Many thanks it worked!
> I was able to build the required module, now just need to load it on pxe
> boot ...
> Any idea how to add module via PXE boot or shall I open a new topic
> regarding this ?

Well, the official recommendation would be to modify the kernel config
and build a PXE image with the SDK as in:
https://coreos.com/os/docs/latest/sdk-modifying-coreos.html

If you have the module built and installed in the developer container,
you could tack it onto an existing PXE initrd with something like this
and PXE boot with the new initrd:

> alias cpio='docker run --rm --volume="$PWD:/wd" --workdir=/wd -i busybox cpio'
> cp --parents /lib/modules/*-coreos/kernel/drivers/.../module.ko .
> mkdir -p etc/systemd/system/systemd-udevd.service.requires
> echo -e 
> '[Unit]\nDefaultDependencies=no\nBefore=systemd-udevd.service\n[Service]\nType=oneshot\nExecStart=/usr/sbin/depmod'
>  > etc/systemd/system/depmod.service
> ln -fs ../depmod.service etc/systemd/system/systemd-udevd.service.requires/
> find etc lib/modules/*-coreos/kernel/drivers/... | cpio -oHnewc | gzip | cat 
> coreos_production_pxe_image.cpio.gz - > new.cpio.gz

If you've confirmed that the module works for you and want it enabled
by default, you can request it here: https://issues.coreos.com/

Or, if you'd like, you can add it yourself.  Here is an example:
https://github.com/coreos/coreos-overlay/pull/3009

Thanks.

David

Reply via email to