ms-dos, its just a 160 GB drive for testing so I don't need gpt for now.wicked wrote:and your disk has ms-dos or gpt partition table ?christiaan wrote:...to create a partition on the disk. FYI the only thing I've got going on right now is the KD20 not booting up and hanging with just a blue light. And when I remove the disk it boots from the nand.
So I still have a long way ahead I guess, I've had trouble opening up the case otherwise I might have the stuff laying around to fix a serial cable.
Shuttle kd20 - bricked
-
- Posts: 16
- Joined: Sat Sep 13, 2014 8:25 am
Re: Shuttle kd20 - bricked
Re: Shuttle kd20 - bricked
well, so Ive re-done the procedure, added those three command afterwards but no progress :/christiaan wrote:ms-dos, its just a 160 GB drive for testing so I don't need gpt for now.wicked wrote:and your disk has ms-dos or gpt partition table ?christiaan wrote:...to create a partition on the disk. FYI the only thing I've got going on right now is the KD20 not booting up and hanging with just a blue light. And when I remove the disk it boots from the nand.
So I still have a long way ahead I guess, I've had trouble opening up the case otherwise I might have the stuff laying around to fix a serial cable.
Any ideas why ?
Re: Shuttle kd20 - bricked
wicked, you write you edited /etc/rc. As far as I can find it's never called.
But to be honest, it's not clear to me how the boot procedure works. Initrd is loaded, and /linuxrc is executed.
Normally I'd expect it to mount the 'real rootfs', the ubifs in flash, in this case, and call switch_root, pivot_root or chroot to get that rootfs active, and in most cases /sbin/init in the new rootfs is called.
Another approach (seen in IomegaEMC and ZyXEL) is to keep the initrd, and mount the main part of the firmware on /usr, or something like that.
In this case /linuxrc seems to have as main function to update the firmware. And the script ends with:So apparently /sbin/init is expected to be called when /linuxrc ends. /sbin/init is a symlink to busybox, and the busybox init a light version of SystemV Init. There is no /etc/inittab, so it's perfectly possible that /etc/rc will be called. But I still can't find the ubifs being invoked anywhere.
What I *do* see, is that some network related modules are loaded, mii.ko and gmac.ko. But those modules are not available in initrd, only in the real rootfs!
BTW, I think the bootscripts are sloppy. It's hard to read, no functions are used, and it seems the same actions are repeated over and over.
In your case I would mount a partition early in /linuxrc, and redirect stderr and stdout:and maybe repeat that in /etc/rc.
But to be honest, it's not clear to me how the boot procedure works. Initrd is loaded, and /linuxrc is executed.
Normally I'd expect it to mount the 'real rootfs', the ubifs in flash, in this case, and call switch_root, pivot_root or chroot to get that rootfs active, and in most cases /sbin/init in the new rootfs is called.
Another approach (seen in IomegaEMC and ZyXEL) is to keep the initrd, and mount the main part of the firmware on /usr, or something like that.
In this case /linuxrc seems to have as main function to update the firmware. And the script ends with:
Code: Select all
echo "End of InitRD -- transfer to /sbin/init" 1>&2
umount /proc
umount /sys
# End of file
What I *do* see, is that some network related modules are loaded, mii.ko and gmac.ko. But those modules are not available in initrd, only in the real rootfs!
BTW, I think the bootscripts are sloppy. It's hard to read, no functions are used, and it seems the same actions are repeated over and over.
In your case I would mount a partition early in /linuxrc, and redirect stderr and stdout:
Code: Select all
mkdir -p /log
mount /dev/sda1 /log
exec >>/log/logfile 2>&1
set -x
echo "=== START of boot ==="
Re: Shuttle kd20 - bricked
ok, so this goes to /rclinux and /etc/rcMijzelf wrote: In your case I would mount a partition early in /linuxrc, and redirect stderr and stdout:and maybe repeat that in /etc/rc.Code: Select all
mkdir -p /log mount /dev/sda1 /log exec >>/log/logfile 2>&1 set -x echo "=== START of boot ==="
but how can I create ext2 partition after the whole procedure?
fdisk says:
Code: Select all
/dev/sdb contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Re: Shuttle kd20 - bricked
Is that a >2TB disk? If not, just press 'no', create a new, empty partition table ('a', when I remember well, press 'm' for help), and create a new partition. But make sure it start well beyond 32MiB.
If yes, you can also press 'no', and hope fdisk will just ignore the beyond 2TB part. Or use parted to create the partition.
If yes, you can also press 'no', and hope fdisk will just ignore the beyond 2TB part. Or use parted to create the partition.
Re: Shuttle kd20 - bricked
arrgh this is really annoyingMijzelf wrote:Is that a >2TB disk? If not, just press 'no', create a new, empty partition table ('a', when I remember well, press 'm' for help), and create a new partition. But make sure it start well beyond 32MiB.
If yes, you can also press 'no', and hope fdisk will just ignore the beyond 2TB part. Or use parted to create the partition.

no, the disk is not >2TB.
This is my whole procedure, maybe Ive messed something:
Code: Select all
tail, mount and make changes as described (add logging to rclinux and stuff)
127 umount initrd.d
128 sudo umount initrd.d
129 gzip initrd
130 mkimage -A ARM -O Linux -T RAMDisk -C gzip -a 61000000 -e 61000000 -d initrd.gz rdimg.gz.new
131 history
132 zcat Iomega-HMNHD-CE-1st-32M.img.gz | dd of=/dev/sdb bs=1M
133 dd if=uImage of=/dev/sdb bs=512 seek=1290
134 dd if=rdimg.gz.new of=/dev/sdb bs=512 seek=16674
135 dd if=/dev/sdb of=sth bs=446 count=1
136 sudo fdisk /dev/sdb #here write new msdos partition table (o and then w)
138 dd if=sth of=/dev/sdb
142 sudo fdisk /dev/sdb #here make partition, set type to 83, first sector at 65536
143 sudo mke2fs /dev/sdb1
144 sudo fdflush /dev/sdb1
disconnet the disk, put it on the nas
Nas with prepared disk: powerbutton constantly lit, the nas does not get ip from dhcp, does not write anything to /dev/sda1 (/dev/sdb1 on my live distro). Ive observed that the NIC in the nas blinks for 10-15 secs and then goes off for 4 secs and the whole thing repeats itself. Maybe the nas is in looped reebot?
Re: Shuttle kd20 - bricked
Nothing on sda1? So it's probably not mounted. Maybe it needs /proc, and/or a type specification:
BTW, does the initrd have a /dev/sda1? Else you have to create one.
Your command sequence looks fine to me.
Code: Select all
mount -t proc proc /proc
mkdir -p /log
mount -t ext2 /dev/sda1 /log
exec >>/log/logfile 2>&1
set -x
echo "=== START of boot ==="
Your command sequence looks fine to me.
Perfectly possible. The unchanged initrd has as ultimate goal to boot the ubifs rootfs. If that is damaged, it will fail. Who knows what init will do?Maybe the nas is in looped reebot?
Re: Shuttle kd20 - bricked
what do you mean ? what initrd ? within the gzipped rdimg ?Mijzelf wrote:BTW, does the initrd have a /dev/sda1? Else you have to create one.
Re: Shuttle kd20 - bricked
Yes. Initrd stands for 'Initial Ramdrive', and I guess rdimg for 'Ramdrive Image'.
Initrd a common name for a (simple) filesystem which is loaded in memory by the bootloader, together with the Linux kernel. The purpose is in most cases to provide scripts and tools to mount the real rootfs. (Very handy when the real rootfs is complicated, a raid array, an logical volume, an NFS share, a layered filesystem, ...)
Initrd a common name for a (simple) filesystem which is loaded in memory by the bootloader, together with the Linux kernel. The purpose is in most cases to provide scripts and tools to mount the real rootfs. (Very handy when the real rootfs is complicated, a raid array, an logical volume, an NFS share, a layered filesystem, ...)
Re: Shuttle kd20 - bricked
ok so you mean mounting /dev/sda1 in some stript within rdimg.gz (for example linuxrc). Done that, however it did not help.
Re: Shuttle kd20 - bricked
In that case I'm out of ideas. I guess it's something simple, but that is hard to debug.