maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Depreciated] BackupMenu - Backup & restore OS images(+ other features) (https://talk.maemo.org/showthread.php?t=58633)

RobbieThe1st 2010-09-06 11:40

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
BackupMenu(nor any other software) can remove or break the flasher.
Just turn off the N900, open the keyboard, hold the U key then plug in the USB. It should work fine.

Also, Shadow, if you are talking about the Terminal mode of BackupMenu, yes, its glitched. amongst other things, the third row of keys is shifted one key to the left, and I haven't been able to fix it yet.

RobbieThe1st 2010-09-07 05:29

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
I'm experimenting with running from a bare-essentials chroot, which is a prereq if I want to more safely mess with the rootfs.

I made my ramdisk:
Code:

mknod -m 660 /dev/ram b 1 1
chown root.disk /dev/ram
dd if=/dev/zero of=/dev/ram bs=1k count=4k
/sbin/mkfs.ext2 -m 0 /dev/ram 4096
mkdir /tmp/disk
mount -t ext2 /dev/ram /tmp/disk

Worked fine.
I copied /bin/busybox, and created a simlink in the new directory:
Code:

mkdir /tmp/disk/bin
cp /bin/busybox /tmp/disk/bin/
cd /tmp/disk/bin/
ln -s ./busybox sh

Worked fine. Running "./sh" brought up a new shell; the program works.

But when I try to chroot into it:
"chroot /tmp/disk/"
I get:
"chroot: cannot execute /bin/sh: No such file or directory."

What did I do wrong?

Rob1n 2010-09-07 09:01

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by RobbieThe1st (Post 809223)
But when I try to chroot into it:
"chroot /tmp/disk/"
I get:
"chroot: cannot execute /bin/sh: No such file or directory."

What did I do wrong?

Busybox isn't statically linked on the N900, so you'll need to copy the necessary libraries over as well.

RobbieThe1st 2010-09-07 09:07

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by Rob1n (Post 809337)
Busybox isn't statically linked on the N900, so you'll need to copy the necessary libraries over as well.

Thanks.

But, erm, two questions:
Which are those/where can I find them, and why is it saying "can't find file X"? Shouldn't it say something like "missing X library.so"?

Rob1n 2010-09-07 10:12

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by RobbieThe1st (Post 809342)
Thanks.

But, erm, two questions:
Which are those/where can I find them, and why is it saying "can't find file X"? Shouldn't it say something like "missing X library.so"?

Use ldd to find the required libraries for an application. For busybox, they're:
  • /lib/libcrypt.so.1 (symlink to /lib/libcrypt-2.5.so)
  • /lib/libc.so.6 (symlink to /lib/libc-2.5.so)
  • /lib/ld-linux.so.3 (symlink to /lib/ld-2.5.so)

You'll probably also need to bind mount /dev, /proc and /sys under your chroot:
Code:

mkdir /tmp/disk/dev /tmp/disk/sys /tmp/disk/proc
mount -o bind /dev /tmp/disk/dev
mount -o bind /sys /tmp/disk/sys
mount -o bind /proc /tmp/disk/proc

As for why you get the error message you get - it's a bit confusing, but actually correct. It cannot execute /bin/sh because the linked libraries don't exist.

RobbieThe1st 2010-09-07 10:49

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Perfect! It worked. Tomorrow I'll see about actually sticking it in my script, and hopefully in a day or two I'll have an alpha version for testing!

Stay tuned!

-Rob

RobbieThe1st 2010-09-08 21:55

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
I've been working on this solidly since my last post.
Curently, I have two files:
BackupMenuLauncher.item, which is in /etc/bootloader.d/ and runs when you start up your N900 with the keyboard open.
This file makes a ramdisk(and now, a tmpfs), loads all required files into it, and copies the second file, the actual program, from /opt/BackupMenu.item, then chroots into the ramdisk launching that file.
Code for each of these is pastebinned in the above links.

When I run this from the Maemo terminal as root, it works(as best I can see of it). I get errors on not being able to use udev(as its already running), but it actually seems to launch the script fine.

When I run it from the bootmenu-console, everything works fine until the launcher chroots, at which point it apparently dies and drops back to the bootmenu official menu.

Any ideas on what I'm doing wrong?

P.S. How do I get /etc/mtab in my chroot? "mount" does this.


edit: Yea, still having the problem.

edit2:
Found it. The second file was in /opt/, which is its own partition... which isn't mounted deliberately. :\
Moved it to the root partition, worked great.

edit3:
Sooo... working away at it. I'm having trouble mounting the SD partition; getting "invalid argument". I'm sure its something simple(or maby not...)

Thanks,

-Rob

Erazor 2010-09-12 15:53

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by RobbieThe1st (Post 806956)
Yea, I'm gonna have to try that, MohammadAG. Thanks.

Hm i put the lines in several positions in the /etc/bootmenu.d/BackupMenu.item

But no Keyboard lights!

Should follow line
echo 255 > /sys/class/leds/lp5523\:kb$3/brightness
work under xterm?
By me the line doesn't change the backlight off my N900

Greetz
Erazor


edit:

Hope you're not angry with me, when I change your file!
Only want to help you to fix/add this :)
*hide myself under the shirt*

RobbieThe1st 2010-09-13 02:38

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by Erazor (Post 814191)
Hope you're not angry with me, when I change your file!
Only want to help you to fix/add this :)
*hide myself under the shirt*

Its GPL licensed, so it doesn't matter. You can distribute, copy, edit, etc. without asking me, so long as you distribute your edits under the same license. At least, that's my interpretation of it.

Of course, even if I -have- to allow editing, I don't mind it anyway. I want to see some people messing with it; figure out better ways of doing things. I'm -not- an expert, after all...

Anyway, while I haven't tried it, but you will have to A, load the module first with "insmod /lib/modules/current/leds_lp5523.ko"(note: it may also be "modprobe" instead of insmod), then after that run the "for x in 1 2 3 4 5 6; do echo 255 > /sys/class/leds/lp5523\:kb$x/brightness; done" line.

Erazor 2010-09-13 02:47

Re: [Announce] BackupMenu - Backup & restore OS images(+ other features)
 
Quote:

Originally Posted by RobbieThe1st (Post 814556)
Its GPL licensed, so it doesn't matter. You can distribute, copy, edit, etc. without asking me, so long as you distribute your edits under the same license. At least, that's my interpretation of it.

Of course, even if I -have- to allow editing, I don't mind it anyway. I want to see some people messing with it; figure out better ways of doing things. I'm -not- an expert, after all...

Anyway, while I haven't tried it, but you will have to A, load the module first with "insmod /lib/modules/current/leds_lp5523.ko"(note: it may also be "modprobe" instead of insmod), then after that run the "for x in 1 2 3 4 5 6; do echo 255 > /sys/class/leds/lp5523\:kb$x/brightness; done" line.

ok :)
thx



i have already take this in the file with insmod and modprobe in different places.

but i dont get the keyboard lights running.
strange things

only for the archives!!!!
the line called
echo 255 > /sys/class/leds/lp5523\:kb$3/brightness
for example.

or

do echo 255 > /sys/class/leds/lp5523\:kb$3/brightness
done


???

i will test this and let you know, when it works :)

thx for the reply


All times are GMT. The time now is 13:07.

vBulletin® Version 3.8.8