Unoffical empeg BBS

Quick Links: Empeg FAQ | Software | RioCar.Org | Hijack | jEmplode | emphatic
Repairs: Repairs | Addons: Eutronix | Cases

Page 2 of 2 < 1 2
Topic Options
#371795 - 16/03/2019 16:27 Re: Rooting a Uverse NVG589 Gateway [Re: mlord]
maczrool
pooh-bah

Registered: 13/01/2002
Posts: 1646
Loc: Louisiana, USA
Originally Posted By: mlord
Here is a more fully commented version of the above:
Code:
modprobe usb-storage        ## Ensure the driver for the USB-stick is loaded
mkdir /tmp/usb              ## Create a directory for use as a mount-point
mount /dev/sda1 /tmp/usb    ## Mount/attach the USB-stick at /tmp/usb
mount mtd:mfg -t jffs2 /mfg ## Mount the manufacturing partition at /mfg
cp /mfg/mfg.dat /tmp/usb/   ## Copy mfg.dat to the USB-stick
umount /mfg                 ## Unmount/detach the manufacturing partition
umount /tmp/usb             ## Unmount/detach the USB-stick
sync                        ## Ensure data is written to the USB-stick before removal



Wow this is awesome! Thanks for the comments. That really helps understand what all this is supposed to do. I'm getting an error "Invalid argument' at the mount /dev/sda1 /tmp/usb

# modprobe usb-storage
# mkdir /tmp/usb
mkdir: can't create directory '/tmp/usb': File exists
# mount /dev/sda1 /tmp/usb
mount: mounting /dev/sda1 on /tmp/usb failed: Invalid argument
#
_________________________
If you want it to break, buy Sony!

Top
#371796 - 16/03/2019 17:13 Re: Rooting a Uverse NVG589 Gateway [Re: maczrool]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14002
Loc: Canada
Ahh.. Okay. It is possible that there is already a file called /tmp/usb on that system. Verify this as follows:

ls -l /tmp/usb

In which case we can just use a different name for our temporary mount point. Let's call it "fred" instead:
Code:
modprobe usb-storage        ## Ensure the driver for the USB-stick is loaded
mkdir /tmp/fred             ## Create a directory for use as a mount-point
mount /dev/sda1 /tmp/fred   ## Mount/attach the USB-stick at /tmp/fred
mount mtd:mfg -t jffs2 /mfg ## Mount the manufacturing partition at /mfg
cp /mfg/mfg.dat /tmp/fred/  ## Copy mfg.dat to the USB-stick. Note trailing slash.
umount /mfg                 ## Unmount/detach the manufacturing partition
umount /tmp/fred            ## Unmount/detach the USB-stick
sync                        ## Ensure data is written to the USB-stick before removal

Any different?

Also, note that the purpose of the trailing slash on the "cp" line is to ensure that the copy fails if /tmp/fred is not present or is not a directory. Without that slash, the copy might appear to succeed, but could simply be creating a copy into a file called "fred", rather than what we intended.


Edited by mlord (16/03/2019 17:22)

Top
#371797 - 16/03/2019 18:00 Re: Rooting a Uverse NVG589 Gateway [Re: mlord]
maczrool
pooh-bah

Registered: 13/01/2002
Posts: 1646
Loc: Louisiana, USA
Originally Posted By: mlord
Ahh.. Okay. It is possible that there is already a file called /tmp/usb on that system. Verify this as follows:

ls -l /tmp/usb



Thank you Mark! It just reported the file already existed because I had run the commands earlier and got the invalid argument error. I ran them again to see if it would work (still got the invalid argument error anyway) then copied that and posted. Once I restart the gateway the /tmp/usb goes away. So anyway, I'm still not able to proceed due to the invalid argument error.

# ls -l /tmp/usb
ls: /tmp/usb: No such file or directory
# modprobe usb-storage
# mkdir /tmp/usb
# mount /dev/sda1 /tmp/usb
mount: mounting /dev/sda1 on /tmp/usb failed: Invalid argument
#
_________________________
If you want it to break, buy Sony!

Top
#371798 - 16/03/2019 18:33 Re: Rooting a Uverse NVG589 Gateway [Re: maczrool]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14002
Loc: Canada
Okay, perhaps the version of "mount" used on that machine is dumber than usual. In which case, ensure the USB-stick uses FAT filesystem rather than EXFAT or NTFS, and then do this:

mount /dev/sda1 -t vfat /tmp/usb

Alternatively, you can probably re-format the USB-stick from the modem itself, before doing the above mount command:

mkfs.vfat /dev/sda1

Notes: There are dozens of different "filesystem types" that can be used with Linux. On a full blown PC distro, the mount command will normally automatically figure out which type a given USB-stick has been formatted with. But on an embedded device like a modem (or an empeg), fancy smarts like that are often omitted to make things smaller. And the range of supported filesystem types is also often limited to just a few. vfat (the Win98 filesystem) is pretty much universally supported though.

Top
#371799 - 16/03/2019 23:41 Re: Rooting a Uverse NVG589 Gateway [Re: mlord]
maczrool
pooh-bah

Registered: 13/01/2002
Posts: 1646
Loc: Louisiana, USA
That seemed to work! I have an mfg file on the USB drive. I also need to extract the .der files located at: /etc/rootcert/*.der

Then that should be it!

How would I modify the earlier code to make that work? I tried modifying your commands but didn't get anywhere. It's got more folders to it so it's a bit confusing. This is what I intended to try, but it failed at mounting etc/rootcert due to no such file or directory. Hopefully something obvious I'm doing incorrectly!

Code:
modprobe usb-storage                                           
mkdir /tmp/usb                                                  
mount /dev/sda1 /tmp/usb                                        
mount mtd:/etc/rootcert/ -t jffs2 /etc/rootcert/             
cp /etc/rootcert/*.der /tmp/usb/                                
umount /etc/rootcert/                                           
umount /tmp/usb                                                 
sync                                                      



Edited by maczrool (16/03/2019 23:42)
_________________________
If you want it to break, buy Sony!

Top
#371800 - 17/03/2019 02:19 Re: Rooting a Uverse NVG589 Gateway [Re: maczrool]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14002
Loc: Canada
The /etc directory is normally always there. No need to mount it.
Check to see if the files you want are already there first:

ls -l /etc/rootcert/*.der

"ls" is the "list files" command, like "dir" on MS-DOS. The "-l" asks it to produce "long" (detailed) output.

If you see a bunch of .der files there, then copy them to the USB-stick similar to before, just omitting the "mount" and "umount" for /etc/..

Top
#371801 - 17/03/2019 02:21 Re: Rooting a Uverse NVG589 Gateway [Re: maczrool]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14002
Loc: Canada
Code:
modprobe usb-storage     ## This is only needed once after each reboot                                          
mkdir -p /tmp/usb        ## The -p tells mkdir not to complain if /tmp/usb already exists                                         
mount /dev/sda1 /tmp/usb                                        
cp -v /etc/rootcert/*.der /tmp/usb/   ## The -v means "verbose", showing exactly what gets copied                     
umount /tmp/usb                                                 
sync

Top
#371802 - 17/03/2019 12:14 Re: Rooting a Uverse NVG589 Gateway [Re: mlord]
maczrool
pooh-bah

Registered: 13/01/2002
Posts: 1646
Loc: Louisiana, USA
Quote:
Alternatively, you can probably re-format the USB-stick from the modem itself, before doing the above mount command:

mkfs.vfat /dev/sda1

Notes: There are dozens of different "filesystem types" that can be used with Linux. On a full blown PC distro, the mount command will normally automatically figure out which type a given USB-stick has been formatted with. But on an embedded device like a modem (or an empeg), fancy smarts like that are often omitted to make things smaller. And the range of supported filesystem types is also often limited to just a few. vfat (the Win98 filesystem) is pretty much universally supported though.
The gateway doesn't support the mkfs command either, so I did it in the Windows command line since the only two options in Win10 are NTFS and EXFAT.
_________________________
If you want it to break, buy Sony!

Top
#371803 - 17/03/2019 12:24 Re: Rooting a Uverse NVG589 Gateway [Re: mlord]
maczrool
pooh-bah

Registered: 13/01/2002
Posts: 1646
Loc: Louisiana, USA
Originally Posted By: mlord
Code:
modprobe usb-storage     ## This is only needed once after each reboot                                          
mkdir -p /tmp/usb        ## The -p tells mkdir not to complain if /tmp/usb already exists                                         
mount /dev/sda1 /tmp/usb                                        
cp -v /etc/rootcert/*.der /tmp/usb/   ## The -v means "verbose", showing exactly what gets copied                     
umount /tmp/usb                                                 
sync


I think I got them all with that. I didn't get anything verbose during the process, but when I opened the USB drive the files were there! Not sure how I can thank you enough. I don't imagine this is the sort of thing I would have be able to piece together myself with such limited knowledge of Linux commands and errors. If there's something you might need in the future please let me know!

Now I need to go obtain an ER-4 to load the cert file onto (using a tool that combines the .der and mfg.dat files). I think setup on that is generally better documented then this backdoor bypass procedure so I should be okay there.

Thanks again and happy St. Patrick's Day!
Stu


Attachments
NVG589.JPG


_________________________
If you want it to break, buy Sony!

Top
Page 2 of 2 < 1 2