add support for ox820 devices

This commit is contained in:
Mario Fetka
2012-12-22 10:15:25 +01:00
parent 658f09c066
commit 7dad20c4b5
31 changed files with 934 additions and 6 deletions

47
scripts/oxnas/disk_create Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
[ "x$1" == "x"] && {
echo "Usage: $0 hard-disk-device"
exit 1
}
# uncomment line below and set to the correct disk
disk=$1
workarea="."
stage1File=$workarea/stage1.wrapped
ubootFile=$workarea/u-boot.wrapped
ubootenvFile=$workarea/u-boot.env
perl <<EOF | dd of="$disk" bs=512
print "\x00" x 0x1a4;
print "\x00\x5f\x01\x00";
print "\x00\xdf\x00\x00";
print "\x00\x80\x00\x00";
print "\x00" x (0x1b0 -0x1a4 -12 );
print "\x22\x80\x00\x00";
print "\x22\x00\x00\x00";
print "\x00\x80\x00\x00";
EOF
if [ -f $stage1File ];then
echo "Writing stage 1"
dd if=$stage1File of="$disk" bs=512 seek=34
fi
if [ -f $ubootFile ];then
echo "Writing uboot"
dd if=$ubootFile of="$disk" bs=512 seek=154
fi
echo "Generating uboot env"
pushd $workarea/u-boot-env
./creatext2loadenv.sh
popd
if [ -f $ubootenvFile ];then
echo "Writing uboot env"
dd if=$ubootenvFile of="$disk" bs=512 seek=558
fi