SATA boot/update summary

This forum is for all other ARMv5 devices

SATA boot/update summary

Postby jdr » Thu Jul 26, 2012 12:48 am

Recently I switched one of the Pogopug Pro's to the SATA boot process. It's very nice. However there were a few issues to be resolved.

    Error message about /dev/null on ssh
    Error when attempting to ssh out


The following commands, added to /etc/rc.local resolve this:
chmod 666 /dev/null
chmod 666 /dev/random
chmod 666 /dev/urandom

Pacman -Syu following the SATA install, then reboot did not result in an accessible device. The problem is, as noted elsewhere, is that the modules are incorrectly located.

As root, perform the command mv /lib/modules /usr/lib/modules

I've also modified the disk_create command, used to load the boot loader and kernel image. Since I keep the previous configuration in place, with the USB drive attached, I can easily switch back to a runnable system. I update the SATA drive from the Pogoplug Pro and have the SATA drive mounted on /mnt. Doing this allows me to merely look at /mnt/boot to see if a kernel is there, and use that in the disk update.

Here it is:$this->bbcode_second_pass_code('', '#!/bin/sh

# uncomment line below and set to the correct disk
disk=/dev/sdb

kernelPartition=${disk}1

if [ -z "${disk}" ] ; then
echo "You must uncomment/set the 'disk' variable"
exit -1
fi

workarea="."

stage1File=$workarea/stage1.wrapped
ubootFile=$workarea/u-boot.wrapped

# check to see if the target file system exists on /mnt
# and use the kernel from that

if [ -b $kernelPartition ]
then
if [ -f /mnt/boot/uImage.nopci ]
then
echo "Using kernel image uImage.nopci from /mnt/boot ... ^C to abort"

kernelFile=/mnt/boot/uImage.nopci
sleep 2
else
echo "using kernel $workarea/uImage"
kernelFile=$workarea/uImage

sleep 2
fi
else
echo "Kernel destination $kernelPartition does not exist .. no kernel will be written."

kernelFile=
fi
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 to $disk"
dd if=$stage1File of="$disk" bs=512 seek=34
else
echo "stage 1 file not defined .. not written to $disk"
fi

if [ -f "$ubootFile" ];then
echo "Writing uboot to $disk"
dd if=$ubootFile of="$disk" bs=512 seek=154
else
echo "uboot not defined .. not written to $disk"
fi

# Only write the kernel if it has been defined
if [ "$kernelFile" ];then
echo "Writing kernel to ${kernelPartition}"
dd if=$kernelFile of="$kernelPartition" bs=512
fi
')

It's a tremendous help to have a serial console available when things do wrong. This is just like the old UNIX days!
jdr
 
Posts: 7
Joined: Mon Jul 23, 2012 3:41 am

Re: SATA boot/update summary

Postby WarheadsSE » Thu Jul 26, 2012 3:05 pm

heads up: those uImage/uboots are just symlinks.. it would be easier just to change those out ;)
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: SATA boot/update summary

Postby jdr » Fri Jul 27, 2012 2:15 am

Understood, re: symlink to uImages.

Since I made the script for myself, and only use the .pci version ...
jdr
 
Posts: 7
Joined: Mon Jul 23, 2012 3:41 am


Return to Community Supported

Who is online

Users browsing this forum: No registered users and 34 guests