LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Issue at chapter 7.2.1 of LFS book 7.1 - networking (https://www.linuxquestions.org/questions/linux-from-scratch-13/issue-at-chapter-7-2-1-of-lfs-book-7-1-networking-4175420089/)

E-Kami 08-02-2012 08:45 PM

Issue at chapter 7.2.1 of LFS book 7.1 - networking
 
Hello everyone,
I'm actually at chapter 7.2.1 of LFS book 7.1.
When I execute:
Code:

for NIC in /sys/class/net/* ; do
    INTERFACE=${NIC##*/} udevadm test --action=add $NIC
done

I get:
Code:

udev_device_read_db: no db file to read /run/udev/data/n2: No such file or directory
udev_device_new_from_syspath: device 0x221a360 has devpath '/devices/pci0000:00/0000:00:03.0'
udev_device_new_from_syspath: device 0x221a810 has devpath '/devices/pci0000:00'

udev_rules_apply_to_event: IMPORT builtin 'pci-db' /lib/udev/rules.d/75-net-description.rules:11
Failed to open database file 'no': No such file or directory
udev_device_new_from_syspath: device 0x221b180 has devpath '/devices/pci0000:00/0000:00:03.0'

udev_device_update_db: created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:03.0/net/p2p1'
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/p2p1
ID_BUS=pci
ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0

ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423
builtin_kmod_exit: unload module index
root:/# cat /etc/udev/rules.d/70-persistent-net.rules
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory

root:/# for NIC in /sys/class/net/* ; do    INTERFACE=${NIC##*/} udevadm test --action=add $NIC; done
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,

specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7639 bytes buffer

udev_rules_new: temporary index used 8100 bytes (405 * 20 bytes)
udev_device_new_from_syspath: device 0x1502c20 has devpath '/devices/virtual/net/lo'
udev_device_new_from_syspath: device 0x14eec10 has devpath '/devices/virtual/net/lo'

udev_device_read_db: device 0x14eec10 filled with db file data
udev_device_update_db: created empty file '/run/udev/data/n1' for '/devices/virtual/net/lo'
ACTION=add
DEVPATH=/devices/virtual/net/lo

IFINDEX=1
INTERFACE=lo
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30236624312
builtin_kmod_exit: unload module index
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,

specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423
builtin_kmod_exit: unload module index
root:/# cat /etc/udev/rules.d/70-persistent-net.rules
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory

root:/# touch /etc/udev/rules.d/70-persistent-net.rules
root:/# for NIC in /sys/class/net/* ; do    INTERFACE=${NIC##*/} udevadm test --action=add $NIC; done
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,

specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7681 bytes buffer
udev_rules_new: temporary index used 8120 bytes (406 * 20 bytes)
udev_device_new_from_syspath: device 0x24d9c20 has devpath '/devices/virtual/net/lo'

udev_device_new_from_syspath: device 0x24c5bf0 has devpath '/devices/virtual/net/lo'
udev_device_read_db: device 0x24c5bf0 filled with db file data
udev_device_update_db: created empty file '/run/udev/data/n1' for '/devices/virtual/net/lo'

ACTION=add
DEVPATH=/devices/virtual/net/lo
IFINDEX=1
INTERFACE=lo
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30412427677
builtin_kmod_exit: unload module index
run_command: calling: test
adm_test: version 181

This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index

index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory
add_matching_files: unable to open '/run/udev/rules.d': No such file or directory
parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file

parse_file: reading '/lib/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/etc/udev/rules.d/55-lfs.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file

parse_file: reading '/lib/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-serial.rules' as rules file

parse_file: reading '/lib/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file

parse_file: reading '/lib/udev/rules.d/61-accelerometer.rules' as rules file
udev_rules_new: ignore empty '/etc/udev/rules.d/70-persistent-net.rules'
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules file

parse_file: reading '/lib/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file

parse_file: reading '/lib/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/lib/udev/rules.d/80-drivers.rules' as rules file

parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7681 bytes buffer
udev_rules_new: temporary index used 8120 bytes (406 * 20 bytes)

udev_device_new_from_syspath: device 0x23eac20 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'
udev_device_new_from_syspath: device 0x23d6bf0 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'

udev_device_read_db: device 0x23d6bf0 filled with db file data
udev_device_new_from_syspath: device 0x23d7360 has devpath '/devices/pci0000:00/0000:00:03.0'
udev_device_new_from_syspath: device 0x23d7930 has devpath '/devices/pci0000:00'

udev_rules_apply_to_event: IMPORT builtin 'pci-db' /lib/udev/rules.d/75-net-description.rules:11
Failed to open database file 'no': No such file or directory
udev_device_new_from_syspath: device 0x23d82a0 has devpath '/devices/pci0000:00/0000:00:03.0'

udev_device_update_db: created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:03.0/net/p2p1'
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/p2p1
ID_BUS=pci
ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0

ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423
builtin_kmod_exit: unload module index
root:/# cat /etc/udev/rules.d/70-persistent-net.rules
root:/# for NIC in /sys/class/net/* ; do    INTERFACE=${NIC##*/} udevadm test --action=add $NIC; done

run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.


builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory
add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

udev_rules_new: temporary index used 8120 bytes (406 * 20 bytes)
udev_device_new_from_syspath: device 0x10eac20 has devpath '/devices/virtual/net/lo'
udev_device_new_from_syspath: device 0x10d6bf0 has devpath '/devices/virtual/net/lo'

udev_device_read_db: device 0x10d6bf0 filled with db file data
udev_device_update_db: created empty file '/run/udev/data/n1' for '/devices/virtual/net/lo'
ACTION=add
DEVPATH=/devices/virtual/net/lo

IFINDEX=1
INTERFACE=lo
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30614004726
builtin_kmod_exit: unload module index
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,

specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7681 bytes buffer
udev_rules_new: temporary index used 8120 bytes (406 * 20 bytes)
udev_device_new_from_syspath: device 0x1b62c20 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'

udev_device_new_from_syspath: device 0x1b4ebf0 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'
udev_device_read_db: device 0x1b4ebf0 filled with db file data
udev_device_new_from_syspath: device 0x1b4f360 has devpath '/devices/pci0000:00/0000:00:03.0'

udev_device_new_from_syspath: device 0x1b4f930 has devpath '/devices/pci0000:00'
udev_rules_apply_to_event: IMPORT builtin 'pci-db' /lib/udev/rules.d/75-net-description.rules:11
Failed to open database file 'no': No such file or directory

udev_device_new_from_syspath: device 0x1b502a0 has devpath '/devices/pci0000:00/0000:00:03.0'
udev_device_update_db: created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:03.0/net/p2p1'

ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/p2p1
ID_BUS=pci
ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0
ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423

builtin_kmod_exit: unload module index
root:/# rm /etc/udev/rules.d/70-persistent-net.rules
root:/# for NIC in /sys/class/net/* ; do    INTERFACE=${NIC##*/} udevadm test --action=add $NIC; done
run_command: calling: test

adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.


builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory
add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7639 bytes buffer
udev_rules_new: temporary index used 8100 bytes (405 * 20 bytes)

udev_device_new_from_syspath: device 0x22f8c20 has devpath '/devices/virtual/net/lo'
udev_device_new_from_syspath: device 0x22e4c10 has devpath '/devices/virtual/net/lo'
udev_device_read_db: device 0x22e4c10 filled with db file data

udev_device_update_db: created empty file '/run/udev/data/n1' for '/devices/virtual/net/lo'
ACTION=add
DEVPATH=/devices/virtual/net/lo
IFINDEX=1
INTERFACE=lo
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30626675330

builtin_kmod_exit: unload module index
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because

some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

udev_rules_new: temporary index used 8100 bytes (405 * 20 bytes)
udev_device_new_from_syspath: device 0x23f4c20 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'
udev_device_new_from_syspath: device 0x23e0bf0 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'

udev_device_read_db: device 0x23e0bf0 filled with db file data
udev_device_new_from_syspath: device 0x23e1360 has devpath '/devices/pci0000:00/0000:00:03.0'
udev_device_new_from_syspath: device 0x23e1930 has devpath '/devices/pci0000:00'

udev_rules_apply_to_event: IMPORT builtin 'pci-db' /lib/udev/rules.d/75-net-description.rules:11
Failed to open database file 'no': No such file or directory
udev_device_new_from_syspath: device 0x23e22a0 has devpath '/devices/pci0000:00/0000:00:03.0'

udev_device_update_db: created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:03.0/net/p2p1'
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/p2p1
ID_BUS=pci
ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0

ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423
builtin_kmod_exit: unload module index
root:/# clear

root:/# for NIC in /sys/class/net/* ; do    INTERFACE=${NIC##*/} udevadm test --action=add $NIC; done

run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.


builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory
add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

parse_file: reading '/lib/udev/rules.d/95-udev-late.rules' as rules file
udev_rules_new: rules use 12888 bytes tokens (1074 * 12 bytes), 7639 bytes buffer
udev_rules_new: temporary index used 8100 bytes (405 * 20 bytes)

udev_device_new_from_syspath: device 0x2131c20 has devpath '/devices/virtual/net/lo'
udev_device_new_from_syspath: device 0x211dc10 has devpath '/devices/virtual/net/lo'
udev_device_read_db: device 0x211dc10 filled with db file data

udev_device_update_db: created empty file '/run/udev/data/n1' for '/devices/virtual/net/lo'
ACTION=add
DEVPATH=/devices/virtual/net/lo
IFINDEX=1
INTERFACE=lo
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30654305384

builtin_kmod_exit: unload module index
run_command: calling: test
adm_test: version 181
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because

some values may be different, or not available at a simulation run.

builtin_kmod_init: load module index
index_mm_open: open(/lib/modules/3.4.6-2.fc17.x86_64/modules.dep.bin, O_RDONLY|O_CLOEXEC): No such file or directory

add_matching_files: unable to open '/run/udev/rules.d': No such file or directory

udev_rules_new: temporary index used 8100 bytes (405 * 20 bytes)
udev_device_new_from_syspath: device 0x1a7ec20 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'
udev_device_new_from_syspath: device 0x1a6abf0 has devpath '/devices/pci0000:00/0000:00:03.0/net/p2p1'

udev_device_read_db: device 0x1a6abf0 filled with db file data
udev_device_new_from_syspath: device 0x1a6b360 has devpath '/devices/pci0000:00/0000:00:03.0'
udev_device_new_from_syspath: device 0x1a6b930 has devpath '/devices/pci0000:00'

udev_rules_apply_to_event: IMPORT builtin 'pci-db' /lib/udev/rules.d/75-net-description.rules:11
Failed to open database file 'no': No such file or directory
udev_device_new_from_syspath: device 0x1a6c2a0 has devpath '/devices/pci0000:00/0000:00:03.0'

udev_device_update_db: created db file '/run/udev/data/n2' for '/devices/pci0000:00/0000:00:03.0/net/p2p1'
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:03.0/net/p2p1
ID_BUS=pci
ID_MODEL_ID=/sys/devices/pci0000:00/0000:00:03.0

ID_VENDOR_ID=0x8086
IFINDEX=2
INTERFACE=p2p1
SUBSYSTEM=net
UDEV_LOG=6
USEC_INITIALIZED=30168142423
builtin_kmod_exit: unload module index

(The message has been a bit truncated)
And when I use:
Code:

root:/# cat /etc/udev/rules.d/70-persistent-net.rules
I get:
Code:

cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory
Someone know why I get these errors? Did I miss something in the LFS book?
Thanks in advance

druuna 08-03-2012 02:36 AM

Just a wild guess: Are you still doing these actions from within the chrooted environment?

E-Kami 08-03-2012 03:54 AM

Quote:

Originally Posted by druuna (Post 4744735)
Just a wild guess: Are you still doing these actions from within the chrooted environment?

Yes, I entered in chroot with:
Code:

chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login


Keith Hedger 08-05-2012 12:16 PM

If you are in a chroot have you mounted sys proc and dev form the host system to your chroot environment?

ie:
Code:

mount -vt proc proc ${LFS}/proc
mount -vt sysfs sysfs ${LFS}/sys
mount -v -o bind /dev ${LFS}/dev

chroot "${LFS}"


E-Kami 08-05-2012 06:19 PM

Quote:

Originally Posted by Keith Hedger (Post 4746533)
If you are in a chroot have you mounted sys proc and dev form the host system to your chroot environment?

ie:
Code:

mount -vt proc proc ${LFS}/proc
mount -vt sysfs sysfs ${LFS}/sys
mount -v -o bind /dev ${LFS}/dev

chroot "${LFS}"


It seems that I forgot:
Code:

mount -v -o bind /dev ${LFS}/dev
But even when I mount dev, I still get the same errors...

Keith Hedger 08-06-2012 03:50 AM

I used the CLFS book so I am guessing but I don't have the file "/etc/udev/rules.d/70-persistent-net.rules" nor is it in /lib/udev/rules.d but my network works fine, do you have more than one network device? if you don't it probably doesn't matter about this bit ( judging by the blurb at the start of the chapter ), I only have one network card so I can't help much more, one final tip though you said you had forgot to mount dev, so why not put the code you need to mount the virtual file system and chroot commands into a script and run that, I did and it saved a lot of mucking about.

stoat 08-06-2012 09:14 AM

I would confirm the status of the device's driver. Most wired NICs (that I know about) use drivers provided by the kernel. That is very likely so for your NIC, or you would know otherwise from dealing with it in your host system. But perhaps the NIC's driver "is not set" in your LFS kernel config. Or, perhaps it is compiled as a module ("m") but has a module loading issue.


All times are GMT -5. The time now is 10:23 AM.