Factory reset


pmprog

DNF (Did Not Finish)
Joined
Apr 25, 2011
Messages
4,150
I'm currently on honeymoon, and whilst trying to make some changes on my pandora (make a script sudo without a password), i broke the sudo function (duplicate file, which seems to create a double-free error). Basically, my Pandora is effectively bricked, as i can't sudo, su or mount any PNDs. (Also can't enable wifi)


It would be nice, given the extra space and it being a mobile device that you could factory reset the device without having to have internet or sdcard preprepared
 
What extra space?


Anyway, you probably already know but factory reset = reflash. For which you need that preprepared SD card.


Although it sounds like all your woes are probably down to your breaking sudo. Fix that, for which you don't need the internet, a preprepared SD card or even any SD card, just your wits. I don't quite understand what you did though (double free from the command line?). What did you need to touch apart from sudoers?
 
Since we'll have some more internal NAND on the Pyra, having a bootloader capable of starting up a rescue/reflash system should be possible?
 
Last edited by a moderator:
What extra space?
The larger internal eMMC storage
Although it sounds like all your woes are probably down to your breaking sudo. Fix that, for which you don't need the internet, a preprepared SD card or even any SD card, just your wits. I don't quite understand what you did though (double free from the command line?).
Yeah, how do you fix sudo when you have zero root access on a Pandora?To break sudo, what I did was the following


cd /etc/sudoers.d/
sudo cp 99_c64tools 99_myscripts
sudo mousepad 99_myscripts
change 99_myscripts and click save, it'll tell you it's readonly, so save the file as 99_myscripts1.
Close the mousepad and terminal screens, and bingo, you should no longer be able to sudo.

Errors were:

1. chmod on 99_myscripts1 should be 440, and was 664 or something

2. Actual gclib error doublefree or corruption after failing to parse 99_myscripts

Not sure if I just got unlucky, but anyway...

What did you need to touch apart from sudoers?
When you can't sudo, su, or visudo, you cannot access the sudoers to edit them, ergo, you are stuck
 
Sorry, I didn't notice the section. Yeah, from the factory the NAND will contain the live OS which I'm expecting to be significantly bigger than the current OS, but if you switched to booting off an embedded micro SD card, I'd hope it'd be possible to burn a reimage image from the NAND.


I suppose it's perfectly possible to achieve this already on the Pandora though. If you were to boot off SD and stuffed that up, there's nothing stopping you copying your NAND over to your SD and picking up again from there.


If it would fit, a copy of the base FS and uboot setup stored somewhere in duplicate on the NAND which could be used to restore everything to factory might be a nice feature. Although I'm a bit hesitant, as the OS does and should develop over time - rolling back to the factory OS means reintroducing bugs.


Edit: You broke sudo without having a root password set? Oops!
 
Last edited by a moderator:
Can't you boot the Pandora in single user mode? Haven't done that and am currently using it so don 't want to try. Couldn't find it on the wiki either. Does somebody know?
 
Good point. From what I can tell the rescue console boot will get you into single user mode, or something very like it.  It doesn't take you through the configured runlevel 0 and 1 but just starts a bash instance, presumably at system level, so you can do what you like from there (but your environment might be a bit screwy if you want to do anything fancy).
 
Surely you can use the internet provided to download the latest update for your SD card and restore?
 Despite the Pyra talk, I could not enable wifi, so the Pandora couldn't connect. I also didn't bring my netbook.

However, I got lucky; a combination of smartphone with microsd card, my sansa clip+ (which has a microsd slot) and a usb cable managed to get it fixed. But if you're out with only a Pandora/Pyra, this would have been impossible to fix

Edit: You broke sudo without having a root password set? Oops!
Yes, for some reason linux setups don't like you having a password on root anymore, or logging in as root. It's seen as breaking the security model.As I was't intending to break anything, but did, it left up up swan lake.

Good point. From what I can tell the rescue console boot will get you into single user mode, or something very like it.
Did try and use the console boot, but as no root password, couldn't log in. Don't know if I should have just tried my user account though.
 
Well, you ought to have been able to log in as your user, but from there not being able to sudo or log in as root wouldn't help you fix your sudoers files.


Was that the rescue console boot I linked, or some other option (perhaps one of the R-shoulder boot options)? I'm not clear whether the linked solution would require logging on or not.


FWIW if your netbook is running Linux and you broke sudo in a similar way, you'd be in exactly the same position as you were with your Pandora. It's a worthy idea to make rescue reflashing on Pyra less dependent on internet access though, although to a certain extent I'd expect most Pandora/Pyra users to boot from SD before fiddling with this kind of thing, so for them it's just a matter of removing the SD card, or R-shoulder booting, to go back to booting from the clean NAND flash.
 
I don't get the point of the idea. Currently one can have factory reset by just beeing lazy: just keep the "full flash" files on the SD-Card. Except that some extra space is needed, I can't see any downsides in this approach. What do I miss here?
 
What do I miss here?
It's just an argument for including the "full flash" in a special partition on the internal storage by default. There's some merit in the idea, but if it's anything like the Windows recovery partition the first thing pretty much everyone is going to do is reformat that sucker so you can get your storage back :p
 
There's some merit in the idea, but if it's anything like the Windows recovery partition the first thing pretty much everyone is going to do is reformat that sucker so you can get your storage back :p
This is the first time I've really messed up a mobile device, that's why having a recorvery sd card seems excessive. I guess you'd be right. Maybe it's overkill. Did ED say you could boot from eMMC or microSD, and still have two SDCards? If so, I guess an OS on each and you'd be ok.
 
Did ED say you could boot from eMMC or microSD, and still have two SDCards?
*He* didn't say it, but the spec docs for the OMAP5 do: it can boot from eMMC (ie, internal MMC or microSD card, whichever is finally chosen), MMC1 (first SD slot, but not second), USB, SATA, and if you're really stuck, UART3. gta04 would have to go out of his way to design something which WOULDN'T be able to boot from SD, USB, or SATA.So yes, there are three MMC interfaces, one internal can be booted from and two external one of which can be booted from.
 
You could keep a recovery uSD card in the internal slot, and normally boot off the built-in memory. (selectable with a dip switch or suchlike)
 
You could keep a recovery uSD card in the internal slot, and normally boot off the built-in memory. (selectable with a dip switch or suchlike)
Pssh, the eMMC will be my recovery partition. Borked up my microSD? Take it out! Fix it when I have the chance to get to a computer (or used the eMMC to download the files I need onto my regular SD to reflash it)

-God Ginrai
 
I don't think there's going to be both an internal microSD and eMMC, it's one or the other. The OMAP5 only has so many mmc interfaces.
 
I don't think there's going to be both an internal microSD and eMMC, it's one or the other. The OMAP5 only has so many mmc interfaces.
EvilDragon has already confirmed that both would be on the board.

If we use the OMAP5, you can then either use the eMMC together with both full sized SD Card slots or the MicroSD Slot with both full sized SD Card slots.

If a future SoC supports more MMC devices, you will be able to use all the devices at the same time.

 

This should be a solution perfect for everyone. You can either boot from eMMC, the internal MicroSD Card or the Full Sized SD Card slot (like on the Pandora).

 

And in case your eMMC breaks (never seen that on the Pandora, but you never know), then simply put a MicroSD Card in and switch to that slot.

 

I hope you're happy with that solution :)
-God Ginrai
 
Back
Top