<div dir="ltr">Thanks! will give that a try.<div><br></div><div>Aaron</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 June 2018 at 13:08, Andrew Jeffery <span dir="ltr"><<a href="mailto:andrew@aj.id.au" target="_blank">andrew@aj.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Aaron,<br>
<div><div class="h5"><br>
On Fri, 15 Jun 2018, at 22:58, Aaron wrote:<br>
> Hi,<br>
> <br>
> It seems like there would an easy way to do this for development/bringup,<br>
> asking instead of hacking on the code for a change.<br>
> <br>
> Im bringing up a system by loading an image via u-boot across the network<br>
> into the upper section of ram, then booting from there. It relocates itself<br>
> to the reset vector and generally works well.<br>
> <br>
> U-Boot 2016.07 (Jun 15 2018 - 20:42:28 +0900)<br>
> <br>
> DRAM: 240 MiB<br>
> WARNING: Caches not enabled<br>
> Flash: 32 MiB<br>
> *** Warning - bad CRC, using default environment<br>
> <br>
> In: serial<br>
> Out: serial<br>
> Err: serial<br>
> Net: aspeednic#0<br>
> Error: aspeednic#0 address not set.<br>
> <br>
> Hit any key to stop autoboot: 0<br>
> ast# nv<br>
> Unknown command 'nv' - try 'help'<br>
> ast# env print<br>
> baudrate=115200<br>
> bootargs=console=ttyS4,<wbr>115200n8 root=/dev/ram rw<br>
> bootcmd=bootm 20080000<br>
> bootdelay=2<br>
> ethact=aspeednic#0<br>
> spi_dma=yes<br>
> stderr=serial<br>
> stdin=serial<br>
> stdout=serial<br>
> verify=yes<br>
> <br>
> Environment size: 204/65531 bytes<br>
> ast#<br>
> <br>
> <br>
> The initial stages are good, but 2nd stage loader assume files on MTD<br>
> instead of whats in RAM, thus crashes out / uses stale data. Wasted about<br>
> half a day wondering why my changes were having little to no effect.<br>
> <br>
> Is there a best practices on this?<br>
> <br>
> Thanks<br>
> Aaron<br>
> <br>
> <br>
> <br>
> ast# bootd<br>
> FTGMAC100#0: link up, 1000bps full-duplex<br>
> Using FTGMAC100#0 device<br>
> TFTP from server 192.168.2.136; our IP address is 192.168.2.143<br>
> Filename 'image-current'.<br>
> Load address: 0x40a00000<br>
> Loading: ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> .<br>
> .<br>
> .<br>
> .<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>##############################<wbr>#####<br>
> ##############################<wbr>#########################<br>
> 2.5 MiB/s<br>
> done<br>
> Bytes transferred = 33554432 (2000000 hex)<br>
> ## Loading kernel from FIT Image at 40a80000 ...<br>
> Using 'conf@aspeed-bmc-quanta-q71l.<wbr>dtb' configuration<br>
> Trying 'kernel@1' kernel subimage<br>
> Description: Linux kernel<br>
> Type: Kernel Image<br>
> Compression: uncompressed<br>
> Data Start: 0x40a8012c<br>
> Data Size: 2331736 Bytes = 2.2 MiB<br>
> Architecture: ARM<br>
> OS: Linux<br>
> Load Address: 0x40008000<br>
> Entry Point: 0x40008000<br>
> Hash algo: sha1<br>
> Hash value: 6a7b891f8d5fed2d358b2ceb060344<wbr>96979dcae8<br>
> Verifying Hash Integrity ... sha1+ OK<br>
> ## Loading ramdisk from FIT Image at 40a80000 ...<br>
> Using 'conf@aspeed-bmc-quanta-q71l.<wbr>dtb' configuration<br>
> Trying 'ramdisk@1' ramdisk subimage<br>
> Description: obmc-phosphor-initramfs<br>
> Type: RAMDisk Image<br>
> Compression: lzma compressed<br>
> Data Start: 0x40cbfa80<br>
> Data Size: 1874095 Bytes = 1.8 MiB<br>
> Architecture: ARM<br>
> OS: Linux<br>
> Load Address: unavailable<br>
> Entry Point: unavailable<br>
> Hash algo: sha1<br>
> Hash value: 788a33bc41ecf5667b87ee2e264c67<wbr>9ed2a42e51<br>
> Verifying Hash Integrity ... sha1+ OK<br>
> ## Loading fdt from FIT Image at 40a80000 ...<br>
> Using 'conf@aspeed-bmc-quanta-q71l.<wbr>dtb' configuration<br>
> Trying 'fdt@aspeed-bmc-quanta-q71l.<wbr>dtb' fdt subimage<br>
> Description: Flattened Device Tree blob<br>
> Type: Flat Device Tree<br>
> Compression: uncompressed<br>
> Data Start: 0x40cb9690<br>
> Data Size: 25390 Bytes = 24.8 KiB<br>
> Architecture: ARM<br>
> Hash algo: sha1<br>
> Hash value: 84ed7efe6232738984546b3ef27397<wbr>ab251c3396<br>
> Verifying Hash Integrity ... sha1+ OK<br>
> Booting using the fdt blob at 0x40cb9690<br>
> Loading Kernel Image ... OK<br>
> Loading Ramdisk to 4e9d1000, end 4eb9a8af ... OK<br>
> Loading Device Tree to 4e9c7000, end 4e9d032d ... OK<br>
> <br>
> Starting kernel ...<br>
> <br>
> <br>
> [ 0.000000] Booting Linux on physical CPU 0x0<br>
> [ 0.000000] random: get_random_bytes called from start_kernel+0x3c/0x3f0<br>
> with crng_init=0<br>
> [ 0.000000] Linux version<br>
> 4.13.16-<wbr>aca92be80c008bceeb6fb62fd1d450<wbr>b5be5d0a4f (oe-user@oe-host) (gcc<br>
> version 7.3.0 (GCC)) #10 Fri Jun 15 20:59:12 JST 2018<br>
> [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f<br>
> [ 0.000000] CPU: VIVT data cache, VIVT instruction cache<br>
> [ 0.000000] OF: fdt: Machine model: Quanta Q71L BMC<br>
> [ 0.000000] Memory policy: Data cache writeback<br>
> [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.<br>
> Total pages: 58912<br>
> [ 0.000000] Kernel command line: console=ttyS4,115200n8 root=/dev/ram rw<br>
> [ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)<br>
> [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072<br>
> bytes)<br>
> [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)<br>
> [ 0.000000] Memory: 224832K/237568K available (5120K kernel code, 330K<br>
> rwdata, 1276K rodata, 1024K init, 109K bss, 12736K reserved, 0K<br>
> cma-reserved)<br>
> [ 0.000000] Virtual kernel memory layout:<br>
> [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)<br>
> [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)<br>
> [ 0.000000] vmalloc : 0x8f800000 - 0xff800000 (1792 MB)<br>
> .<br>
> .<br>
> <snip><br>
> .<br>
> .<br>
> <br>
> [ 4.641015] Segment Routing with IPv6<br>
> [ 4.643890] ip6_tables: (C) 2000-2006 Netfilter Core Team<br>
> [ 4.648315] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver<br>
> [ 4.654435] NET: Registered protocol family 17<br>
> [ 4.657830] 8021q: 802.1Q VLAN Support v1.8<br>
> [ 4.672023] hctosys: unable to open rtc device (rtc0)<br>
> [ 4.682642] Freeing unused kernel memory: 1024K<br>
> rofs = mtd4 squashfs rwfs = mtd5 jffs2<br>
> mount: mounting /dev/mtdblock4 on run/initramfs/ro failed: Invalid argument<br>
> [ 7.296855] jffs2: notice: (453) jffs2_build_xattr_subsystem: complete<br>
> building xattr subsystem, 53 of xdatum (40 unchecked, 13 orphan) and 189 of<br>
> xref (8 dead, 47 orphan) foun.<br>
> [ 7.336463] overlayfs: upper fs does not support tmpfile.<br>
> chroot: can't execute '/bin/sh': No such file or directory<br>
> <br>
> Unable to confirm /sbin/init is an executable non-empty file<br>
> in merged file system mounted at /root.<br>
> <br>
> Change Root test failed! Invoking emergency shell.<br>
> Enter password to try to manually fix.<br>
> After fixing run exit to continue this script, or reboot -f to retry, or<br>
> touch /takeover and exit to become PID 1 allowing editing of this script.<br>
> Give root password for maintenance<br>
> (or press Control-D to continue):<br>
> <br>
> <br>
> ... and tries to load from MTD which has been purposely erased, and thus<br>
> complains.<br>
<br>
</div></div>Have you tried building a netboot image? I think this commit is relevant:<br>
<br>
<a href="https://gerrit.openbmc-">https://gerrit.openbmc-</a><wbr><a href="http://project.xyz/#/c/1957/">project.xyz/#/c/1957/</a><br>
<br>
Cheers,<br>
<br>
Andrew<br>
</blockquote></div><br></div>