element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RIoTboard
  • Products
  • Dev Tools
  • Single-Board Computers
  • RIoTboard
  • More
  • Cancel
RIoTboard
Forum RiotBoard : Mac Address
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RIoTboard to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 22 replies
  • Subscribers 23 subscribers
  • Views 1561 views
  • Users 0 members are here
Related

RiotBoard : Mac Address

Former Member
Former Member over 11 years ago

Hello

 

I ve got 3 Riotboard and when I connect the ethernet port tu my network, the three receive the same IP address as their MAC address seems the same

 

How can I change some setting to force different IP address for each board

 

Xavier

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 11 years ago

    Android or Linux ?

     

    Essentially, the fuse block in the SoC that would hold the mac address is left un-programmed. This should cause the kernel driver to pick a random mac address on every boot. That does appear to happen on the 3.15-rc* kernels I'm using.

     

    Unfortunately distros try to be smart and force things, or save and restore the settings somewhere.  In Debian/Ubuntu you should be able to do something like adding a line similar to

    hwaddress ether 01:02:03:04:05:06

    into /etc/network/interfaces at the appropriate place. Just pick a different address on each board.


    I don't know much about how android might do this, I'm not really an android person, but there should be a way.

     

    Note that simply giving each board a different static IP address won't work as long as they're on the same network, having duplicate mac address will still cause you problems in that scenario.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to Former Member

    Hello

     

    Sorry for the confusion

    I am using Android  distro.

     

    Any body could help me ?

     

    Xavier

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    I think I have root access on console.

    I could change MAC with the following commands:

    ip link set down dev eth0

    ip link set dev eth0 addr 00:11:22:33:44:55

    ip link set up dev eth0

    But after reboot the old MAC-Adddress ist active.

     

    I found on the net that I have to change the content of the file "nvram.txt" or something else, but I could not find such a file on my riotboard.

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    If you really have root access you could create a script file with this commands in /system/etc/init.d/

     

    Then it would be executed at boot.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    Could you give me the way to be root?

     

    I could not connected with su as root

     

    X

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    It certainly appears to give you a root shell on the serial console. Usually changing the hwaddr would need either root of something with the correct capability flags.

     

    I know android is different in many ways though, so not being an android person I really don't know if the 'looks like root' shell on the serial console really is or not.  That said, a developer board with a locked down version of Android wouldn't appear to make a lot of sense.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    If the Image of Android for the RioTBoard that is downloadable right now is the same as in the sources, then it´s really locked up.

     

    The relevant settings in system/core/rootdir are set like this as I´ve written above.

     

    service console /system/bin/sh

        class core

        console

        disabled

        user shell

        group log

     

    Also I can´t find anything in "device/fsl/RIoTboard_6solo/init.rc" that would grant access to root.

     

    So the user doesn´t have root access in the shell right now.

     

    To get full root access there is also a bit more to do. Like implementing a compiled version of the su-binary and a SuperUser.apk.

    The missing modified su binary is the reason why you can´t connect as root with su.

     

    I´m still trying to compile it, but it appears to not working. I managed to install the old Oracle JDK6 and it started to compile. But I still get errors...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    I bow to your greater knowledge of Android. The sum total of my exposure to android is the RioTboard, I have no illusions that I know anything much about it image

     

    I've not downloaded either the Android sources or image, I just have the pre-installed image on the eMMC.. Really wouldn't surprise me if that's different though.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    I wanted to make an Image the official way to root the RioTBoard. But since I can´t even compile it right now I will try something else as soon I´m at home.

     

    There´s a method to root almost any device using the Master Key vulnerability.

     

    I´ll test it and will write a blog entry on success.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    Booted to the android image that was pre-installed on my board, I have a file in / called init.rc presumably this is where the things you've mentioned already actually end up after everything is compiled.

     

    In that file, amongst lots of other service sections I have this:

    service console /system/bin/sh
        class core
        console
        user root
        group root

     

    from what you say there's more to it than just that, but for simple serial console root access how close is this?

     

    The prompt I get on the serial console is root@riot_6solo:/ #

     

    It also seems that the versions we have are somehow fundamentally different..  What's the best place for me to look to find some sort of version number that we can use to compare?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    Just came home. Put Android on my RioTBoard with the downloaded image.

    And jup. You´re right. When I connect with UART I am greeted with user root and the relevant settings are set in init.rc.

     

    But I still don´t have write access on /system/etc for example.

     

    To get the version, you can look into the file /system/build.prop.

    The entry "ro.build.description" would give you type, version and date.

     

    Mine is "riot_6solo-user 4.3 1.0.0-rc2 20131108". Which I assume would be the same as yours.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    same version...

     

    mount -w -o remount /dev/block/mmcblk0p5 /system

     

    gives access to /system/etc as it's been mounted ro by default, presumably there's somewhere to change that, but I'm short on ideas as /etc/fstab doesn't seem to exist!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    same version...

     

    mount -w -o remount /dev/block/mmcblk0p5 /system

     

    gives access to /system/etc as it's been mounted ro by default, presumably there's somewhere to change that, but I'm short on ideas as /etc/fstab doesn't seem to exist!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    That would be enough to get write access to create a script file to run the commands. But it seems there is no init.d folder.

    So I assume the support for it isn´t there. But I know something to get it running. Just have to test it though.

     

    I´m not THAT big in my knowledge with Android. It´s just that I´ve been using rooted devices now for a somewhat long time.

    But let´s see if we can get it working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to radiatortwo

    I think you just volunteered to write the Howto build Android for RIoTboard blog post image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to Former Member

    A little info for now.

     

    I tried copying a su binary into the /system/bin folder and giving full permissions.

    Problem is the permissions are gone on the next reboot.

     

    So with the permissions set I was able to execute the su command over adb and get init.d running with a method I´ve been using on other devices.

     

    Problem is now the Board won´t start anymore. I don´t know why but he´s throwing error after error instead of booting.

     

    So you´ll have to wait a bit longer until I got that fixed. At least the script in the init.d folder got executed. Even if it was only once...

     

    I also tried to get SuperUser running since I had a su binary. But it seems that didn´t work as I expected.
    Maybe this is the reason it´s crashing now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • radiatortwo
    0 radiatortwo over 11 years ago in reply to radiatortwo

    Well I have some good news and some bad news.

     

    First the good news:

    I have a method do get init.d working. And it will be executed on every boot.

    Also the system partition will always be remounted with write access like this.

     

    Second good news:

    I managed to compile the sources and have built an Image.

    It´s NOT fully rooted. But has a bit more permissions for now. It allows to use adb shell with su as root for example.

     

    I am going to write a blog entry in the near future on how I did it.

     

    For those who want to try it here are the image files:

    http://ns306718.ip-94-23-224.eu/RIoTBoard/riotboard_android4.3_1.0.0.zip
    Just unzip it, overwrite the old files in the folder "Profiles\MX6DL Linux Update\OS Firmware\files\android" of your MFGTools and flash it to the RIoTBoard.

     

    And yet the bad news:

    Init.d is working but it seems the commands to change the mac address are not working as expected. The interface won´t come up again.
    Maybe with a little tweaking someone get´s this to work. I´m out of ideas on this one right now

    (Even tried to set the u-boot env ethaddr to a specific mac. But it didn´t work either...)

     

    And here´s what to do to get init.d working:

    You´ll need the UART serial connection.

    Or if you don´t have the connector an adb shell connection with su as root.

    Also you´ll need adb itself of course and the files I´ll send with this post. (install-recovery.sh, run-parts, sysinit and 99script)

     

    If you don´t have adb installed you don´t have to install the whole Android SDK. Just search for the "15 seconds ADB Installer" over at xda developers and install it. (Google it cause you´ll always need the newest version.)

     

    Then connect the RIoTBoard with USB and type in the command prompt:

     

    adb devices

     

    On the Android screen then comes up the Question to allow the connection. We´ll allow it always and click ok.

     

    Then switch with the command prompt to the folder in which the files I gave you are and type in the following commands:

    adb push sysinit /data/local/tmp
    adb push install-recovery.sh /data/local/tmp
    adb push 99script /data/local/tmp
    adb push run-parts /data/local/tmp

     

    This copies the files on the device. (You can also copy them over the MTP connection in Windows. But I had problems with that, so I use this method.)

     

    Now you can use either the UART connection or you´ll type in the command prompt "adb shell su".

    Either way you have to be root to execute the following commands.

     

    mount -w -o remount /dev/block/mmcblk0p5 /system
    
    cp -f /data/local/tmp/sysinit /system/bin/sysinit
    cp -f /data/local/tmp/install-recovery.sh /system/etc/install-recovery.sh
    mkdir -p /system/etc/init.d
    cp -f /data/local/tmp/99script /system/etc/init.d/99script
    cp -f /data/local/tmp/run-parts /system/xbin/run-parts
    
    rm /data/local/tmp/sysinit
    rm /data/local/tmp/install-recovery.sh
    rm /data/local/tmp/99script
    rm /data/local/tmp/run-parts
    
    chmod 777 /system/etc/install-recovery.sh
    chown 0.2000 /system/etc/install-recovery.sh
    chmod 755 /system/bin/sysinit
    chown 0.2000 /system/bin/sysinit
    chmod 777 /system/xbin/run-parts
    chown 0.2000 /system/xbin/run-parts
    chmod -R 777 /system/etc/init.d
    chown 0.0 /system/etc/init.d

     

    This will copy all needed files in the right place and set the right permissions.

     

    And that´s it. The scriptfile 99script will now be executed at boot and will remount the system partition.

    You can edit the file 99script to let it execute your own commands or put another scriptfile into the folder.

    Attachments:
    https://community.element14.com/cfs-file/__key/communityserver-discussions-components-files/95/install_2D00_recovery.sh
    run-parts.zip
    sysinit.zip
    99script.zip
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube