Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: lovelypp on September 21, 2020, 01:35:49 AM

Title: /etc/udev/rules.d/70-network.rules has no effect
Post by: lovelypp on September 21, 2020, 01:35:49 AM
to rename nic, I put 70-network.rules to /etc/udev/rules.d/, the content is as following:
SUBSYSTEM=="net", ATTR{address}=="00:18:7D:CC:10:22", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="00:18:7D:CC:10:21", NAME="eth1"

then I add etc/udev/rules.d/70-network.rules to .filetool.lst and backup it.

after reboot, I found no it has no effect. I don't know what's wrong, thanks!
Title: Re: /etc/udev/rules.d/70-network.rules has no effect
Post by: curaga on September 21, 2020, 09:22:16 AM
Backup happens late - the device has already been created. You may have to call udevadm trigger with specific options, or use one of the many ifrename tools.
Title: Re: /etc/udev/rules.d/70-network.rules has no effect
Post by: lovelypp on September 23, 2020, 06:53:44 PM
thanks
Title: Re: /etc/udev/rules.d/70-network.rules has no effect
Post by: lovelypp on September 26, 2020, 04:57:09 AM
is there any method to bring the Backup resore step forward ?
Title: Re: /etc/udev/rules.d/70-network.rules has no effect
Post by: Rich on September 26, 2020, 05:34:01 AM
Hi lovelypp
No there isn't. Restore is also used to restore configuration files supplied by extensions when they've been modified, so
it has to run after extensions have been loaded.

Is this of any help:
Hi halma
As is often the case there can be multiple ways of doing something under Linux. If you don't want to use  udev  you can try adding
this to your  /opt/bootsync.sh  file:
Code: [Select]
# Assign unused names to the network cards
nameif want_eth0 ab:cd:ef:12:34:56
nameif want_eth1 65:43:21:fe:dc:ba

# Assign the desired names to the network cards
nameif eth0 ab:cd:ef:12:34:56
nameif eth1 65:43:21:fe:dc:ba

If your  opt  directory is not persistent, run a backup and reboot. The  nameif  command is the  busybox  version of  renameif.

If you do try the  udev  way you probably need to ad this to your  /opt/bootsync.sh  file:
Code: [Select]
udevadm control --reload-rules
udevadm trigger