Change boot device

This forum is for all other ARMv5 devices

Re: Change boot device

Postby dinjo » Thu Feb 14, 2013 2:27 pm

Does not work there are several issues with your init script there is no she bang , there seems typo on path
dinjo
 
Posts: 258
Joined: Mon Nov 28, 2011 5:59 am

Re: Change boot device

Postby ejblom » Thu Feb 14, 2013 8:44 pm

$this->bbcode_second_pass_quote('dinjo', 'D')oes not work there are several issues with your init script there is no she bang , there seems typo on path


ok so you fixed it and then what happened?
ejblom
 
Posts: 27
Joined: Sun Feb 10, 2013 12:12 pm

Re: Change boot device

Postby dinjo » Fri Feb 15, 2013 1:22 am

Nope it didn't worked either.

I referred the link you mentioned but it aint working for me
dinjo
 
Posts: 258
Joined: Mon Nov 28, 2011 5:59 am

Re: Change boot device

Postby ejblom » Fri Feb 15, 2013 7:26 pm

$this->bbcode_second_pass_quote('dinjo', 'N')ope it didn't worked either.

I referred the link you mentioned but it aint working for me


Please post the contents of /sbin/ and the contents of the init script. Perhaps something is wrong.
ejblom
 
Posts: 27
Joined: Sun Feb 10, 2013 12:12 pm

Re: Change boot device

Postby dinjo » Tue Feb 19, 2013 4:35 pm

$this->bbcode_second_pass_code('', '[root@alarm /media/Data/sbin]$ ls -lR
.:
total 852
-rwxr-xr-x 1 root root 859548 Feb 14 19:38 busybox
-rwxr-xr-x 1 root root 350 Feb 14 19:53 init
drwxr-xr-x 2 root root 4096 Feb 14 19:38 mountpoint
drwxr-xr-x 2 root root 4096 Feb 14 19:38 sdb1

./mountpoint:
total 0

./sdb1:
total 0
')

$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 media/Data
/sbin/busybox pivot_root . media/Data

exec /sbin/init

/sbin/busybox echo "Panic! I shouldn't be here"')
dinjo
 
Posts: 258
Joined: Mon Nov 28, 2011 5:59 am

Re: Change boot device

Postby Mijzelf » Wed Feb 20, 2013 8:53 am

There are 2 errors:
* sdb1 should be a device node, not a directory:$this->bbcode_second_pass_code('', 'brw-rw---- 1 root root 8, 17 Sep 15 02:00 sdb1')Copy it from your /dev folder.
* The she bang in the script it missing. It should be$this->bbcode_second_pass_code('', '#!/sbin/busybox sh')
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

Re: Change boot device

Postby ejblom » Wed Feb 20, 2013 1:46 pm

$this->bbcode_second_pass_quote('Mijzelf', 'T')here are 2 errors:
* sdb1 should be a device node, not a directory:$this->bbcode_second_pass_code('', 'brw-rw---- 1 root root 8, 17 Sep 15 02:00 sdb1')Copy it from your /dev folder.
* The she bang in the script it missing. It should be$this->bbcode_second_pass_code('', '#!/sbin/busybox sh')


The first comment is interesting since I made a folder..... but it still works.. is that even possible?
ejblom
 
Posts: 27
Joined: Sun Feb 10, 2013 12:12 pm
Top

Re: Change boot device

Postby Mijzelf » Wed Feb 20, 2013 4:03 pm

$this->bbcode_second_pass_quote('ejblom', 'T')he first comment is interesting since I made a folder..... but it still works.. is that even possible?
:shock: When you had asked me that before telling it actually works, I would have said no.

I looked at the implementation of mount in busybox, and the device filename is passed unchanged to mount() in libc. I suppose this busybox binary is linked against uClibc, and that implementation is very short, just a syscall:$this->bbcode_second_pass_code('', '/*
* mount() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/

#include <sys/syscall.h>
#include <sys/mount.h>
_syscall5(int, mount, const char *, specialfile, const char *, dir,
const char *, filesystemtype, unsigned long, rwflag,
const void *, data)')So it's up to the kernel to decide what to mount.
The kernel *does* contain code to parse a device name to it's major and minor id. (Of course, the commandline specifies /dev/sda1 as rootfs, but there is no /dev yet, so the kernel is on it's own.) And now it turns out that the kernel uses this also as fall-back when the userland provides an invalid device file.
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am
Top

Re: Change boot device

Postby dinjo » Thu Feb 21, 2013 8:28 am

How do i copy the sdb2 file when tried copying it seems a large file i'm i doing anything wrong
dinjo
 
Posts: 258
Joined: Mon Nov 28, 2011 5:59 am

Re: Change boot device

Postby Mijzelf » Thu Feb 21, 2013 11:20 am

$this->bbcode_second_pass_code('', 'cp -a /dev/sdb1 /path/to/target/sdb1')
Mijzelf
 
Posts: 25
Joined: Wed Feb 20, 2013 8:44 am

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 10 guests