[Resolved] How to solve warm/cold reboot problem

This forum is for all other ARMv5 devices

[Resolved] How to solve warm/cold reboot problem

Postby ejblom » Mon Feb 11, 2013 7:03 pm

Dear V3 users,

As many of you might know,the warm/cold reboot problem was a serious issue for the Archlinux distro on Pogoplug Pro/V3/B0x.
It basically comes down to the fact that the device tries to boot from the USB device that is seen first, and this particular device might not be the one that you would want to boot from.
I've posted some questions on this forum as well as on another forum. One of the guys over there suggested that I used busy box to switch between the root fs if the wrong disc. I have the following setup:

Pogoplug V3
4GB USB flash with Archlinux
1TB WD elements for data storage.

With every reboot, I had to remove the USB cable for the 1TB drive.

First download busybox (statically linked, Arm EABI): http://www.mediafire.com/?djzcjjbt5ea45dg

Test it on your pogoplug

$this->bbcode_second_pass_code('', '
cmd]$ ./busybox
BusyBox v1.10.4 (2012-02-15 18:45:56 UTC) multi-call binary
Copyright (C) 1998-2007 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Usage: busybox [function] [arguments]...
or: function [arguments]...

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!

Currently defined functions:
[, [[, ash, basename, cat, chmod, cp, cut, dd, dirname,
echo, egrep, expr, false, fdisk, fgrep, grep, halt, head,
hwclock, ifconfig, kill, ln, ls, mdev, mkdir, mknod, mount,
mv, pivot_root, poweroff, printf, pwd, readlink, realpath,
reboot, rm, rmdir, sed, seq, sh, sleep, sort, split, switch_root,
sync, test, touch, tr, true, umount, uname, uniq, wc,
yes[/cmd]
')

On your USB disc (for instance /mnt/external) create a folder sbin which contains the following:

the busybox executable (remember to chmod +x),
a folder describing the device node sdb1,
a folder named mountpoint
and a script named init

The init file contains this:
$this->bbcode_second_pass_code('', '
/sbin/busybox sleep 10
# Mount 'the other disc
if ! /sbin/busybox mount /sbin/sdb1 /sbin/mountpoint
then
ERROR=$?
/sbin/busybox echo "Panic! Cannot sdb1 : ${ERROR}"
exit ${ERROR}
fi

cd /sbin/mountpoint
/sbin/busybox mkdir -p mnt/external
/sbin/busybox pivot_root . mnt/external

exec /sbin/init

/sbin/busybox echo "Panic! I shouldn't be here"')


Remember to chmod +x the init file as well.

The kernel mounts mounts sda1, and executes /sbin/init. This scripts mounts sdb1, switches the root, and executes /sbin/init op sdb1.

Let me know if it works! All credits to user Mijzelf from the GoT forum!
ejblom
 
Posts: 27
Joined: Sun Feb 10, 2013 12:12 pm

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 6 guests