3 Replies Latest reply on Sep 2, 2019 4:30 PM by clem57

    Ethernet adress in startup script

    anttiw

      Hi,

       

      in which file should I enter the ethernet adress that eth0 goes up and running?

       

      I tried /mnt/emmc/init.sh but I think that some other task will force it down. I can see that wifi.sh will work perfectly and the board goes to wlan.

       

      But I would like to use eth0 instead than wlan. I'm not sure which is correct place to put ifconfig configuration lines. Any idea?

       

      -antti

        • Re: Ethernet adress in startup script
          clem57

          If you have it defined, use this for the command. Could you provide more information of what you wish to do?

            • Re: Ethernet adress in startup script
              anttiw

              Hi,

               

              ifconfig is the command, but in where you should enter this to get board boot with this argument every time?

               

              I did followed instructions from https://se.mathworks.com/matlabcentral/fileexchange/66004-avnet-minized-support-package-for-simulink

               

              There are advised how to connect wlan or eth0. The wlan will be started every time when board is rebooted. But problem is where to declare eth0 (usb ethernet) parameters. If I reboot the minized, all the typical configuration files are re-written.

               

              Hera is the snapshot from boot scripts

              "...

              Ceate symbolic links for libboost libraries

              DONE!

              Running Minized Startup Script ...

               

              Mounting /dev/mmcblk1p1 on /mnt/emmc

              FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

               

              Mounting /dev/sda1 on /mnt/usb

              mount: mounting /dev/sda1 on /mnt/usb failed: No such file or directory

              MiniZed Boot Script DONE!

               

              Running user script @ /mnt/emmc/init.sh

              ------------------------------

              Starting MiniZed WiFi services

              ------------------------------

              ifdown: interface eth0 not configured

              Successfully initialized wpa_supplicant

              Long line in configuration file truncated

              rfkill: Cannot open RFKILL control device

              IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

              IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

              udhcpc (v1.24.1) started

              Sending discover...

              Sending select for 192.168.0.13...

              Lease of 192.168.0.13 obtained, lease time 599940

              /etc/udhcpc.d/50default: Adding DNS 193.210.19.19

              /etc/udhcpc.d/50default: Adding DNS 193.210.18.18

              ------------------------------

              --> starup scripts to bring eht0 up and ip adress

              ------------------------------

               

              MiniZed Startup Script DONE!

               

              Running postinst /etc/rpm-postinsts/100-sysvinit-inittab...

              update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)

              Removing any system startup links for run-postinsts ...

                /etc/rcS.d/S99run-postinsts

              INIT: Entering runlevel: 5

              Configuring network interfaces... udhcpc (v1.24.1) started

              Sending discover...

              Sending discover...

              Sending discover...

              No lease, forking to background

              done.

              Starting system message bus: dbus.

              Starting Dropbear SSH server: Generating key, this may take a while...

              Public key portion is:

              ssh-rsa .. root@minized-mw

              Fingerprint: md5 df:77:cc:e7:d2:b2:03:57:7d:4e:59:37:5d:66:6f:67

              dropbear.

              hwclock: can't open '/dev/misc/rtc': No such file or directory

              Starting syslogd/klogd: done

              Starting tcf-agent: OK"

               

              It seem like most of all the files and directories are rewritten during boot up process. But is there a way to add own custom script for example to bring usb ethernet up?

               

              This mathworks example works if you dont boot the board again, but normally with this process you will boot the board again each time when you download new software/hardware. So this example is not very handy. But how to make usb ethernet adress permanent?

               

              BR Antti