-3

I need to disable autonegotiation phase on boot sequence in Petalinux 2019.2. Is there any idea about it? As all you know, an autonegotiation phase is starting automatically by boot sequence and if there is a network dedicates IP for devices this process is completed quickly. But Im working as stati IP dedication. So, I need to disable it?

Thanks, M.A.

Petalinux Version 2019.2

muradaltay
  • 41
  • 7
  • 1
    "*Autonegotiation phase*"? For an IP address? No such thing. There's DHCP service where a host can *request* a dynamic IP address. If the host is instead going to use a static IP address, then it simply should not send any request to the DHCP server. – sawdust May 10 '22 at 07:20
  • Thanks, problem is that, boot tries to negotiate up until timeout. I want to disable this time on try. – muradaltay May 10 '22 at 09:50
  • "*boot tries to negotiate*" -- What boot code are you referring to? Why is this question tagged with `u-boot`? Again, there is no "*negotiation*". DHCP involves a simple dialog of requests and responses. – sawdust May 11 '22 at 02:58
  • I disabled ethernet from Petalinux-config, then it could not take any time to negotiate. Then after booting, I enable it using ifconfig eth0 ---- up. – muradaltay Dec 16 '22 at 06:14

1 Answers1

1

Your question leaves a little to be desired, but it sounds like you don't want the DHCP daemon to start automatically at boot. What you can do is create a small script that disables 'udhcpd' and will auto-run at startup (see Chapter 8: Application Auto Run at Startup). If you create a symbolic link to your program with the 'S00' prefix (ex: "S00myapp-init"), it will run before any other scripts.

#!/bin/bash
# myapp-init: Prevent udhcpd program from auto-starting
# rc[0,1,6] kill the programs, so leave be.
for rc in 2 3 4 5; do
    rm -f /etc/rc${rc}.d/*udhcpd
done

myapp-init.bb snippet:

do_install() {
    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sysconfdir}/rc2.d
    install -d ${D}${sysconfdir}/rc3.d
    install -d ${D}${sysconfdir}/rc4.d
    install -d ${D}${sysconfdir}/rc5.d

    install -m 0755 ${S}/myapp-init.sh ${D}${sysconfdir}/init.d/myapp-init
    
    # run this script before any others
    ln -sf ../init.d/myapp-init ${D}${sysconfdir}/rc2.d/S00myapp-init
    ln -sf ../init.d/myapp-init ${D}${sysconfdir}/rc3.d/S00myapp-init
    ln -sf ../init.d/myapp-init ${D}${sysconfdir}/rc4.d/S00myapp-init
    ln -sf ../init.d/myapp-init ${D}${sysconfdir}/rc5.d/S00myapp-init
thelummox
  • 336
  • 2
  • 8