WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: adding udev custom rule  (Read 4063 times)

Offline mattes

  • Newbie
  • *
  • Posts: 8
adding udev custom rule
« 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?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: adding udev custom rule
« Reply #1 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

Offline mattes

  • Newbie
  • *
  • Posts: 8
Re: adding udev custom rule
« Reply #2 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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: adding udev custom rule
« Reply #3 on: October 04, 2013, 09:40:09 PM »
Using 'ifrename' in bootlocal.sh might be more simple.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline mattes

  • Newbie
  • *
  • Posts: 8
Re: adding udev custom rule
« Reply #4 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.


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: adding udev custom rule
« Reply #5 on: October 04, 2013, 11:09:16 PM »
Use "provides" function of appbrowser to search for files.
Likely it's in wireless_tools.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: adding udev custom rule
« Reply #6 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.
The only barriers that can stop you are the ones you create yourself.

Offline mattes

  • Newbie
  • *
  • Posts: 8
Re: adding udev custom rule
« Reply #7 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.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: adding udev custom rule
« Reply #8 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.