It is currently Tue Dec 12, 2017 11:38 pm


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Script -Remove JunOS Checkpic Protection For Olive Platforms
PostPosted: Thu Nov 25, 2010 9:03 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
[Edit: A new improved script is available at topic6557.html - RedNectar]

Hi,
This is based on Jeremy's HOWTO for Juniper, but makes your job more easy by eliminating that protection before copying the JunOS image on Qemu.
This version is using a different method which doesn't involve the binary /usr/bin/true, but just let /bin/sh to say "exit 0" :))
I make this script because is more better to have all your images ready for action without having to patch them all the time.
Works with any JunOS from 7 to 10. Is a little bit paranoid because by default goes four times deep in archive structures to replace that protected file "pkgtools.tgz",
but that's just more secure and for sure will definitively work.
I hope you'll find it useful ;)

Usage: ./Script original_junos_image.tgz
A new image will be created named original_junos_image-olive.tgz




Attachments:
junos-auto-unprotect-v0.2 (Linux&Win).zip [179.28 KiB]
Downloaded 1505 times


Last edited by tranzitwww on Sat Nov 27, 2010 7:52 pm, edited 2 times in total.
Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platforms
PostPosted: Fri Nov 26, 2010 6:25 am 
Offline

Joined: Mon Nov 10, 2008 10:31 am
Posts: 555
Location: Slovakia
Thanks!

_________________
Brezular

All my tutorials can be found here:
http://brezular.com


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platforms
PostPosted: Sat Nov 27, 2010 7:48 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
brezular wrote:
Thanks!

Thanks for using!

Well now works with windows to, and that was a little tricky :))


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platforms
PostPosted: Sat Nov 27, 2010 7:59 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Most of my problems when developping GNS3 come from Windows ... ;) hehe

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platforms
PostPosted: Sat Nov 27, 2010 8:01 pm 
Offline

Joined: Thu Jun 24, 2010 3:58 pm
Posts: 411
Location: [email protected]
grossmj wrote:
Most of my problems when developping GNS3 come from Windows ... ;) hehe


Nice to see you!


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platf
PostPosted: Fri Apr 05, 2013 9:09 am 
Offline

Joined: Fri Mar 05, 2010 11:33 am
Posts: 1494
Location: Australia
@tranzitwww Can I make a few suggestions?
1. In the Windows batch file either remove the
PAUSE >NUL
command at the end of the process, or (if it is necessary for some reason) add the words "Press any key to exit" after the message
============= Start Time: 16:36:23.10 - End Time: 16:38:21.16 =============

2. I couldn't get the linux script to run (on Linux Mint) until I changed the hashbang tag to #!/bin/bash (see my update to post19441.html#p19441). However, the script kind runs fine on OS X (the md5sum and sha1sum commands failed - looking to see how to replace these with "md5 -r" and "openssl sha1" commands ). Is there a way to make this script truly cross-platform?

3. In the Readme.txt, add the following Usage details:
Usage: ./Script original_junos_image.tgz
A new image will be created named original_junos_image-olive.tgz

Note: In my case, the new image wasn't quite of the form original_junos_image-olive.tgz I started with
jinstall-9.6R1.13-domestic-signed.tgz
and finished with:
jinstall-9.6R1.13-domestic-olive.tgz

I lost the word "signed" from my filename - which is OK, but if this is the way it works, the usage summary should read:
Usage: ./Script original_junos_image-signed.tgz
A new image will be created named original_junos_image-olive.tgz

4. Naming. A filename like "unprotect" may scare some users (who have been made paranoid by Microsoft's "You computer may be unprotected" messages).

Can I suggest that:
a) The script be called: junos-auto-patch-pkgtools-v0.x.sh/bat (or even junos-auto-patch-checkpic-v0.x.sh/bat)
b) The download zip file be called junos-auto-patch-pkgtools.zip (without a version number in the name, so that if anyone links to the source file they will get the latest version)
c) The folders inside the package be called Windows and Linux-OSX rather than Windows and Linux - so long as the hashbang tag and md5/sha1 things are sorted. Otherwise there may have to be Windows, sh, and bash folders

5. Change request :)
What would be really cool is if you could actually make the final output a .iso rather than simply a .tgz. Then you could simply boot up your VM with:
qemu -m 1G -hda olive-base.img -cdrom jinstall-9.6R1.13-domestic-olive.iso
Then just do
Code:
mount /cdrom
pkg_add -f /cdrom/jinstall-9.6R1.13-domestic-olive.tgz

Done and dusted. No fiddling about with scp etc!!

Get the idea? just make the .tgz int a .iso and it MUCH easier to get it into your image - simply by attaching it as a CDROM drive when you boot.

This modification could easily be done by adding this line to the end of the script (something like):
mkisofs -joliet-long –o '${A_FILE[1]}'.iso '${A_FILE[1]}'

Of course I'm sure you could work out a way of making the output file be more like:
jinstall-9.6R1.13-domestic-olive.iso
rather than my clumsy
jinstall-9.6R1.13-domestic-olive.tgz.iso

Not sure how you get mkisofs to work on Windows though, so that might be a challenge.


@Jeremy - is there a way that the [b[junos-auto-whatever[/b] script could be put in the http://www.gns3.net/download/ page?

And while we're at it, why not put up a copy of a Qemu FreeBSD 4.11 image on the http://www.gns3.net/download/ page? (such as olive-base.img as you have at the end of http://blog.gns3.net/2009/10/olive-juniper/3/)
This is after all simply a copy of FreeBSD in Qemu image format - no reason why it could be run as such anyway. But would make it a lot easier for folk trying to get JunOS working.

_________________
RedNectar
http://rednectar.net
@rednectarchris
GNS3 WorkBench-a VMware image of Ubuntu with GNS3 and VPCS installed and a collection of exercises/labs


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platf
PostPosted: Tue Apr 09, 2013 11:26 pm 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
Quote:
@Jeremy - is there a way that the [b[junos-auto-whatever[/b] script could be put in the http://www.gns3.net/download/ page?

And while we're at it, why not put up a copy of a Qemu FreeBSD 4.11 image on the http://www.gns3.net/download/ page? (such as olive-base.img as you have at the end of http://blog.gns3.net/2009/10/olive-juniper/3/)
This is after all simply a copy of FreeBSD in Qemu image format - no reason why it could be run as such anyway. But would make it a lot easier for folk trying to get JunOS working.


I will in the following weeks. I'll be back to full active service by the end of this month ;)

Cheers!

_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
 Post subject: Re: Script -Remove JunOS Checkpic Protection For Olive Platf
PostPosted: Thu Apr 11, 2013 12:12 am 
Offline
Site Admin

Joined: Sat Oct 11, 2008 1:41 pm
Posts: 2668
Location: Canada
I've uploaded a Qemu FreeBSD 4.11 image on the http://www.gns3.net/appliances/ page

Cheers,



_________________
Jeremy, GNS3 Programmer & Benevolent Dictator for Life.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO