Cool, so I have now functioning u-boot on there and all seems well again. To recap, here's what I noted through this process: One of the scripts dd's some things to ${disk}1 which corrupts the partition and makes it unbootable. The default env vars in the shv tarball don't boot. They hunt for a wildly obsolete kernel. The choice of format utilities is important, not allby maldridge - uBoot
Holy sysvinit batman, its booted! I'll go ahead and try to do a firmware reflash from here and see if I can get back to a state I can boot from the NAND.by maldridge - uBoot
So close! I think that something is wrong with the disk layout, but I may be very much wrong there. I'm not particularly familiar with systemd so I'm not sure the best way to tell it exec in after manually mounting things: U-Boot SPL 2013.10-g3a0f380-dirty (Jul 26 2014 - 14:31:34) Boot device: SATA Attempting to set PLLA to 850 MHz ... plla_ctrl0 : 0000020a plla_ctrl1by maldridge - uBoot
So this drive actually has the new filesystem on it. It looks like the u-boot environment is hard coded to select the obsolete kernel: dt_sata_boot=ext2load ide 0:1 $uimage_addr /boot/uImage_2.6.31.14_OX820_1.2_shv.Pro; bootm $uimage_addr I altered the variable to load just /boot/uImage which is the newer file, here's the boot failure now: OX820 # run dt_sata_boot 4621824 bytesby maldridge - uBoot
I got a little bit further, here's what I've got now: The environment (fixed the bad env issue, turned out a typo meant it wasn't ever being written to the drive). OX820 # printenv dt_bootm=bootm $uimage_addr $uinitrd_addr $dtb_addr autoload=no baudrate=115200 bootargs=console=ttyS0,115200n8 bootcmd=run dt_bootcmd_ide bootdelay=3 console=console=ttyS0,115200n8 dt_boby maldridge - uBoot
Yet more discovery. I tried again using exactly the script provided in the post from page one. Using that script rather the one provided in the tarball does not corrupt the disk. In the one provided from the tarball there is this stanza: if [ -f $kernelFile ];then echo "Writing kernel to " dd if=$kernelFile of="$disk"1 bs=512 fi Though now I do not get as far aby maldridge - uBoot
Ok, on a whim, I went back and tried to do this again with the debian rootfs. I am now to the point that I can get through the u-boot screens and it starts trying to boot debian. It gets as far as mounting /dev/sda2 as the rootfs and then dies because the kernel is too old. Stage-1 Bootloader Mon Nov 14 22:36:34 EST 2011 Attempting to set PLLA to 850MHz ... plla_ctrl0 : 0x0000020A pby maldridge - uBoot
I fiddled with this for a while, but the u-boot that gets written by disk_create has been processed in some undocumented way. I cannot get the new version to load. I can put a new version on the disk and potentially chainload to it, but I cannot boot it directly.by maldridge - uBoot
I'm not sure I follow. I don't think we were able to get the other uboot working previously. I can boot the one that gets built with disk_create, is there a way to pivot in to the other one?by maldridge - uBoot
My network is setup for PXE without much trouble, but I understand if that's a rabbit hole you'd rather not go down. If its possible with the oxnas kernel I'm actually setup for NFS root here, so I could add an alternate root to serve the ARM chroot out of.by maldridge - uBoot
Still getting the reset after the nand erase, updated log: Stage-1 Bootloader Mon Nov 14 22:36:34 EST 2011 Attempting to set PLLA to 850MHz ... plla_ctrl0 : 0x0000020A plla_ctrl1 : 0x00330000 plla_ctrl2 : 0x0065008B plla_ctrl3 : 0x000000F1 PLLA Set Setup memory, testing Reading disk 0, Image 0 Sector : 0x0000009A Hdr len: 0x0001FB34 Hdr CRC: 0x2229BDCD OK Initiaby maldridge - uBoot
Further this time: uboot.2015.10-tld-2.ox820.bodhi.tar 100% 780KB 3.4MB/s 00:00 Stage-1 Bootloader Mon Nov 14 22:36:34 EST 2011 Attempting to set PLLA to 850MHz ... plla_ctrl0 : 0x0000020A plla_ctrl1 : 0x00330by maldridge - uBoot
I have a tftp server available on my network, I can run a cable over to the workbench and then I should be alright to load the files from there.by maldridge - uBoot
Hmm, I hit trouble loading form the disk. To be able to write to the partition I had to go back to the 2 partition scheme with the data living in the second partition. This means my partition map is now this: $ ide part Partition Map for IDE device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type 2 6144 156295344 83 Unfby maldridge - uBoot
The partition map shows up correctly based on how I built the disk. $ ide reset Reset IDE: $ ide part Partition Map for IDE device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type 1 32768 156268720 83by maldridge - uBoot
Okay, looks like everything but the USB subsystem is available: Stage-1 Bootloader Mon Nov 14 22:36:34 EST 2011 Attempting to set PLLA to 850MHz ... plla_ctrl0 : 0x0000020A plla_ctrl1 : 0x00330000 plla_ctrl2 : 0x0065008B plla_ctrl3 : 0x000000F1 PLLA Set Setup memory, testing Reading disk 0, Image 0 Sector : 0x0000009A Hdr len: 0x0001FB34 Hdr CRC: 0x2229BDCD OK Iby maldridge - uBoot
Things have been busy at work, I'll be able to try this tonight (Pacific Time).by maldridge - uBoot
I've tried everything I can think of with formatting and partitioning and I can't make it work as the first partition. Is there a way to get it to see the 2nd partition for the env file? Alternatively can I load the correct flash image to a USB key and just flash it from the spl u-boot?by maldridge - uBoot
Fair enough, I usually will put /boot on the first partition, though in this case I cannot get the disk to work without putting a 2M partition on the front of the disk which is inevitably corrupted after running the disk_create script. I've been trying to put a sufficient offset on the disk so this doesn't happen, but I haven't succeeded yet.by maldridge - uBoot
To your first point, the files are owned by me because I expanded the archive for the express purpose of checking the shasums. The ones on the boot volume are, naturally, owned by root. As far as the information you linked to below it occurs to me that the partition in question is actually the second partition on the disk, but it is labelled 'rootfs'. I wonder if some things are haby maldridge - uBoot
I used the tarball that was linked above, this is what mine contains. They appear to be identical: maldridge@deepblue:~$ ls -l Downloads/oxnas/ox820-sata-uboot/ total 8380 drwxr-xr-x 2 maldridge maldridge 4096 Aug 3 2014 dts -rwxr-xr-x 1 maldridge maldridge 32120 Aug 3 2014 u-boot-spl.bin -rwxr-xr-x 1 maldridge maldridge 16384 Dec 31 1969 u-boot.env -rw-r--r-- 1 maldridge mby maldridge - uBoot
Hmm, well the files appear intact and the system loads to this point. Would it be possible to just load the files from disk by hand without the environment? Unless there was a separate environment file from the one linked in the first linked thread, I am confident it is on the drive and not corrupt.by maldridge - uBoot
All the critical files look to be intact. I do find ext4 to be just a tad suspicious though for the format. Can the spl u-boot really read an ext4 volume? Here are the sha256sums of the important files. maldridge@deepblue:~$ sha256sum /mnt/boot/u-boot-spl.bin 70d359b639d28b8b6c701f1aea1ef47f849c3b7922ba92809afece99ff76f431 /mnt/boot/u-boot-spl.bin maldridge@deepblue:~$ sha256sum Dowby maldridge - uBoot
Got it working by offsetting the partition slightly from the start. After dumping the disk with xxd I realized that the first partition was close enough to the start it was being corrupted by the DD commands. I think it depends on how your partitioning software works whether or not you see such corruption. It still fails to boot though, here is the output: U-Boot 1.1.2 (Dec 31 2011 - 15by maldridge - uBoot
Meh, its not that bad. I've got a workbench of x86 hardware. Now that we're reasonably confident this is the problem, I can jump off of a live SATA bus and try this from there.by maldridge - uBoot
It is 2.5", but for that I would need a working system right? I'm still stuck at trying to get a rootfs on the drive. As soon as I run the create_disk script I can no longer mount the drive. Perhaps I need a sacrificial partition at the start of the disk?by maldridge - uBoot
The only thing I can come up with at this point is either a bad disk (seems odd, it takes and retains the partition table) or a bad SATA controller. The second is plausible since I'm going USB-SATA and I could see something getting reset or corrupted in the transfer. I guess I could boot up a system live and build the disk there, then move it over, but ideally I'd like to be able to dby maldridge - uBoot
Here's the fdisk output: Disk /dev/sdb: 74.5 GiB, 80026361856 bytes, 156301488 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00008000 Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 146802687 1468006by maldridge - uBoot
Hmm, I'm having no luck with those directions. Every time I try to run the script I wind up with a corrupt filesystem on the target disk. Perhaps I'm missing something? maldridge@deepblue:~/Downloads/oxnas/workdir$ sudo ./disk_create 0+1 records in 0+1 records out 444 bytes copied, 0.00790116 s, 56.2 kB/s Writing stage 1 14+1 records in 14+1 records out 7576 bytes (7.6 kB,by maldridge - uBoot
Sounds good, I have ordered an external SATA power supply as I think I lent mine out and never got it back. I'll report back here once I get this working.by maldridge - uBoot