Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  iPod: disable boot to original firmware with "hold"-button
« previous next »
  • Print
Pages: [1]

Author Topic: iPod: disable boot to original firmware with "hold"-button  (Read 7249 times)

Offline Tron

  • Member
  • *
  • Posts: 30
iPod: disable boot to original firmware with "hold"-button
« on: December 30, 2012, 12:20:07 PM »
Greetings,

I'm a happy Rockbox user for years now, just one thing bothers me a bit: I really don't need to boot into the original firmware any more (I know I can do that while holding "Menu" on boot), but quite often I happen to insert the device into my car adapter while locked (i.e., with the Hold-button on). Of course it always boots into the original firmware, which I don't want.

Is there a way to disable the "boot into original when Hold-button is on"?

Thanks in advance!
Logged
Cheers,
Tron

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9369
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #1 on: December 30, 2012, 12:48:43 PM »
I think you'd have to edit the bootloader, compile it and then install it to your player.
Logged

Offline Tron

  • Member
  • *
  • Posts: 30
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #2 on: December 30, 2012, 02:41:31 PM »
Yeah, probably. I think I'll check out the source then and see if I find something fitting there.
Logged
Cheers,
Tron

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 9369
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #3 on: December 30, 2012, 02:58:37 PM »
The ipod ports were before my time, but probably in /bootloader/ there should be an ipod.c or something similar that checks if the hold switch is activated. 
Logged

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #4 on: December 31, 2012, 04:57:40 AM »
Specifically, line 367 onwards:
Quote
   if (button_was_held || (btn==BUTTON_MENU)) {
        /* If either the hold switch was on, or the Menu button was held, then
           try the Apple firmware */

        printf("Loading original firmware...");
   
        /* First try an apple_os.ipod file on the FAT32 partition
           (either in .rockbox or the root)
         */
   
        rc=load_firmware(loadbuffer, "apple_os.ipod", MAX_LOADSIZE);
   
        if (rc == EOK) {
            printf("apple_os.ipod loaded.");
            return (void*)DRAM_START;
        } else if (rc == EFILE_NOT_FOUND) {
            /* If apple_os.ipod doesn't exist, then check if there is an Apple
               firmware image in RAM  */
            haveramos = (memcmp((void*)(DRAM_START+0x20),"portalplayer",12)==0);
            if (haveramos) {
                /* We have a copy of the retailos in RAM, lets just run it. */
      printf("RetailOS in RAM, running");
                return (void*)DRAM_START;
            }
        } else if (rc < EFILE_NOT_FOUND) {
            printf("Error!");
            printf("Can't load apple_os.ipod:");
            printf(strerror(rc));
        }
       
        /* Everything failed - just loop forever */
        printf("No RetailOS detected");
       
    } else if (btn==BUTTON_PLAY) {
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

Offline Tron

  • Member
  • *
  • Posts: 30
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #5 on: December 31, 2012, 10:32:33 AM »
Quote from: whiskers75 on December 31, 2012, 04:57:40 AM
   if (button_was_held || (btn==BUTTON_MENU)) {
        /* If either the hold switch was on, or the Menu button was held, then
           try the Apple firmware */

That worked, it sufficed to remove the "button_was_held" from the first line, thus only allowing the Menu-Button to boot into the original firmware. I compiled the bootloader and it works.

However, I neglected the fact that Rockbox resets to default values when that switch is on. I don't think it is too dangerous to remove that, too. If I someday should run into trouble, a reflash should cure any warped settings.

I found the following in apps/main.c:
Quote
    /* Reset settings if the hold button is turned on */
    if (button_hold())
#endif
    {
        splash(HZ*2, str(LANG_RESET_DONE_CLEAR));
        settings_reset();
    }
    else

Is that the correct location? Disabling the if-loop should do it, I think...
Logged
Cheers,
Tron

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #6 on: December 31, 2012, 10:42:46 AM »
Yes, but it would be advisable to leave it in or change the button as that is really for your safety should you near-brick it. ;)
Although, it is true that you can ALWAYS go into disk mode and reflash.
(I have an iPod Mini 1G that doesn't work with Rockbox)
« Last Edit: December 31, 2012, 10:44:33 AM by whiskers75 »
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #7 on: December 31, 2012, 10:44:14 AM »
Quote from: whiskers75 on December 31, 2012, 10:42:46 AM
Yes, but it would be advisable to leave it in or change the button as that is really for your safety should you near-brick it. :)

If you near-brick it one should still be able to boot into Apple's disk mode, no?
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #8 on: December 31, 2012, 10:45:02 AM »
Yes. (Updated post.)
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #9 on: December 31, 2012, 10:45:32 AM »
By the way, I can make a custom build for you with these tweaks enabled :)
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

Offline Tron

  • Member
  • *
  • Posts: 30
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #10 on: December 31, 2012, 01:05:03 PM »
Quote from: whiskers75 on December 31, 2012, 10:45:32 AM
By the way, I can make a custom build for you with these tweaks enabled :)

Thanks, I might come back to you about that. Until now, I have successfully compiled and installed Rockbox including the bootloader, but somehow I'm commenting the wrong if-statement. It runs, but still resets if the hold-switch is set...
Logged
Cheers,
Tron

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #11 on: January 01, 2013, 03:17:47 AM »
Quote from: Tron on December 31, 2012, 01:05:03 PM
Quote from: whiskers75 on December 31, 2012, 10:45:32 AM
By the way, I can make a custom build for you with these tweaks enabled :)

Thanks, I might come back to you about that. Until now, I have successfully compiled and installed Rockbox including the bootloader, but somehow I'm commenting the wrong if-statement. It runs, but still resets if the hold-switch is set...
No problem. Maybe try commenting out the ENTIRE reset code block :)
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1661
  • Hayden Pearce
    • Google+
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #12 on: January 01, 2013, 06:25:36 AM »
Quote from: whiskers75 on December 31, 2012, 10:42:46 AM
Although, it is true that you can ALWAYS go into disk mode and reflash.

ipodpatcher supports a few different types of installation, the default installation type (the most robust, but not the fastest) that Rockbox Utility uses being just one of many possible configurations. It isn't always safe to assume that the OF is going to be accessible.

The Nano2G and Classic are special exceptions. It is possible to 'brick' a Nano2G (but you have to really try to do it), but it is recoverable by opening the device and shorting two pads. The Nano2G is also special in that it can use either the Rockbox bootloader or emCORE.

The Classic an exception because it pretty much doesn't matter what you do to it, even though it isn't currently capable of booting either EDM or the Apple OF under emCORE you will always be able to restore the device using DFU mode and iTunes unless the hardware is actually damaged.


[Saint]
« Last Edit: January 01, 2013, 06:28:52 AM by [Saint] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Tron

  • Member
  • *
  • Posts: 30
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #13 on: January 01, 2013, 04:44:59 PM »
Hi all,

just a short post to tell you: it worked. Rockbox now boots flawlessly with the hold-switch on and I'm still able to boot into the original OS by holding "menu" if I really need to (that is sometimes necessary when the battery is really drained. In that case, Rockbox, which cannot charge while switched off, somehow cannot sustain itself by external power alone and keeps rebooting over and over. Booting into the original OS and charging the battery for a few minutes there does the trick...).

Thanks to all for the help!
Logged
Cheers,
Tron

Offline whiskers75

  • Member
  • *
  • Posts: 100
  • github.com/whiskers75
    • whiskers75
Re: iPod: disable boot to original firmware with "hold"-button
« Reply #14 on: January 02, 2013, 03:19:30 AM »
Quote from: Tron on January 01, 2013, 04:44:59 PM
Hi all,

just a short post to tell you: it worked. Rockbox now boots flawlessly with the hold-switch on and I'm still able to boot into the original OS by holding "menu" if I really need to (that is sometimes necessary when the battery is really drained. In that case, Rockbox, which cannot charge while switched off, somehow cannot sustain itself by external power alone and keeps rebooting over and over. Booting into the original OS and charging the battery for a few minutes there does the trick...).

Thanks to all for the help!

No problem. (I had the same power problem too!)
Logged
whiskers75/rockbox - Custom Build  
http://forums.rockbox.org/index.php/topic,42527.0.html
Devices: Sansa Clip+

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  iPod: disable boot to original firmware with "hold"-button
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.127 seconds with 21 queries.