1

While digging through the birds-nest of network initialisation in our embedded linux setup (Linux SDK on Leopardboard SBC) we've come across what seems like an odd and possibly non-functioning line in /etc/network/interfaces:

# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
        pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmdline > /dev/null

Now, the kernel cmdline in this system may contain the line "ip=192.168.2.1" or some other address, but this line specifically ignores it if it matches (grep -v = show non-matching lines only). Also, it's redirecting it to /dev/null, so it would seem futile either way.

Has anyone seen something like this or got any ideas what it could be doing / might be intended to do, other than nothing?

1 Answer 1

4

From man interfaces:

       pre-up command
          Run command before bringing the interface up.  If  this  command
          fails then ifup aborts, refraining from marking the interface as
          configured, prints an error message, and exits  with  status  0.
          This behavior may change in the future.

From there, I would guess that the command you quoted is basically a test, destined to abort the ifup and reconfiguring the interface, if there's already and ip=... line in cmdline. The redirection to /dev/null is applied to the pre-up error message, not the grep.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .