Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Booting from PROM Menu

  1. #1
    Join Date
    Sep 2004
    Posts
    240

    Booting from PROM Menu

    I am attempting to test my failure recovery setup and the last step is to verify booting ability from the PROM. I am already in the prom, however I am having an issue with specifying the alternate boot partition and getting it to load. The kernel that is in the alternate partition (3) is a 3.1.5 killd kernel that is my backup. The kernel that is in the primary partition (6) is a 3.1.1c kernel that is used to monte with and works just fine right now.

    here is my output from the PROM capture:

    Output enabled
    Ram size = 64
    Service number is XXXXXXXXXXXXXX.
    What is password? password
    Build target = TiVo/mips/brcm/rel
    Build version = 2.5
    reset -
    color_bars -
    msw - [ -32 | -16 | -8 ] <address> <value>
    msr - [ -32 | -16 | -8 ] <address>
    help -
    param - [ <new boot args> ]
    netboot - [ -skip ] [ -f <file> ] [ <boot string> ]
    boot - [ -skip ] [ -3 | -6 ] [ <boot string> ]
    ememtest -
    identify -
    What? boot -3
    diskboot failed to verify written boot sector.
    What? boot -6
    Attempting to disk load partition 6
    Kernel signed by 'Kernel release key'
    Hashing kernel... done
    Checking signature... done.
    Signed, valid for release
    Loading R5432 MMU routines.
    CPU revision is: 00005430
    ....
    ....
    ....and away it boots.


    I have verified my 3.1.5 kernel, re-dd'd the kernel to (3) and I still get the same results.....

    Suggestions ?

  2. #2
    Join Date
    Feb 2005
    Posts
    359
    I was playing around with the same thoughts about having a rescue mode for myself a couple days ago and got it worked it out.

    Is that a killhdinitrd'd 3.1.5 kernel you've got partition 3? I don't think it is because I don't think your Tivo thinks so.

    When you are giving it boot -3 it appears to first verify the signature on the kernel its failing right there for you. If that check passes its going to boot using the boot parameters in the boot sector and kernel on partition 3. If your kernel was passing the check what it would do is boot the kernel in partition 3 and mount the root from /dev/hda7 (I'm sure hda7 is your current root since hda6 is your current primary boot partition.) That wouldn't be what you want either (at least I wouldn't guess thats you want, not a mind reader).

    I really think that kernel you've got there on partition 3 is not what you think it is. Get yourself a good killhdinitrd'd kernel there on 3 and then in the prom make sure to specify the root and serial console boot parameters manually yourself, if you do that it won't use the ones in the boot sector. So in your case you'll need (assuming serial port 2 is your console)

    boot -3 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200"


    Now what I've done is on the alternate pair I've got a killed 3.1.5 kernel and an /etc/rc.d/rc.sysinit that just starts up a bash shell. Partition 3 is currently my alternate boot and I can boot to it just fine with boot -3 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200"

    On my active pair I've again got a killed 3.1.5 kernel and an /etc/rc.d/rc.sysinit the first 12 lines of which are..

    #!/bin/bash

    echo here we go

    if [ $bash ]
    then
    while /hack/true
    do
    /hack/setsid /bin/bash --login < /dev/ttyS2 &> /dev/ttyS2
    sleep 5
    done
    fi

    Here's the deal, this is cool, if I ever get in a jam or once I've accepted a software upgrade from Tivo, then all I've got to do is boot from the prom menu and specify bash=something as a boot parameter and I end up in a bash shell where I can fix the problem or copy all my hacks over to the newly upgraded pair. When you are in the prom you can type param to see your current boot parameters. Here's my set up in action, booting from the prom menu with bash=true as a boot parameter.. if I'd left off the bash=true parameter or just typed boot -6 or even just boot or even just not gone into the prom menu at all it would have booted up completely..

    Output enabled
    Ram size = 32
    Service number is 240000080631B82.
    What is password? factory
    Build target = TiVo p0
    Build version = 1.18
    reset -
    ememtest -
    identify -
    boot - [ -skip ] [ -3 | -6 ] [ <boot string> ]
    netboot - [ -skip ] [ -f <file> ] [ <boot string> ]
    param - [ <new boot args> ]
    help -
    What? param
    Current boot page:
    signature = 0x1492
    primaryBootPartition = 6
    alternateBootPartition = 3
    bootParams = "root=/dev/hda7 upgradesoftware=false dsscon=true
    console=2,115200"
    netBootName = ""
    What? boot -6 "root=/dev/hda7 upgradesoftware=false dsscon=true console=2,115200
    bash=true"
    Attempting to disk load partition 6
    Kernel signed by 'Kernel release key'
    Hashing kernel... done
    Checking signature... done.
    Signed, valid for release
    CPU revision is: 00005430
    FPU revision is: 00005410
    Primary instruction cache 32kb, linesize 32 bytes.
    Primary data cache 32kb, linesize 32 bytes.
    Linux version 2.4.20 (build@buildmaster5) (gcc version 3.0) #22 Fri Feb 20 18:19
    :25 PST 2004
    Determined physical RAM map:
    memory: 02000000 @ 00000000 (usable)
    On node 0 totalpages: 8192
    zone(0): 8192 pages.
    zone(1): 0 pages.
    zone(2): 0 pages.
    Kernel command line: root=/dev/hda7 upgradesoftware=false dsscon=true console=2,
    115200 bash=true
    Monotonic time calibrated: 81.00 counts per usec
    Calibrating delay loop... 161.79 BogoMIPS
    Contiguous region 1: 1048576 bytes @ address 0x81780000
    Contiguous region 2: 524288 bytes @ address 0x81880000
    Contiguous region 8: 7340032 bytes @ address 0x81900000
    Contiguous region of 8912896 bytes total reserved at 0x81780000.
    Memory: 22156k/32768k available (1222k kernel code, 10612k reserved, 81k data, 6
    4k init, 0k highmem)
    Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
    Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Checking for 'wait' instruction... unavailable.
    POSIX conformance testing by UNIFIX
    PCI: Probing PCI hardware
    ttyS00 at iomem 0xb4100100 (irq = 79) is a 16550A
    ttyS00 at port 0xbc010000 (irq = 133) is a unknown
    ttyS00 at iomem 0xb4100140 (irq = 81) is a 16550A
    ttyS00 at iomem 0xb4100120 (irq = 80) is a 16550A
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    Initializing RT netlink socket
    Starting kswapd
    Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en
    abled
    ttyS00 at 0xb4100100 (irq = 79) is a 16550A
    ttyS01 at 0xbc010000 (irq = 133) is a unknown
    ttyS02 at 0xb4100140 (irq = 81) is a 16550A
    ttyS03 at 0xb4100120 (irq = 80) is a 16550A
    Uniform Multi-Platform E-IDE driver Revision: 6.31
    ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
    hda: SAMSUNG SV1204H, ATA DISK drive
    hdb: Maxtor 4R080L0, ATA DISK drive
    ide0 at 0x400-0x407,0x438 on irq 87
    hda: 234493056 sectors (120060 MB) w/2048KiB Cache, CHS=232632/16/63
    hdb: 160086528 sectors (81964 MB) w/2048KiB Cache, CHS=9964/255/63
    Partition check:
    hda: [mac] hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8 hda9 hda10 hda11 hda12 hda13
    hda14 hda15 hda16
    hdb: [mac] hdb1 hdb2 hdb3 hdb4
    RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
    PPP generic driver version 2.4.2
    PPP Deflate Compression module registered
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 2048 bind 4096)
    ip_conntrack version 2.1 (256 buckets, 2048 max) - 152 bytes per conntrack
    ip_tables: (C) 2000-2002 Netfilter core team
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    VFS: Mounted root (ext2 filesystem) readonly.
    Freeing unused kernel memory: 64k freed
    here we go

    root@tivo:~ bash#

    One final note, root will be mounted read only. When you mount or remount any file system Linux tries to update the /etc/mtab file which is basically just a list of the mounted file systems. But it won't be able to do because root is mounted read only and /var which is where the /etc/mtab symbolic link actually points to isn't even mounted at all. Basically your going to just need to specify -n on any mount commands until you've got /var mounted rw, for example mount -n -o rw /dev/hda9 /var
    or maybe a
    mount -n -o rw,remount /dev/hda7 /
    And a final, final note :-), I see everybody on here doing stty sane on their consoles, I've found that to really be of no use, at least on my Tivo. However, what is HIGHLY useful is
    stty rows 24 columns 80
    Issue that command right away in the bash prompt on your serial console (in fact I've got it in my .bash_profile), have TERM set to xterm and then you should be able to edit files and do anything that makes use of the full terminal window without issue.
    Last edited by ocntscha; 02-24-2006 at 09:13 AM.

  3. #3
    Join Date
    Oct 2005
    Location
    Rochester, MN 10mi N of the Big Corn
    Posts
    236
    You might consider editing the /etc/fstab and change the entry for / (root) to have the device of /dev/hda4 or /dev/hda7 depending on which pair you are using.
    The more you search, the more you find. The more you read, the more you may learn.
    It is just as important to know the things that DON'T work.

    Attention Newbies -> Start with the document found HERE, I did.
    The opinions expressed in this post are based on my life experiences and may or may not reflect YOUR reality. Use the information provided at your own risk

    6 - S2 - DTivos with a total of 1.1TB storage - Hacked, networked, etc

  4. #4
    Join Date
    Feb 2005
    Posts
    359
    Quote Originally Posted by fantmn
    You might consider editing the /etc/fstab and change the entry for / (root) to have the device of /dev/hda4 or /dev/hda7 depending on which pair you are using.
    The stock fstab on hda4 has / mounting from /dev/hda4.
    The stock fstab on hda7 has / mounting from /dev/hda7.

    What would you change either of those to and why? I'm not following you. Ahh, actually maybe I kind of see where you going. You're trying to help rbreding boot up into his alternate pair. I don't believe changing fstab entries would be any of value but you made me think of an idea that ought to at least get him booted up into the alternate root using his one working kernel on partition 6. He should be able to go into the PROM menu and boot using that good kernel on partition 6 into the alternate root on partition 4 by doing thusly..
    boot -6 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200"
    Last edited by ocntscha; 02-24-2006 at 01:56 PM.

  5. #5
    Join Date
    Sep 2004
    Posts
    240
    OK, thanks guys for the in depth replies so let me provide some more input:

    Right now I am booting /dev/hda6 as the boot partition and /dev/hda4 as the root partition. Reason being is that before I finalized my monte setup I used /dev/hda6 as the test boot partition and never changed it back. Not that it matters (I don't think).

    So, my non monte boot partition that I am attempting to use as a backup is /dev/hda3. I have confirmed and tested both 3.1.5 and 3.1.1c killd kernels will not boot from the prom menu. Both provide the same response to :

    boot -3 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200"


    As additional information:

    To test to make sure I wasn't fubarring something I dd'd /dev/hda6 to /dev/hda3 (basically to duplicate the current booting kernel) and attempted to boot with the same command as above and I still got the following error:

    diskboot failed to verify written boot sector.


    So now I am thinking that something might be wrong with that kernel partition......

    Ideas ?

  6. #6
    Join Date
    Feb 2005
    Posts
    359
    Quote Originally Posted by rbreding
    As additional information:

    To test to make sure I wasn't fubarring something I dd'd /dev/hda6 to /dev/hda3 (basically to duplicate the current booting kernel) and attempted to boot with the same command as above and I still got the following error:

    diskboot failed to verify written boot sector.


    So now I am thinking that something might be wrong with that kernel partition......

    Ideas ?
    I am thinking something might be wrong with that partition 3 itself too. I was even going to suggest you try doing what you did, dd'ing 6 to 3. Thats exactly how I got the killed 3.1.5 kernel I was already using on partition 6 onto my partition 3. Worked perfect for me.

    Sorry, I don't know what to say. Other than I'm a bit curious what
    pdisk -l /dev/hda would show.

  7. #7
    Join Date
    Aug 2004
    Posts
    4,078
    Sounds like the same thing as this, but there isn't a resolution there either.

  8. #8
    Join Date
    Sep 2004
    Posts
    240
    Yep...that thread looks like the same problem. I did a search for "diskboot failed to verify written boot sector." and that thread didn't come up.

    BAH.


    Here is the output from pdisk:

    DIRECTIVO: {/} $ pdisk -l /dev/hda

    Partition map (with 512 byte blocks) on '/dev/hda'
    #: type name length base ( size )
    1: Apple_partition_map Apple 63 @ 1
    2: Image Bootstrap 1 4096 @ 75132992 ( 2.0M)
    3: Image Kernel 1 4096 @ 75137088 ( 2.0M)
    4: Ext2 Root 1 262144 @ 75141184 (128.0M)
    5: Image Bootstrap 2 4096 @ 75403328 ( 2.0M)
    6: Image Kernel 2 4096 @ 75407424 ( 2.0M)
    7: Ext2 Root 2 262144 @ 75411520 (128.0M)
    8: Swap Linux swap 260096 @ 75673664 (127.0M)
    9: Ext2 /var 262144 @ 75933760 (128.0M)
    10: MFS MFS application region 1048576 @ 76195904 (512.0M)
    11: MFS MFS media region 32142336 @ 42990656 ( 15.3G)
    12: MFS Second MFS application region 1048576 @ 77244480 (512.0M)
    13: MFS Second MFS media region 42990592 @ 64 ( 20.5G)
    14: MFS New MFS Application 1024 @ 78293056
    15: MFS New MFS Media 234283008 @ 78294080 (111.7G)
    16: Apple_Free Extra 4720 @ 312577088 ( 2.3M)

  9. #9
    Join Date
    Sep 2004
    Posts
    240
    So by reading the other thread is there not a way to change the primary boot partition in the prom (not a temp boot with the boot -X command) ?

  10. #10
    Join Date
    Feb 2005
    Posts
    359
    Actually I just had another thought. Before I'd posted that I'd Googled on your error "diskboot failed to verify written boot sector" which came up with 2 threads. Google, you'll find them too, neither of which terminates in a resolution. But something suggested to Alphawolf when he wasn't even able to boot up at all so he couldn't try it, you can at least boot off the one pair so you could try this, is boot up and then reset the pararameters in the boot sector with the boot page command. Find out what they are with bootpage -p /dev/hda and then just rewrite them out with bootpage -P 'the-same-parameters' /dev/hda. It kind of makes sense as a possibility of fixing your problem because the error appears to be complaining about your boot sector, not partition 3.
    Last edited by ocntscha; 02-24-2006 at 04:17 PM.

  11. #11
    Join Date
    Sep 2004
    Posts
    240
    Hmmm more rambling:

    I wonder if I changed the bootpage (inside the OS) to /dev/hda3 then rebooting and tried to use the boot -6 command with the same results ?

    EDIT:

    I change the bootpage to reflect the primary boot partition of /dev/hda3 and rebooted. Once inside the prom I issued the following command:

    boot -3 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200"

    and received the same results (diskboot failed to verify written boot sector). I thought OK, replicated and proceeded to issue the primary boot partition command of boot -3 and I also received the same error (diskboot failed to verify written boot sector). I issued the "boot" command and got the same results. Had to pull the plug and let it boot normally and it booted fine (with /dev/hda3 as the primary kernel parition booting /dev/hda4 as root).

    WTF?!?!?

    EDIT2:

    After going back over my logs I noticed something I missed in the last change. I changed the primary bootpage (bootpage -B3 /dev/hda) however I didn't flip the alternate (bootpage -A6 /dev/hda). So as such I had a primary and alternate of /dev/hda3. I change the alternate to 6 after it booted back up and then rebooted into the prom again. I issued the boot -6 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200" command and got the usual error, however I issued the boot -3 "root=/dev/hda4 upgradesoftware=false dsscon=true console=2,115200" command and it booted right up like it should.

    SO, it looks like (similar to AW's issue) that you have problems in the PROM getting the alternate boot kernel to come up.

    Can someone else comfirm this at all ?
    Last edited by rbreding; 02-24-2006 at 04:30 PM.

  12. #12
    Join Date
    Oct 2005
    Location
    Rochester, MN 10mi N of the Big Corn
    Posts
    236
    Quote Originally Posted by ocntscha
    The stock fstab on hda4 has / mounting from /dev/hda4.
    The stock fstab on hda7 has / mounting from /dev/hda7.

    What would you change either of those to and why? I'm not following you. Ahh, actually maybe I kind of see where you going. You're trying to help rbreding boot up into his alternate pair.
    I could not tell where rbreding alternate pair came from. If he used DD to copy 3 -> 6 and 4 -> 7 then the fstab would be incorrect.
    The more you search, the more you find. The more you read, the more you may learn.
    It is just as important to know the things that DON'T work.

    Attention Newbies -> Start with the document found HERE, I did.
    The opinions expressed in this post are based on my life experiences and may or may not reflect YOUR reality. Use the information provided at your own risk

    6 - S2 - DTivos with a total of 1.1TB storage - Hacked, networked, etc

  13. #13
    Join Date
    Sep 2004
    Posts
    240
    Quote Originally Posted by fantmn
    I could not tell where rbreding alternate pair came from. If he used DD to copy 3 -> 6 and 4 -> 7 then the fstab would be incorrect.

    I actually didn't have anything in /dev/hda7 yet as I was just trying to get the kernels to swap between themselves in the PROM.

    I used dd to copy my killd kernel (dd if=killdkernel of=/dev/hda3) and tested, and also dd'd 6 -> 3 and tested with the same results in the prom.


    EDIT: as a followup I tested by attempting to boot the alternate root partition (/dev/hda7) with the boot -3 "root=/dev/hda7 upgradesoftware=false dsscon=true console=2,115200" command and it booted right up like I expected, however you are correct that the /etc/fstab still reflected root as /dev/hda4.
    Last edited by rbreding; 02-24-2006 at 04:40 PM.

  14. #14
    Join Date
    Feb 2005
    Posts
    359
    Quote Originally Posted by rbreding
    SO, it looks like (similar to AW's issue) that you have problems in the PROM getting the alternate boot kernel to come up.

    Can someone else comfirm this at all ?
    No, I can confirm that I DO NOT have problems going into the prom and getting the alternate kernel to come up.

  15. #15
    Join Date
    Sep 2004
    Posts
    240
    Quote Originally Posted by ocntscha
    No, I can confirm that I DO NOT have problems going into the prom and getting the alternate kernel to come up.

    So both the boot -6 and boot -3 commands work fine for you ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •