Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: mattes on October 03, 2013, 03:28:38 PM

Title: adding udev custom rule
Post by: mattes on October 03, 2013, 03:28:38 PM
I installed tiny core on a machine with 2 network cards. it happens to be that  the network card order is changing.
So i added a udev rules to /etc/udev/rules.d/60-persistant-nw.rules and add the new file to /opt/.filetool.lst

When I run  'filetool.sh -b'  it is not added to  tce/mydata.tgz.

What is the proper way add custom udev rules to Tiny Core?
Title: Re: adding udev custom rule
Post by: Rich on October 03, 2013, 11:36:44 PM
Hi mattes
Make sure you leave out the leading slash when you add the line to  /opt/.filetool.lst:
Code: [Select]
etc/udev/rules.d/60-persistant-nw.rules
Title: Re: adding udev custom rule
Post by: mattes on October 04, 2013, 05:19:11 PM
Make sure you leave out the leading slash when you add the line to  /opt/.filetool.lst:

I actually did use it without slash.  Later I found out that I must have a typo in it.
Now it is actually working and included in mydata.tgz, and properly populated on reboot.

But as I found out, my custom net rule is not recognized.  I know the custom rule ok. It works when I remove the driver module
and then reload it with 'modprobe'.  But it fails on bootup.

It most likely a timing problem. When mydata.tgz (which contains /etc/udev/riles.d/60-persistent-net.rules) is unpacked,
the udev subsystem already assigned the network device names.

I could do a post rmmod, modprobe, ipconfig for both interface, but that is pretty much a 'cluttery' kludge and messy.

I ended up creating a custom tce/boot/core.gz, which is like the original, with my  /etc/udev/rules.d/60-persistent-net.rules  added.
Now my udev network custom rule is properly recognized at system startup.

no more changing device order.

Question: Should this be considered a bug?
Would be nice to have a facility (other core.gz) to have custom udev rules recognized at boottime.
For built-in networking devices it kinda essential.

mattes
Title: Re: adding udev custom rule
Post by: tinypoodle on October 04, 2013, 09:40:09 PM
Using 'ifrename' in bootlocal.sh might be more simple.
Title: Re: adding udev custom rule
Post by: mattes on October 04, 2013, 10:44:46 PM
Using 'ifrename' in bootlocal.sh might be more simple.

Never used that before. Is there a package available for tiny core?
is not part of the base.

Title: Re: adding udev custom rule
Post by: tinypoodle on October 04, 2013, 11:09:16 PM
Use "provides" function of appbrowser to search for files.
Likely it's in wireless_tools.
Title: Re: adding udev custom rule
Post by: curaga on October 05, 2013, 04:22:27 AM
Quote
Question: Should this be considered a bug?
Would be nice to have a facility (other core.gz) to have custom udev rules recognized at boottime.
For built-in networking devices it kinda essential.

No, it's not a bug. You have a catch-22 there: without udev you have no drives from which to load anything from.
Title: Re: adding udev custom rule
Post by: mattes on October 05, 2013, 12:07:39 PM
Quote
Question: Should this be considered a bug?
Would be nice to have a facility (other core.gz) to have custom udev rules recognized at boottime.
For built-in networking devices it kinda essential.

No, it's not a bug. You have a catch-22 there: without udev you have no drives from which to load anything from.

Maybe there could be  tce/boot/core_custom_addon.gz that is loaded after core.gz and before the kernel is started.
Title: Re: adding udev custom rule
Post by: gerald_clark on October 05, 2013, 12:34:10 PM
You can add an additional gz at boot.
Either use a boot loader that accepts multiple initrds or append it to the core.gz.
Ex:  cat core.gz  additional.gz > mycore.gz
Then use mycore.gz as the initrd.