How to create .deb file for wifi driver? <SOLVED>

a very small Live CD shaped to look and act like Puppy Linux.

Moderator: fredx181

Post Reply
dcung
Posts: 363
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 38 times
Been thanked: 51 times

How to create .deb file for wifi driver? <SOLVED>

Post by dcung »

I use combo wifi driver that @rcrsn51 made for his Starter Kit.
He advised that this is kernel specific i.e. made for k6.1.0-9-amd64
viewtopic.php?t=644&start=391

For other various kernel versions, I found (and used)
https://github.com/morrownr/88x2bu-20210702

I'd like to create .deb file like what @rcrsn51 did.
So, I don't have to download/compile/install each time I do a fresh install (of various kernels) that needs the driver.

Is there a guide or how to that I can follow?
Thank you.

Last edited by dcung on Mon Mar 04, 2024 10:25 pm, edited 1 time in total.
User avatar
fredx181
Posts: 2561
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 times
Contact:

Re: How to create .deb file for wifi driver?

Post by fredx181 »

dcung wrote: Sun Mar 03, 2024 8:24 pm

I use combo wifi driver that @rcrsn51 made for his Starter Kit.
He advised that this is kernel specific i.e. made for k6.1.0-9-amd64
viewtopic.php?t=644&start=391

For other various kernel versions, I found (and used)
https://github.com/morrownr/88x2bu-20210702

I'd like to create .deb file like what @rcrsn51 did.
So, I don't have to download/compile/install each time I do a fresh install (of various kernels) that needs the driver.

Is there a guide or how to that I can follow?
Thank you.

I'm not sure if your question is mostly general (how create deb) or more specific about including the required files, kernel modules etc...

Anyway, what I would do in this case is extract the combo-wifi deb from Bill (take it as a base to modify), right-click (in thunar or pcmanfm) "Extract .deb" (or use redeb from terminal, see also below).
So you get folder: combo-wifi-k6.1.0-9_2_amd64, then modify as preferred e.g. adding/removing files or folders and by editing DEBIAN/control file and by changing the path lib/modules/<kernel-version> to what it exactly should be for you.
When done, then from terminal : redeb combo-wifi-k6.1.0-9_2_amd64 .
And a .deb package (in combo-wifi-k6.1.0-9_2_amd64_newbuild) will be created with the name and version you did provide in DEBIAN/control (Package: <name> , Version: <version>).
edit: the "redeb" script must exist in PATH (probably it is, should be in every "dog" system) and can be used to extract .deb also, e.g. redeb combo-wifi-k6.1.0-9_2_amd64.deb .

dcung
Posts: 363
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 38 times
Been thanked: 51 times

Re: How to create .deb file for wifi driver? <SOLVED>

Post by dcung »

fredx181 wrote: Mon Mar 04, 2024 8:27 am

I'm not sure if your question is mostly general (how create deb) or more specific about including the required files, kernel modules etc...
...

I probably didn't explain clearly. :)

Using Bill's combo driver, I can use it with any mklive-build as long as the kernel is 6.1.0-9-amd64.
Eg. If I use it with my latest daedalus mklive-build which has 6.1.0-15-amd64, it doesn't work.

Anyway, after reading your guide above, and analysing the .deb directory structure, I know that Bill's combo file would have copied/intalled it to the 'wrong' place when used with kernel other than 6.1.0-9-amd64.
So, I followed your guide and modified it accordingly. It copied/installed them to the 'right' place now, but it still didn't work. I assume that is because it was compiled with 6.1.0-9-amd64 kernel.

Combining these info that I have now, I compiled the (github) driver with 6.1.0-15-amd64 kernel. I go hunting for the new .ko file. I then replaced Bill's .ko files with the new compiled one. And I repackaged the .deb file.

I installed a fresh Dog with 6.1.0-15-amd64, and used the .deb file. And it works!

It's probably a dodgy way of doing things, but I achieved what I wanted to do thanks to your guidance. :thumbup:

User avatar
fredx181
Posts: 2561
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 times
Contact:

Re: How to create .deb file for wifi driver? <SOLVED>

Post by fredx181 »

@dcung Thanks, btw... just curious, why make and use a deb package to install if it's just for your own use ? I'd say, just copy files to the appropriate location would be easy enough and sufficient.
(and followed with a depmod -a in case of kernel module files).
edit: well .. I can imagine what could be possible answer, but again, I'm interested about your point of view ;)
EDIT2: Forgot to say , advantage of a .deb package can be to include it in a mklive build by choosing to run xterm at the beginning build settings , copying the deb file in the chroot folder, then just do from xterm when it appears near end of build: e.g.
dpkg -i <mypackage>.deb edit: or handy if more than one package in / (chroot) : dpkg -i *.deb (install all .deb)
and perhaps need to do (after that) :
apt -f install

dcung
Posts: 363
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 38 times
Been thanked: 51 times

Re: How to create .deb file for wifi driver? <SOLVED>

Post by dcung »

fredx181 wrote: Tue Mar 05, 2024 7:09 pm

... just curious, why make and use a deb package to install if it's just for your own use ? I'd say, just copy files to the appropriate location would be easy enough and sufficient.

Before this exercise, I didn't know how many/what/where files were added.
Afterward, like you said, I realised that I could just make simple script to copy those files appropriately.

I have many old laptops (too many indeed), some of which have only 2.4G wifi.
I have 2 of these cheap Realtek USB wifi (2.4G/5G) which I found a 'little' faster than those on-board wifi.

My goal was to be able to use these USB wifi w/o the need to limit to k6.1.0-9-amd64 or recompile - more importantly to learn more. Honestly speaking, I have no need to use these old laptops, since I have 'better' ones in spare still. I don't feel like sending them to landfill, but no one really want them here. So, they become my 'toys'.

I removed all Bill's combo driver .ko files (etc) and only keep my realtek .ko file, since this will minimise the .deb file size, and those .ko files were compiled for k6.1.0-9-amd64. I made few .deb 'kernel version', just my 'glorified' way of copying few kernel module drivers file.

I feel bad that it's always a 'one-way' brain-drain when you answer my post. But I'm grateful - I always knew more afterward.

Thanks Fred!

Post Reply

Return to “DebianDogs”