# Copy Drivers To Alternate Filesystem Partition



## rbautch (Feb 6, 2004)

This tool copies drivers from your alternate root filesystem partition to your current root filesystem. 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.

If it fails to mount your alternate root, it's likely your alternate root is not populated, as BTUx9 reported in this thread. If you are doing a slice upgrade, this tool is meant to be run after the upgrade, but before rebooting. Run it with the command:

```
bash#./copy_drivers
```
edit 3/8/07: Fixed the partition mixup phat_bastard noted below.


----------



## lew (Mar 12, 2002)

Why not also copy busybox/tivo-tools, rc.sysinit and rc.sysinit.author? After the reboot just run the enhancement script.


----------



## rbautch (Feb 6, 2004)

This was originally intended for people who ran the slicer and don't know how to copy their drivers. I didn't want to go down the path of trying to figure out where everyone's hacks are located. If you're doing a manual upgrade, then you should know where all your hacks are and how to copy them.


----------



## jporter12 (Mar 10, 2006)

After slicing to 6.2, and getting the networking going again, and superpatching, will the other enhancements from the zipper, or enhancement script still be working? If not, can the zipper be run on 6.2a? 

Sorry if I'm repeating this in another thread, I just found this one, and it seems more appropriate to ask the question....


----------



## phat_bastard (Mar 20, 2006)

I just tried this and it seems not to pick the correct alternate partition (pre-reboot). Looking in the shell script you have:


```
if [ $i == "root=/dev/hda4" ] ; then
	 export PART=4
	 export KERNEL=3
	 export ALTPART=7
	 export ALTKERNEL=6
  fi

  if [ $i == "root=/dev/hda7" ] ; then
	 export PART=7
	 export KERNEL=6
	 export ALTPART=4
	 export ALTKERNEL=3
  fi
```
but if you run this script after installSw.itcl and prior to rebooting the bootpage would already be flipped, so shouldn't it be more like:


```
if [ $i == "root=/dev/hda7" ] ; then
	 export PART=4
	 export KERNEL=3
	 export ALTPART=7
	 export ALTKERNEL=6
  fi

  if [ $i == "root=/dev/hda4" ] ; then
	 export PART=7
	 export KERNEL=6
	 export ALTPART=4
	 export ALTKERNEL=3
  fi
```
???

It just struck me as odd that it was trying to mount my current root (before reboot) on /install Not that this is all that complicated a task, but I'm trying to streamline this as much as possible for the 5 boxes I'm wanting to upgrade.


----------



## HellFish (Jan 28, 2007)

Phat,
I was thinking the same thing. If I follow Da Goon's instructions here, then it sounds like I would be mounted in the new partition pre-reboot, like you're saying. What happens if you follow Russ's advise and enter the following since you're in the new partition?

```
bash#./copy_drivers -r
```
 it seems like this should work under the circumstances of doing the upgrade manually via installSw.itcl, correct?


----------



## phat_bastard (Mar 20, 2006)

It still mounts your currently active partition (the one with 6.2 on it) on /install, which would in effect be copying the drivers back over themselves. If you break out of the script (CTRL+C) when it's asking if you want to proceed with the copy you can run mount and it will show you something like this:


```
family-dtivo-TiVo# mount
/dev/hda7 on / type ext2 (rw)
/dev/hda9 on /var type ext2 (rw)
/proc on /proc type proc (rw)
/dev/hda7 on /install type ext2 (rw)
family-dtivo-TiVo#
```
AFAIK the only way the script would work correctly as released is if you ran it prior to installSw.itcl, before bootpage gets flipped, but the alternate root won't be populated at that point. The only other way to make it work in this instance would be to look at the currently mounted root instead of looking at the bootpage.

I changed the two lines as mentioned above and used it on my other four Hughes boxes last night and they all came back up with USB 2.0 drivers and networking, so I'm happy.


----------



## Martin Tupper (Dec 18, 2003)

How does one check whether USB2.0 is set?


----------



## rbautch (Feb 6, 2004)

phat_bastard said:


> I just tried this and it seems not to pick the correct alternate partition (pre-reboot).


Sorry about that. It's fixed now.


----------



## rbautch (Feb 6, 2004)

Martin Tupper said:


> How does one check whether USB2.0 is set?


It relies on you for that. It blindly copies the drivers from one partition to the other.


----------



## Martin Tupper (Dec 18, 2003)

rbautch said:


> It relies on you for that. It blindly copies the drivers from one partition to the other.


In general, how can I confirm that the TiVo is using USB2.0? I had a little bit of trouble on one of my boxes and ended up slicing twice, so I'm not sure whether USB2.0 is still on either partition.


----------



## rbautch (Feb 6, 2004)

Martin Tupper said:


> In general, how can I confirm that the TiVo is using USB2.0? I had a little bit of trouble on one of my boxes and ended up slicing twice, so I'm not sure whether USB2.0 is still on either partition.


Look at the dates of the drivers in /lib/modules. If they're all the same, you have stock drivers.


----------



## Martin Tupper (Dec 18, 2003)

rbautch said:


> Look at the dates of the drivers in /lib/modules. If they're all the same, you have stock drivers.




```
-rw-r--r--    1 root     root        18736 Feb  9 20:47 af_packet.o
lrwxrwxrwx    1 root     root           21 Mar  8 04:08 ax8817x.o -> /lib/modules/usbnet.o
drwxr-xr-x    2 root     root         1024 Mar  8 04:08 backups-orig
-rw-r--r--    1 root     root         5992 Feb  9 20:47 bcm7315tty.o
-rw-r--r--    1 root     root      1181380 Feb  9 20:47 brcmdrv-7315.o
-rw-r--r--    1 root     root      1393628 Feb  9 20:47 brcmdrv-rb.o
-rw-r--r--    1 root     root        46748 Feb  9 20:47 cdrom.o
-rw-r--r--    1 root     root       123148 Feb  9 20:47 cobra.o
-rwx------    1 root     root       114987 Mar  8 04:08 drivers2.4.20.tgz
-rw-r--r--    1 root     root         4600 Feb  9 20:47 fan.o
-rw-r--r--    1 root     root         3140 Feb  9 20:47 fanstub.o
-rw-r--r--    1 root     root        47792 Feb  9 20:47 fat.o
-rw-r--r--    1 root     root         3984 Feb  9 20:47 fpga.o
-rw-r--r--    1 root     root        20588 Feb  9 20:47 i2c_Gen04.o
-rw-r--r--    1 root     root        20024 Feb  9 20:47 i2c_Series2.o
-rw-r--r--    1 root     root         8216 Feb  9 20:47 ideturbo.o
-rw-r--r--    1 root     root         6592 Feb  9 20:47 irblast.o
-rw-r--r--    1 root     root         8084 Feb  9 20:47 irblast_Gen04.o
-rw-r--r--    1 root     root        42756 Feb  9 20:47 ircatch-atmel.o
-rw-r--r--    1 root     root        36596 Feb  9 20:47 ircatch.o
-rw-r--r--    1 root     root        36532 Feb  9 20:47 ircatch_Gen04.o
-rw-r--r--    1 root     root        30532 Feb  9 20:47 isofs.o
-rw-r--r--    1 root     root        27040 Feb  9 20:47 kaweth.o
-rw-r--r--    1 root     root        35680 Feb  9 20:47 kfirm.o
-rw-r--r--    1 root     root        34648 Feb  9 20:47 kfirm_Gen04.o
-rw-r--r--    1 root     root         7764 Feb  9 20:47 modemtty_Gen04.o
-rw-r--r--    1 root     root         7784 Feb  9 20:47 modemtty_Series2.o
-rw-r--r--    1 root     root        10468 Feb  9 20:47 msdos.o
-rw-r--r--    1 root     root        28668 Feb  9 20:47 oslink.o
-rw-r--r--    1 root     root        15888 Feb  9 20:47 p80211.o
-rwxrwxrwx    1 15633    root        29528 Sep  7  2006 pegasus.o
-rw-r--r--    1 root     root        87208 Feb  9 20:47 prism2_usb.o
-rw-r--r--    1 root     root        17092 Feb  9 20:47 router.o
-rw-r--r--    1 root     root        15712 Feb  9 20:47 rtl8150.o
-rw-r--r--    1 root     root        96344 Feb  9 20:47 scsi_mod.o
-rw-r--r--    1 root     root        20992 Feb  9 20:47 sd_mod.o
-rw-r--r--    1 root     root        44740 Feb  9 20:47 sg.o
-rw-r--r--    1 root     root        11956 Feb  9 20:47 si9190.o
-rw-r--r--    1 root     root        24084 Feb  9 20:47 sr_mod.o
-rw-r--r--    1 root     root         3000 Feb  9 20:47 therm.o
-rw-r--r--    1 root     root         2920 Feb  9 20:47 tivo_pwmdrv.o
-rw-r--r--    1 root     root         2088 Feb  9 20:47 tivoconfig.o
-rw-r--r--    1 root     root        16464 Feb  9 20:47 tvinput.o
-rw-r--r--    1 root     root        25144 Feb  9 20:47 tvinput_Gen04.o
-rw-r--r--    1 root     root        17400 Feb  9 20:47 tvinput_falcon.o
-rw-r--r--    1 root     root         8572 Feb  9 20:47 ubuddy.o
-rwxrwxrwx    1 15633    root        35684 Sep  7  2006 usb-ohci.o
-rw-r--r--    1 root     root        44444 Feb  9 20:47 usb-storage.o
-rwxrwxrwx    1 15633    root       163078 Sep  7  2006 usbcore.o
-rwxrwxrwx    1 15633    root        43736 Sep  7  2006 usbnet.o
-rw-r--r--    1 root     root        18372 Feb  9 20:47 vfat.o
-rw-r--r--    1 root     root       189784 Feb  9 20:47 vnetusba.o
```
Looks like I'm good, but man transfers were s-l-o-w last night.


----------

