Perform a Manual Software Upgrade

From DVRpedia

Revision as of 08:06, 12 June 2010 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Background Information

When TiVo releases a new version of software, it will remove all of your modifications when it installs. To work around this, two steps have to be performed. First, it is necessary to disable automatic software updates, which is described on the Prevent Automatic TiVo Software Upgrades page. Then, you must perform a manual software update yourself and copy over all of your modifications before rebooting to a new version of TiVo software. Otherwise, you must reinstall all of your modifications from scratch using instruction on the Modify the TiVo kernel page.

Manual upgrades take some user understanding as opposed to just entering a list of command line steps. Why? Because there is no "standard" load. For example, if you started with a vanilla HR10-250 TiVo with software version 3.1.5, then the kernel may start out on partition hda6. When "3.1.5d" loaded, your new kernel is on partition hda3. When you accept the "3.1.5e" load, the active kernel it moves back to partition hda6. If you never accepted the "3.1.5d" load, and want to accept the "3.1.5e" load, then your new kernel will be on partition hda3. All the same mess applies to the root directory. So you need to be "savvy" enough to figure out which partition is the current kernel partition and which partition will be the new kernel partition after the upgrade, then substitute your particulars into the commands you run.


Determine if you have a software update to install

Type the following command to see if you have a new version of TiVo software waiting to be installed:

echo mls /SwSystem | tivosh

You should see a couple of files, one for the old version and one for the new version of software:

   Name                      Type        FsId      Date  Time   Size
   ----                      ----        ----      ----  ----   ----
   3.1.5e-01-2-357           tyDb         850  10/31/04 00:18    700
   3.1.5f-01-2-357           tyDb      648985  03/22/06 02:55    676
   ACTIVE                    tyDb         850  10/31/04 00:18    700

The above example shows that software version 3.1.5e is active (ACTIVE has FsId of 850, which is the same as 3.1.5e.) The other line should show a newer version (3.1.5f) of TiVo software.

If you don't have and update then you can't perform the upgrade. These update are distributed by TiVo and/or DirecTV via the satellite on their own schedule.

As far as the updates go, the killhdinitrd kernel hack only works on certain kernel versions. Check the discussion forums to be sure that the new update does not require a new version of the Linux kernel. In many cases, the updates don't really include changes to the TiVo Linux kernel, so the original hacked kernel that you already have works just fine. The kernels are the same except for some header information. It's not that TiVo is trying to break "killhdinitrd", it's just that they are updating the header stuff per each release.

In most cases, we hack the original kernel and keep reusing it (that's the "dd" command in all the update instructions where the old kernel is copied over to the new kernel partition.)

What really makes the upgrades unique is the root directory. If the TiVo originally had root located at hda7, when you accepted the first upgrade, it made a new root on hda4, and if you accept ah additional upgrade, then you will get a new root on hda7 (same partition as original TiVo, but it's been reloaded with updates).

So in general, you need to figure out where your kernel is, and where your root is. The bootpage command will tell you where root is, and from that you can assume where the kernel is. Enter the following command at the telnet prompt:

  bootpage -p /dev/hda

if root = hda4 then kernel = hda3 if root = hda7 then kernel = hda6

So it's getting a little confusing, but if you follow the steps you should be able to figure it all out. Once you copy the hacked kernel, mount the "new" root, copy your hacks, then reboot.

As far as accepting the update, you have some choices:

  1. You can let the update happen and then pull the drive to recover your hacks
  2. You can do the upgrade yourself without having to pull the drive
  3. You can turn off updating all together

The update will only occur if you have a phone line and make a call. If you're using fakecall, then you won't get updated. For all DirecTiVos, the actual update comes down from satellite, but the "start load" is triggered during a real phone call. So if you want to hack with the new updates, plug in the phone line, disable fakecall, and go to the TiVo remote control and force a phone call. After the call you will see "pending restart", then either telnet in and follow the direction for a "no drive removal update", or reboot the unit and follow the "drive removal" procedure.

Updating without removing the drive

Here's a step-by-step to update an already hacked TiVo without removing the drive. It should work with any of the new software versions. If you carefully follow all the directions it should work for you. However, it's a little complex and leaves room for error. SO USE AT YOU OWN RISK.

Check to make sure you have the update

Check to make sure you have the update downloaded by typing:

 echo mls /SwSystem | tivosh

You should see a couple of files, one for the old version and one for the new version of software.

   Name                      Type        FsId      Date  Time   Size
   ----                      ----        ----      ----  ----   ----
   3.1.5e-01-2-357           tyDb         850  10/31/04 00:18    700
   3.1.5f-01-2-357           tyDb      648985  03/22/06 02:55    676
   ACTIVE                    tyDb         850  10/31/04 00:18    700

If you don't have it, then don't ask me why, these are distributed by DirecTV via the satellite or by TiVo over your phone/network connection.

Shutdown myworld

Shutdown a program that runs on the TiVo called "myworld". Cut-and-paste the string below to make sure you get all the correct quote marks:

 kill -9 `ps ax | grep "myworld" | grep -v "grep" | cut -c -5`

Check to make sure myworld isn't running. Enter the following command at the prompt:

 ps aux | grep myworld | grep -v grep

You should get no response, and go back to a Linux prompt. If you see a line that has myworld in it then something is wrong. Stop what you are doing and post a question on Yahoo groups to get help.

Edit the TiVo software install script

Comment out the line that causes the TiVo to reboot during the upgrade. You need an editor like joe or vi loaded on the TiVo, or you can use TextPad on your PC and FTP the file from and back to your TiVo. Since joe is the easiest to use editor, it will be used in example. Enter the following commands to make the TiVo file system Read/Write and then to use joe to edit the install script:

 mount -o rw,remount /
 joe /tvbin/installSw.itcl

Look at line 156. You will see a line with reboot on it. Put a # at the beginning of the line to comment out. Then press ctrl+k and then x to exit joe and save your changes. Now remount the file system as read-only:

 mount -o ro,remount /

Run the update

Enter the following command at the prompt:

 tivosh /etc/rc.d/finishInstall.tcl

You're gonna see a lot of output to the screen, it takes a little while, then you will get an error that says:

Could not check software installation: System should have rebooted

Entering the homestretch

Almost there. Now we need to copy the old kernel and our hacks to the new system and we are done. First, let's figure out where our new root directory is located by typing:

 bootpage -p /dev/hda

It will output some text, but we are interested in where root is. It should be at either /dev/hda4 or /dev/hda7. If it's different then you got something different going on. Stop and go to a discussion and ask some questions before you do anything else.

Copy the hacked kernel over the new kernel

Depending where your new root is located, you need to use the following:

If root=/dev/hda4 (from previous step) then type:

 dd if=/dev/hda6 of=/dev/hda3 bs=10k

If root=/dev/hda7 (from previous step) then type:

 dd if=/dev/hda3 of=/dev/hda6 bs=10k

You should see something like:

dd: /dev/hda3: No space left on device
205+0 records in
204+0 records out

Move the hacks that are outside of /var

We need to copy our hacks back to the new root directory. My hacks include only two files, /.bash_profile and /etc/rc.d/rc.sysinit.author, and I will show how I reinstalled my hacks. The base case is to copy the rc.sysinit.author to the new root which should give you ethernet and telnet access after the reboot (assuming you are using the stock TiVo ethernet drivers.) Do NOT forget to do a chmod and make these files executable, or you will be pulling the drive. Again, we need to figure out where our "new" root is located, then mount the new root:

If root=/dev/hda4, then type:

mount /dev/hda4 /install

If root=/dev/hda7, then type:

mount /dev/hda7 /install

Once it's mounted, copy the files there

cp /.profile /install
cp /etc/rc.d/rc.sysinit.author /install/etc/rc.d

Chmod to make executable

Chmod 755 /install/ etc/rc.d/rc.sysinit.author

If you have a /hacks folder in your root partition, you'll want to copy that over to the new root partition.

cp -Rd /hacks /install

If you are running Jamies USB 2.0 Highspeed Network drivers, you probably want to copy these drivers over to the new partition. See this thread by rbautch on TiVoCommunity.com for more details on how to do this.

Unmount the new partition:

sync
umount /install

You should now be done, so reboot by typing:

reboot

Copy Network Drivers to New Partition

If you use [USB 2.0 High Speed Backport Drivers], you must use copy_drivers to copy drivers from your alternate root file system partition to your current root file system. If you are doing a slice upgrade, this tool is meant to be run after the upgrade, but before rebooting.

It copies the following drivers, including (and maintaining) symlinks:

  • x8817x.o
  • usbnet.o
  • usbcore.o
  • usb-ohci.o
  • pegasus.o
  • ehci-hcd.o
  • It also copies your usb.map file if one exists.

Download the latest version of this script from the following TiVoCommunity.com thread: http://www.tivocommunity.com/tivo-vb/showthread.php?t=342867. Extract the zip file on your PC using 7-zip or equivalent.

FTP the file to a directory on your TiVo, such as the /hacks directory.

Telnet into your TiVo, change to the appropriate directory, make the file executable, and run the backup script:

mount -o rw,remount /
cd /hacks
chmod 755 copy_drivers
./copy_drivers

Note: If it fails to mount your alternate root, it's likely your alternate root is not populated. If you are doing a slice upgrade, this tool is meant to be run after the upgrade, but before rebooting.

How to recover from a upgrade that already occurred automatically

As discussed above, this HOW TO is based upon the partition structure of the original SW version and the killinithdrc boot patch only works on that one. IF you have already hacked your HD TIVO from the baseline SW , you can use the following procedure to recover your hacks.

The old partitions were: 6 = kernel 7 = root 9 = var

The new partitions are: 3 = kernel (new, so killhdinitrd is no longer installed) 4 = root (new, so all your hacks are gone) 6 = old_kernel with the killhdinitrd patch still in place 7 = old_root with all your hacks still in place

9 = var (not rebuilt, so your files are still there)

Do the following to recover:

Remove TiVo drive, move to PC and using the convention above:

 mkdir /mnt/var
 mkdir /mnt/root
 mkdir /mnt/old_root
 mount /dev/hdd9 /mnt/var
 mount /dev/hdd4 /mnt/root
 mount /dev/hdd7 /mnt/old_root
 dd if=/dev/hdd3 of=/mnt/var/orig_kernel.img (or save it elsewhere)
 dd if=/dev/hdd6 of=/dev/hdd3
 cp /mnt/old_root/.profile /mnt/root
 cp /mnt/old_root/etc/rc.d/rc.sysinit.author /mnt/root/etc/rc.d
 chmod 755 /mnt/root/.profile
 chmod 755 /mnt/root/etc/rc.d/rc.sysinit.author

Type sync, then and press ctrl-alt-del to shutdown. Reinstall the drive back into the TiVo and start it. Once TiVo is up again, FTP the saved kernel.img from your TiVo to your PC and then delete it from the TiVo (because it takes up a bunch of space.)

Don’t worry if you do not have a .profile and get an error. It is a way of having paths setup but if you did not use it and everything worked before the D update then it does not matter. This author did not have a .profile.

Repatching applications

Once your kernel and hacks have moved over, you will need to repatch your tivoapp application. Note your new version number and find the appropriate offset on the page Modify TiVoApp to disable encryption and add other features.

Force a phone call via the TiVo remote

If you don’t have the software update: You need a real phone line attached, and you should remove fakecall if it's loaded. At the end of the call the status should show "Pending Restart".


Automated Alternatives to a Manual Upgrade

The Slicer

The Slicer is a software scripting product from DVRupgrade.com that costs around $20. It automates the task of editing the TiVo software installation script, copying the existing hacked kernel to the new kernel partition, coping hacks to the new partition, and copying third-party network drivers to the new location.

To run the slicer, purchase it from DVRupgrade.com, unzip the file, any FTP it over to your TiVo in binary mode. FTP it into the /var directory, which is always writable. Next, telnet into your TiVo and check to see if you have a pending software upgrade by entering the following:

echo mls /SwSystem | tivosh

You should see a couple of files, one for the old version and one for the new version of software:

   Name                      Type        FsId      Date  Time   Size
   ----                      ----        ----      ----  ----   ----
   3.1.5e-01-2-357           tyDb         850  10/31/04 00:18    700
   3.1.5f-01-2-357           tyDb      648985  03/22/06 02:55    676
   ACTIVE                    tyDb         850  10/31/04 00:18    700

The above example shows that software version 3.1.5e is active (ACTIVE has FsId of 850, which is the same as 3.1.5e.) The other line should show a newer version (3.1.5f) of TiVo software.

  • If you don't have a new version of software waiting, stop, there is nothing you can do but wait for the new software to be downloaded. If you think you should have a new version of software and it is not there, you probably have fakecall.tcl running on your TiVo and that is preventing the download. Remove fakecall.tcl from your /etc/rc.d/rc.sysinit.author file (you need to make the file system writable to edit this file):
mount -o rw,remount / 
joe /etc/rc.d/rc.sysinit.author
  • If you do have a new software version, then run the slicer by switching to directory where slicer is located and running the following commands.

Maker the slicer file executable:

chmod 755 slicer

Run the slicer:

./slicer 3.1.5f-01-2-357

and substitute the newest version listed above for the 3.1.5f-01-2-357 shown in the example above.

See this page for more detailed instruction on running the slicer.