<div dir="ltr"><div>Adding snappy-devel.</div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Paolo Pisati</b> <span dir="ltr"><<a href="mailto:paolo.pisati@canonical.com">paolo.pisati@canonical.com</a>></span><br>Date: Thu, Jun 11, 2015 at 6:00 PM<br>Subject: Re: snappy on raspberry pi 2: DHCP, I2C<br>To: roger peppe <<a href="mailto:roger.peppe@canonical.com">roger.peppe@canonical.com</a>><br><br><br><div dir="ltr"><div>And here is a new build of the raspberry2 kernel with that option =y:</div><div><br></div><div><a href="https://launchpad.net/~p-pisati/+archive/ubuntu/embedded/+build/7531057/+files/linux-image-3.19.1-12-generic-bcm2709_3.19.1-12.12_armhf.deb" target="_blank">https://launchpad.net/~p-pisati/+archive/ubuntu/embedded/+build/7531057/+files/linux-image-3.19.1-12-generic-bcm2709_3.19.1-12.12_armhf.deb</a></div><div><br></div><div>but it's not that easy, because it requires some work on the dtb too.</div><div><br></div><div>Some background first:</div><div><br></div><div>The original raspi2 image doesn't use uboot to boot the board, instead it has a set of binaries (bootcode.bin, start.elf, etc[1]) that parse the txt files in the boot partition, prepare an 'environment' for the linux kernel based on the content of these files[2] (boot command line and dtb file), passes this environment to the kernel and make it boot the board.</div><div><br></div><div>Indeed, if you want the i2c to work there, you need to add this to config.txt:</div><div><br></div><div>dtparam=i2c_arm=on<br></div><div><br></div><div>that's because in the original raspi2 dtb file, the i2c devices require sme work and are off by default:</div><div><br></div><div><div>ubuntu@raspy2:~$ ls /proc/device-tree/soc/i2c\@7e*</div><div>/proc/device-tree/soc/i2c@7e205000:</div><div>#address-cells   clocks      linux,phandle  pinctrl-0      status</div><div>#size-cells      compatible  name           pinctrl-names</div><div>clock-frequency  interrupts  phandle        reg</div><div><br></div><div>/proc/device-tree/soc/i2c@7e804000:</div><div>#address-cells   clocks      linux,phandle  pinctrl-0      status</div><div>#size-cells      compatible  name           pinctrl-names</div><div>clock-frequency  interrupts  phandle        reg</div><div>ubuntu@raspy2:~$</div></div><div><br></div><div><div>ubuntu@raspy2:~$ cat /proc/device-tree/soc/i2c@7e*/status</div><div>disableddisabled</div></div><div><br></div><div>Unfortunately, to make the redundancy logic work in snappy we require uboot, so the original boot binaries (bootcode.bin and start.elf), can still do the mangling to the dtb, but when this dtb is passed to uboot, uboot doesn't even know it's there, so it discards it, and load a pristine dtb from the sd card and pass it to the kernel.</div><div><br></div><div>The correct solution to this, would be to make uboot detect the dtb passed by start.elf, and pass it to the kernel on its behalf but:</div><div><br></div><div>1) AFAIK this feature is not implemented (but perhaps the dtb it's somewhere in memory and i can pass a pointer to it to the kernel?!?!?)</div><div>2) how does it play with our redundancy logic? if we pass the dtb from the initial boot binaries, how does it work with the a/b partitioning?</div><div><br></div><div>1: <a href="https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=6685" target="_blank">https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=6685</a></div><div>2: <a href="https://www.raspberrypi.org/documentation/configuration/device-tree.md" target="_blank">https://www.raspberrypi.org/documentation/configuration/device-tree.md</a></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Jun 11, 2015 at 4:43 PM, roger peppe <span dir="ltr"><<a href="mailto:roger.peppe@canonical.com" target="_blank">roger.peppe@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 11 June 2015 at 08:55, roger peppe <<a href="mailto:roger.peppe@canonical.com" target="_blank">roger.peppe@canonical.com</a>> wrote:<br>
> 1) How can I get snappy to DHCP automatically after booting?<br>
> I was expecting the network to come up right away, but<br>
> I need to manually run "dhclient eth0" to get the network<br>
> working.<br>
<br>
</span>Update: this seems to be working now, and it doesn't<br>
seem to be just because /var/lib/dhcp/dhclient.*leases has<br>
some contents in now (I truncated those files and it still<br>
gets an IP address on boot). I don't think I've changed anything<br>
else (apart from I added a static IP address in my router).<br>
<br>
It would be nice to know what might have gone wrong here.<br>
<div><div><br>
  cheers,<br>
    rog.<br>
<br>
--<br>
snappy-devel mailing list<br>
<a href="mailto:snappy-devel@lists.ubuntu.com" target="_blank">snappy-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snappy-devel" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snappy-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">bye,<div>p.</div></div></div>
</font></span></div>
</div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">bye,<div>p.</div></div></div>
</div>