Page 1 of 2

Shell Username Password after flashing

Posted: 26 Mar 2018, 13:30
by jenskastensson
Hi,

where is the factory username and password for shell stored on the RevPi3?

The reason I ask is:
- I create a custom image on one RevPI3,
- then I flash this image onto another RevPI3.

What will be the credentials of the on the flashed device? Will it have its original credentials as written on the sticker after the flashing?

If not, how can I restore the creds , I'm looking into doing a small series of devices.

Thanks
Jens

Re: Shell Username Password after flashing

Posted: 26 Mar 2018, 22:27
by volker
Hi,
if you copy an image you get a 100% copy including all passwords and login data. If you want to individualize your system to the data printed on the case (original MAC address and original login) you simply need to call "revpi-factory-reset" and then enter the MAC (just numbers, no points) and the serial number (middle line right of QR-code).

Re: Shell Username Password after flashing

Posted: 28 Mar 2018, 12:10
by jenskastensson
Thanks Volker, that works.
----------------------
Edit April 6:
After some testing it doesn't work as expected, or I've misunderstood.

I did this:
1. Write the original img to the device, factory-reset clean (for reference, mac ends w/ 49): Image

2. Write a custom ing from another device, factory reset after write before boot : Image

3. After reboot the mac id is not the original which ends with 49: Image

The password and serial number are reset, but the mac id is not restored.

What am I doing wrong here and what about the error msg
DTOVERLAY[error]: Failed to open '/boot/overlays/revpi-core.dtbo'
* Failed to read '/boot/overlays/revpi-core.dtbo'

Re: Shell Username Password after flashing

Posted: 06 Apr 2018, 13:21
by jenskastensson
Is it possible to modify an img file to "factory reset state" without having to execute it i.e. before writing the image to a device?

Background:
I'm looking into automating the setup of 50 devices
1) I've prepared a master image , it has the macid and serial of the mother device
2) I want to write this image on several devices with minimum effort.
3) I will use 7zip or similar to customize our sw for each device (each device will have custom settings)
4) To save time I would prefer not to have to launch each device and execute "revpi-factory-reset"

Is it possible to accomplish these changes by modifying the img file too (i.e. in step 3)?

Re: Shell Username Password after flashing

Posted: 06 Apr 2018, 18:41
by volker
You can of course do the same changes which the factory reset does pro grammatically. But how should 7zip individualize your images? MAC and serial number are stored in files. so if you can manipulate the file contents by 7zip then yes, this would work. But remember that serial number and MAC are printed on the case and it would be wise to match them with the content. In our End of Line testing we are doing this by reading the QR code on the case and then manipulating the file contents in order to match them. You could mimic this procedure.

Re: Shell Username Password after flashing

Posted: 08 Apr 2018, 18:47
by jenskastensson
Thanks Volker,

this exactly what we want to do , mimic the last step in production process but for a short series of devices. As soons as we're confident that all is good we'll send the img to you.

So I have these questions:

1. As you may have seen I have a follow up question (above, Edit April 6:) regarding the run-time factory reset.

2. Which files will we have to edit in the img file to mimic the final production step? Maybe you prefer not to publish this information on the public forum, in this case send it to jens at proknx.com

Thanks in advance for your support!
Jens

Re: Shell Username Password after flashing

Posted: 08 Apr 2018, 21:42
by volker
I fear the error message migth be missleading. The only thing I can see is that you have not entered the MAC as a single string of numbers but inserted seperator dashes. Please do not! Use numbers only with no separation and try again...

Re: Shell Username Password after flashing

Posted: 08 Apr 2018, 21:47
by volker
For the files I need to ask my colleagues. But there is nothing secret about that... Possibly the source code for factory reset is on GitHub?
When you said you would send us the img... are you planning to let us produce your images? This needs to be discussed with sales team! It is not as easy as you may think. We would need to give that product a unique product number which would be lasered on the case etc. We do have a customizing program and you might apply for it. But there is normally a limit minimum amount of devices per year. So if you are heading to this way please do contact sales@kunbus.de to get conditions and prices.

Re: Shell Username Password after flashing

Posted: 09 Apr 2018, 12:20
by lukas
jenskastensson wrote: 28 Mar 2018, 12:10 Edit April 6:
After some testing it doesn't work as expected, or I've misunderstood.

I did this:
1. Write the original img to the device, factory-reset clean (for reference, mac ends w/ 49)

2. Write a custom ing from another device, factory reset after write before boot

3. After reboot the mac id is not the original which ends with 49

The password and serial number are reset, but the mac id is not restored.

What am I doing wrong here and what about the error msg
DTOVERLAY[error]: Failed to open '/boot/overlays/revpi-core.dtbo'
* Failed to read '/boot/overlays/revpi-core.dtbo'
Apologies, when we pushed a new version of the piserial package in early March to fix several security issues, the package included the revpi-factory-reset for stretch. With stretch, the MAC address is no longer stored in /boot/cmdline.txt but in /boot/config.txt. That change was necessary to accommodate to the RevPi Connect which has two smsc95xx interfaces. A MAC address configured in /boot/config.txt will take precedence over one configured in /boot/cmdline.txt, however for it to be picked up by the driver, the revpi-core.dtbo device tree overlay included with our 4.9 kernel needs to be used. On jessie (with a 4.4 kernel package), you're missing that overlay, which explains the error message you've seen as well as why the MAC address in /boot/config.txt didn't take effect.

Long story short, I've just pushed version 1.4.1-1 of the piserial package which reinstates compatibility with 4.4 kernels, so after installing it with apt-get, the issue should go away. Let us know if it doesn't. Thanks for reporting this.

Re: Shell Username Password after flashing

Posted: 09 Apr 2018, 14:50
by jenskastensson
Thanks, a quick test looks promising, the factory reset issue is solved by apt-get update!