Archive for the ‘fun-projects’ Category

Restoring a wordpress site by scraping/crawling google

Sunday, January 13th, 2013

I love challenges, but once in a while the tend to be way tooo big! During my christmasholidays I accidently wiped my home server. I wanted to do some LVM stuff online, remotely, without console access, through the ESXi console. … and really thought that nothing could go wrong ;-). First assumption being wrong.

To make a long history short. I shot myself in the foot and was without a server for a 3-4 days. When I got home again, I thought a simple reboot and some LVM magic would make everything all right. Second assumption being wrong.

So in the very end I had to reinstall my server from scratch. Luckily I backup my stuff using and so should you! It will save your butt some time!

It turned out that, for some bizaro reason, my database had not been dumped to csv files. So in the end I came to these conclusions:

  • I lost my database.
  • I thus lost my wordpress blog.

ūüôĀ

But loving challenges I refused to let that be the end. I thought about using archive.org, but they did not really have a new crawl of my site.

I decided to crawl google! Not as easy as it might sound for a couple of reasons:

  • Google does not like being crawled …. at all. If googles infinite number of computers discover that you are crawling them, then your IP will be blocked from seeing their cached content.
  • When you enter keywords into google you normally get thousans of links to follow. I needed one. The correct one! The one that was a cached version of my site.

So I fired up my editor and utilized the great WWW::Mechanize. I ended up with this script, which do all the hard work of scraping google. It will take some time to complete — hours and days even! It will get there though. If you try to speed things up it will take longer as you will be blocked by google when they detect you are scraping them. Be warned. Been there. Tried that. Got blocked.

Having retrieved all of my old site through google I had to parse these pages and import them into wordpress. So again I fired up my editor and wrote this little script. For this to work, you have to have

    • a clean wordpress installation with a hello world post
    • XMLRPC writing enabled in WordPress, as the script uses WordPress::XMLRPC.
    • the following in wp-config.php
      define( ‘AUTOSAVE_INTERVAL’,¬†¬†¬† 3600 );¬†¬†¬†¬† // autosave 1x per hour
      define( ‘WP_POST_REVISIONS’,¬†¬†¬† false );¬†¬†¬† // no revisions
      define( ‘DISABLE_WP_CRON’,¬†¬†¬†¬†¬† true );
      define( ‘EMPTY_TRASH_DAYS’,¬†¬†¬†¬† 7 );¬†¬†¬†¬†¬†¬†¬† // one week

So in the end what did I loose and what did I learn? I lost my comments on my site. Or more preciesely: I have them,but I will postpone putting them back in until I get the time to fool around with coding again. And I learnt a lot about tripplechecking my backup for all their pieces before doing storage related work remotely without a proper console!

Installing OS-X on ESXi 5.0.0, 469512 running on an AMD Fusion APU

Monday, August 13th, 2012

I wanted to run OS-X at home, preferrably on my AMD Fusion based ESXi 5.0.0, 469512 host. If you search the net for that combination you will find a lot of posts about people having issues and not many about people having a great success. Digging into this it turned out to be relatively simple to do.

  1. Obtain OS-X Snow leopard ISO image
  2. Obtain Donks OS-X unlocker for vmware. I used unlock-all-v110.zip
  3. Backup you ESXi host and VMs before doing anything! I am not liable in any way for any issues you encounter! It worked for me. Your millage may vary and that is actually your problem ;-)
  4. Patch ESXi with Donks unlocker by unzipping the zip file on the ESXi host and running esxi/install.sh. Make sure to read the readme file beforehand and make sure that all the prereqs are in place before you start!
  5. Reboot your ESXi host and hope for the best.
  6. After a successful reboot of ESXi with Donks patches, create a new OS-X based VM. 64-bit, 4GB memory, 1 processor (and one processor only, otherwise you will get panics during installation), LSI Logic Parallel SCSI, E1000 network
  7. Do NOT power up the VM.
  8. Enter the ESXi cli.
  9. Browse to the location of the VM on the ESXi datastore
  10. type vi *.vmx <enter>
  11. remove all references to CPUID
  12. insert the following CPUID information (this will make ESXi present the VM as a core2duo based machine to the guest allowing OS-X to boot on the hardware)
    hostCPUID.0 = "0000000668747541444d416369746e65"
    hostCPUID.1 = "00500f100002080000802209178bfbff"
    hostCPUID.80000001 = "00500f1000001242000035ff2fd3fbff"
    guestCPUID.0 = "00000006756e65476c65746e49656e69"
    guestCPUID.1 = "000006f10000080080802209078bfbff"
    guestCPUID.80000001 = "00500f1000001242000003e92bd3fbff"
    userCPUID.0 = "0000000668747541444d416369746e65"
    userCPUID.1 = "00500f100002080080802209078bfbff"
    userCPUID.80000001 = "00500f1000001242000003e92bd3fbff"
    cpuid.0.ebx="0111:0101:0110:1110:0110:0101:0100:0111"
    cpuid.0.edx="0100:1001:0110:0101:0110:1110:0110:1001"
    cpuid.0.ecx="0110:1100:0110:0101:0111:0100:0110:1110"
    cpuid.1.eax="0000:0000:0000:0000:0000:0110:1111:0001"
  13. Save the vmx file
  14. Attach the Snow Leopard ISO to the VM and boot it.
  15. Perform a normal OS-X installation.

Nothing much actually. The final solution

And seen from vnc

 

 

Quite simple …. as promised :-)

Version 2 of small perl mechanize script to send sms from danish telco provider Bibob

Thursday, July 26th, 2012

A year ago I wrote a small perl Mechanize script to send sms from the command line (very useful for scripts) utilizing the web-sms service you get as a Bibob customer.

Now a year later I actually found some use for it, but it didn’t work anymore due to the fact that Bibob had changed their website since then. And not just the graphics and layout, but the whole shebang.

I have made some very small changes to the perl script to make it work again and I appriciate the versatility of perl and that the Bibob webmasters obviously thought a great deal about the upgrade.

The new code can be downloaded here, hbut is also included verbatim in this post

#!/usr/bin/perl -w

##############################################################################
#
# File:         bibob_sms.pl
# Type:         bot
# Description:  Send an SMS using bibob websms and perl mechanize
# Language:     Perl
# Version:      2.0
# License:      BeerWare – Thomas S. Iversen wrote this file. As long as you
#               retain this notice you can do whatever you want with this
#               stuff. If we meet some day, and you think this stuff is worth
#               it, you can buy me a beer in return. Thomas
# History:
#               2.0 – 2011.07.26 – New version due to total bibob.dk relayout
#               1.0 – 2011.07.28 – Intial version
#
# (C) 2011,2012 Thomas S. Iversen (zensonic@zensonic.dk)
#
##############################################################################

use strict;
use WWW::Mechanize;
use File::Basename;

# Variables controlling bot behaviour

my $sms_url=‘https://www.bibob.dk/min-konto/web-sms’;
my $login_url=‘https://www.bibob.dk/’;

my $script=basename($0);
die "$script <bibob mobile number> <bibob password> <recipeient number> <message>" if(!($#ARGV+1 == 4));

my $username=$ARGV[0];
my $password=$ARGV[1];
my $recipients=$ARGV[2];
my $message=$ARGV[3];

#
# You should not need to alter anything below this line
#

#
# Main code.
#

# Create mechanize instance
my $mech = WWW::Mechanize->new( autocheck => 1 ); #Create new browser object
$mech->agent_alias( ‘Windows IE 6′ ); #Create fake headers just in case
$mech->add_header( ‘Accept’ => ‘text/xml,application/xml,application/xhtml\+xml,text/html,text/plain,image/png’ );
$mech->add_header( ‘Accept-Language’ => ‘en-us,en’ );
$mech->add_header( ‘Accept-Charset’ => ‘ISO-8859-1,utf-8′ );
$mech->add_header( ‘Accept-Language’ => ‘en-us,en’ );
$mech->add_header( ‘Keep-Alive’ => ’300′ );
$mech->add_header( ‘Connection’ => ‘keep-alive’ );

# Get login page
$mech->get($login_url);
$mech->success or die "Can’t get the login page";

# Submit the login form with username (mobilnumber) and password
$mech->submit_form(with_fields => { ‘phoneNumber’ => $username, ‘password’ => $password });
$mech->success or die "Could not login";

# Get sms page
$mech->get($sms_url);
$mech->success or die "Could not get sms page";

# Send sms by submitting sms form
$mech->submit_form(with_fields => { ‘recipients’ => $recipients, ‘message’ => $message });
$mech->success or die "Could not send sms";

# Figure out status
my $html = $mech->content();
die "Form submitted, but message does not appear to be sent" if(!$html=~/Beskeden blev afsendt/ig);
exit 0;

Changing boot order in BIOS on IBM xSeries servers without RSAII (using ASU)

Wednesday, April 25th, 2012

Today I faced challenge where I had to reinstall some IBM xSeries servers in a datacenter far far away using PXE boot. These servers did not have an RSA/RSAII card, but that is really not a problem using PXE. I prepared the kickstart on the first of the servers and did some reinstalls to get it right. And then I issued an ipmi command to reboot the rest of the servers. … and then nothing happened. Well the rest of the servers rebooted back into the old OS instance. It was ofcourse an issue with the boot order in the BIOS on the servers.

Now what? Either drive to the DC or call someone there to get it fixed. …. or use the IBM ASU tool to change the BIOS settings from within an OS instance. It is quite a useful tool

Without further ado

[root@biomd1 ~]# /opt/ibm/toolscenter/asu/asu show | grep Boot
CMOS_AlternateBootDevice4=Hard Disk 0
CMOS_AlternateBootDevice3=CD ROM
CMOS_AlternateBootDevice2=Diskette Drive 0
CMOS_AlternateBootDevice1=Network
CMOS_PrimaryBootDevice4=Network
CMOS_PrimaryBootDevice3=Hard Disk 0
CMOS_PrimaryBootDevice2=Diskette Drive 0
CMOS_PrimaryBootDevice1=CD ROM
CMOS_PostBootFailRequired=Enabled
CMOS_PCIBootPriority=Planar SAS
CMOS_RemoteConsoleBootEnable=Disabled

[root@biomd1 ~]# /opt/ibm/toolscenter/asu/asu set CMOS_PrimaryBootDevice4 “Hard Disk 0″
IBM Advanced Settings Utility version 3.60.69K
Licensed Materials – Property of IBM
(C) Copyright IBM Corp. 2007-2010 All Rights Reserved
CMOS_PrimaryBootDevice4=Hard Disk 0
[root@biomd1 ~]# /opt/ibm/toolscenter/asu/asu set CMOS_PrimaryBootDevice3 “Network”
IBM Advanced Settings Utility version 3.60.69K
Licensed Materials – Property of IBM
(C) Copyright IBM Corp. 2007-2010 All Rights Reserved
CMOS_PrimaryBootDevice3=Network

[root@biomd1 ~]# /opt/ibm/toolscenter/asu/asu show | grep Boot
CMOS_AlternateBootDevice4=Hard Disk 0
CMOS_AlternateBootDevice3=CD ROM
CMOS_AlternateBootDevice2=Diskette Drive 0
CMOS_AlternateBootDevice1=Network
CMOS_PrimaryBootDevice4=Hard Disk 0
CMOS_PrimaryBootDevice3=Network
CMOS_PrimaryBootDevice2=Diskette Drive 0
CMOS_PrimaryBootDevice1=CD ROM
CMOS_PostBootFailRequired=Enabled
CMOS_PCIBootPriority=Planar SAS
CMOS_RemoteConsoleBootEnable=Disabled

Nifty, right?

 

From x61s to x60s

Sunday, January 22nd, 2012

Well. Once more I picked up some old equipment at work. This time an x60s. I have recently gotten my hand on a x61s. The x61s is a wonderful machine by most standards, especially as I bought a large 8-cell battery and a 64GB SSD for it. One major disadvantage however, is the fan and power usage: Even ad idle, light websurfing it is so hot that the fan has to spin so fast that it is annoying to listen to.

The switch from x61s to x60s took around 60 seconds: unscrew the screw holding the harddrive into place. Swap the drive. Do the same with the battery. And power on. Ubuntu 11.10 booted just fine. No errors whatsoever. But then again. I had forseen this might happen, so I was already running an 32-bit version of ubuntu 11.10. Had I run an x86_64 version I wouldn’t have been that lucky as the cpu in my x60s is on 32-bit.

So to sum up: The x60s is a  teeny weeny bit slower than the x60s, but has marginally better power-envelope, but most importantly is quite a bit more silent to use! I will recommend the x60s over the x61s for the noise alone.

Using the E3000 as a caching DNS server (on dd-wrt)

Saturday, December 31st, 2011

Due to popular demand I’ll post this on how to use the E3000 as a generic DNS server. I’t will be very brief, you have to fill in the blanks yourself.

First you have to get the support tools in place for this. dd-wrt is build for smallish setups as well, so some of the tools are quite limited to say the least. There are basically two routes:

  • Fiddle with the internal flash so that you can use the built-in ipkg on a jffs2 mounted flashdrive
  • Mount an USB stick, download ipkg-opt and work from there

I choose the latter. Primarily due to the fact that, that option gave me 4GB of space in /opt. It is actually quite simple

dd-wrt usb flash

dd-wrt usb flash

You then install ipkg-opt and companion tools (uclib-opt). You can use this wiki post on the dd-wrt wiki.

After that you can install all your extensions through ipkg-opt (or download them by hand). For my DNS resolver needs I choose the wonderful dnsmasq software. It acts as DNS/DHCP and TFTP software. From my router

root@dd-wrt:/opt/sbin# ipkg-opt list | grep -i dnsmasq
dnsmasq – 2.58-1 – DNS and DHCP server

The observant reader noticed that dd-wrt calls /opt/etc/config/startup in the screenshot abov (after having mounted /opt). This script is the startup script of all your /opt related stuff. I went with something like

#!/bin/sh

unset LD_LIBRARY_PATH
unset LD_PRELOAD

[ -e /opt/etc/profile ] && mount -o bind /opt/etc/profile /etc/profile

grep nobody /etc/passwd > /dev/null
if [ $? -ne 0 ]; then
echo “nobody:*:65534:65534:nobody:/var:/bin/false” >> /etc/passwd
fi

if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
done
fi

and have a

root@dd-wrt:/opt/sbin# ls -al /opt/etc/init.d/S56dnsmasq
-rwxr-xr-x    1 root     root          215 Jan  1  1970 /opt/etc/init.d/S56dnsmasq
root@dd-wrt:/opt/sbin# cat /opt/etc/init.d/S56dnsmasq
#!/bin/sh

unset LD_LIBRARY_PATH
unset LD_PRELOAD

if [ -f /var/run/dnsmasq.pid ] ; then
kill `cat /var/run/dnsmasq.pid`
fi

rm -f /var/run/dnsmasq.pid

sleep 2
/opt/sbin/dnsmasq –conf-file=/opt/etc/dnsmasq.conf

Finally we are getting there. Before showing the dnsmasq.conf file, I will show a screenshot of the setup on the dd-wrt gui in order to use dnsmasq as DNS and DHCP server:

dnsmasq setup in dd-wrt

dnsmasq setup in dd-wrt

Notice how the built-in dhcp server is disabled and how I have choosen to use dnsmasq. Now onto the configuration of dnsmasq.conf:

root@dd-wrt:/opt/sbin# grep -v “^#”¬† /opt/etc/dnsmasq.conf¬† | grep -v “^$”
tftp-no-blocksize
log-dhcp
interface=br0
resolv-file=/tmp/resolv.conf
domain=zensonic.dk
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=50
dhcp-authoritative
dhcp-range=lan,192.168.1.100,192.168.1.143,255.255.255.0,1440m
stop-dns-rebind
dhcp-host=00:22:FB:BB:C8:E0,kitchen,192.168.1.116,infinite
dhcp-host=00:18:71:E3:22:4d,dl145-1,192.168.1.117,infinite
dhcp-host=00:14:38:bf:a9:16,dl380g4i,192.168.1.119,infinite
dhcp-host=00:14:38:bf:a9:19,dl380g4,192.168.1.121,infinite
enable-tftp
tftp-root=/opt/var/tftproot
dhcp-boot=pxelinux.0

You will immediately notice a couple of things. Notice how I have the range setup for dhcp leases. Notice also how I have static leases. And finally notice how I have tftp enabled. Another blogpost on tftp another time (quite nifty for setting up servers on my vmware backend in minutes using kickstart, yast2 and solaris jumpstart).

You might think: where are the zone records? The answer can be found from the man page for dnsmasq

Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts.

So I simply add my infrastructure to /etc/hosts and run /opt/etc/init.d/S56dnsmasq.

I only had the need for running DNS locally, so my choice was dnsmasq. You can also install a full fledged bind if you have that desire

root@dd-wrt:/opt/sbin# ipkg-opt list bind
bind Р9.6.1.3-4 РBind provides a full name server package, including zone masters, slaves, zone transfers, security multiple views.  This is THE

Brute force password cracking of ATA security locked harddrives

Monday, November 28th, 2011

Recently I found a x41 thinkpad in good condition, but with a locked 1.8″¬†drive. I google a bit and found that there is almost no chance of buying a new 1.8″ drive. So now what? I could mod the machine with SSD like this guy has done. Or I could try to crack the password of the 1.8″ drive. I’ll try the latter before I give in an mod the machine.

So how do I crack the password of a 1.8″ drive. You can buy all kinds of stuff of the internet. And lo and behold. Someone claims to be able to give you the master password if you give them some stash.

Instead of handing out my money to strangers on the internet, I read the ATA specs and tried to do it like this:

  • Realize that the drive is in maximum security mode. So you have to cycle the drive power for every X failed tries with the user password. Go for a security erase of the drive with the master password instead. Might be a harder password, but atleast I can try unlimited amount of times without the drive demanding a power cycle.

So I ended up like this

  • Download ubuntu 10.04. Create bootable usb pen.
  • pull out the drive of the x41
  • Boot the x41 of the usb pen
  • put the drive back into the x41 while ubuntu boots.
  • issue ‘echo “- – -”¬† >¬† /sys/class/scsi_host/host0/scan
  • download john the ripper from openwall together with a dictionary.
  • compile john the ripper.
  • Figure out details of the drive with hdparm -I /dev/sda
  • Execute this command: ./john –wordlist=./all –stdout | while read pass ; do hdparm –security-erase “$pass”¬† /dev/sda ; if [ $? -ne 5 ]; then exit 1; fi ; done > /dev/null 2>&1

Presently I brute force attack the drive with 1000 words pr. second. Might not yield anything. But atleast I tried ;-)

 

Using an Linksys E3000 AP as a general linux server

Wednesday, September 21st, 2011

Recently I said farwell and thanks for all the fish to my old Linksys WRT54G router(s). They served me well for many years, but end the end they lacked IEEE 802.11n and 1000BASE-T. After looking around I decided to buy the Linksys E3000 AP. It stayed within my budget, had almost all features I desired and could also run community based firmware.

I tried to run with the built in firmware. And I did. For a month or so. And then I gave in and installed dd-wrt on the thing. The built-in firmware works and is stable. But boy it lacks features!

Getting dd-wrt onto my AP was easy due to this tutorial. After I got dd-wrt onto the AP I had myself a full blown linux distribution. Comparing the E3000 with its 240MHz MIPS cpu and 64MB memory to my first PC with its 66MHz intel 80486 with 4MB memory made me smile ;-)

root@dd-wrt:~# cat /proc/cpuinfo
system type             : Broadcom BCM4716 chip rev 1
processor               : 0
cpu model               : MIPS 74K V4.0
BogoMIPS                : 239.20
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 64
extra interrupt vector  : no
hardware watchpoint     : yes
ASEs implemented        : mips16 dsp
shadow register sets    : 1
VCED exceptions         : not available
VCEI exceptions         : not available

Having such a small nifty general purpose platform at my disposal ofcourse made me think what I should use it for (besides moving bytes around in my house). I found these things I want to and/or have implemented on it:

  • Local DNS server. I have many many projects brewing all the time and have vast amount of hardware. I utilize a DNS server to keep track of my ip assignments, either static or through DHCP. Running a DNS server on the router is a must.
  • PXEBOOT server.
  • TFTP server.
  • NFS server
  • DansGuardian filter

Small perl mechanize script to send sms from danish telco provider Bibob

Thursday, July 28th, 2011

It can be handy to send sms’es from scripts. In old time you could do that in Telia by sending a mail to <mobile number>@gsm1800.telia.dk. But that service was closed. Now that I am leaving Telia in favor of Bibob I saw that they had a websms service.

And so I combined their fine web service with my perl scripting skillz. The script can be downloaded here

Do not forget the agreement between you and bibob. You are only allowed to use the websms service (and thus this script) for personal use. I am not to blame if bibob closes your bibob account because you spam-smsed a lot of people.

The code is also included here:

 

#!/usr/bin/perl -w

#####################################################################
#
# File:         bibob_sms.pl
# Type:         bot
# Description:  Send an SMS using bibob websms and perl mechanize
# Language:     Perl
# Version:      1.0
# License:      BeerWare РThomas S. Iversen wrote this file.
#               As long as you retain this notice you can
#               do whatever you want with this stuff.
#               If we meet some day, and you think this stuff is
#               worth it, you can buy me a beer in return. Thomas
#
# History:
#               1.0 Р2011.07.28 РIntial version
#
# (C) 2011 Thomas S. Iversen (zensonic@zensonic.dk)
#
#####################################################################

use strict;
use WWW::Mechanize;
use File::Basename;

# Variables controlling bot behaviour

my $sms_url=‘https://www.bibob.dk/bibob/bibob?cmd=websmssender’;
my $login_url=‘https://www.bibob.dk/bibob/bibob?cmd=loginFrame’;

my $script=basename($0);
die "$script <bibob mobile number> <bibob password> <recipeient number> <message>" if(!($#ARGV+1 == 4));

my $username=$ARGV[0];
my $password=$ARGV[1];
my $recipients=$ARGV[2];
my $message=$ARGV[3];

#
# You should not need to alter anything below this line
#

#
# Main code.
#

# Create mechanize instance
my $mech = WWW::Mechanize->new( autocheck => 1 ); #Create new browser object
$mech->agent_alias( ‘Windows IE 6′ ); #Create fake headers just in case
$mech->add_header( ‘Accept’ => ‘text/xml,application/xml,application/xhtml\+xml,text/html,text/plain,image/png’ );
$mech->add_header( ‘Accept-Language’ => ‘en-us,en’ );
$mech->add_header( ‘Accept-Charset’ => ‘ISO-8859-1,utf-8′ );
$mech->add_header( ‘Accept-Language’ => ‘en-us,en’ );
$mech->add_header( ‘Keep-Alive’ => ’300′ );
$mech->add_header( ‘Connection’ => ‘keep-alive’ );

# Get login page
$mech->get($login_url);
$mech->success or die "Can’t get the login page";

# Submit the login form with username (mobilnumber) and password
$mech->submit_form(with_fields => { ‘loginmsisdn’ => $username, ‘login-password’ => $password });
$mech->success or die "Could not login";

# Get sms page
$mech->get($sms_url);
$mech->success or die "Could not get sms page";

# Send sms by submitting sms form
$mech->submit_form(with_fields => { ‘recipients’ => $recipients, ‘message’ => $message });
$mech->success or die "Could not send sms";

# Figure out status
my $html = $mech->content();
die "Form submitted, but message does not appear to be sent" if(!$html=~/Beskeden blev afsendt/ig);

exit 0;

Upgrading OBP and ALOM on a SunFire v210/v240

Sunday, July 24th, 2011

Recently I got my hands on a piece of oldish SUN equipment (SunFire V210/V240). It was in an ok condition. Not perfect, but still usable and I will be able to fix the smaller issues.

One of the issues was the really really old OBP and ALOM installed. In this post I will show how to upgrade OBP and ALOM. The key thing to remember is to

  1. Read ALL the attached readmes and whats not.
  2. Make sure ALL dependencies are met
  3. Upgrade the OBP before you upgrade the ALOM

And as usual. If you break your stuff following this post, then sorry but I can and will not be held responsible for anything you do. It worked for me. If it works for you, great. If it doesn’t, then tuff luck.

With that out of the way lets get started. First we need to obtain the ALOM and OPB patch. As a private person you might have a hard time getting hold of these files without an active support contract with oracle. I know I had. Mail  me if you run out of luck. You will need

  • 142700-02.zip – OBP 4.30.0
  • ALOM_1.6.10_fw_hw0.tar.gz – ALOM 1.6.10

Below is the raw output of the upgrade so you can see how it is done. OBP first

**** While in the OS download and unpack the OBP firmware

# wget http://someserver/142700-02.zip

# unzip 142700-02.zip

# cd 142700-02

# cp flash-update*  /

# chmod 755 /flash-update*

# halt

**** From the OBP prompt issue

ok boot disk /flash-update-SunFire240

Firmware Release(s)                Firmware Release(s)
Currently Existing in the System      Available for Installation  /  Install?
———————————- ——————————————-
OBP 4.11.4 2003/07/23 08:04        OBP 4.30.0 2010/01/06 14:48          YES
POST 4.30.4 2010/01/06 15:10         YES

Type sa if you wish to select all available firmware releases for
installation.  Type h for help, quit to exit, or cont to continue: cont

The Flash programming process is about to begin.
Type h for help, q to quit, Return or Enter to continue:

Erasing the top half of the Flash PROM.
Programming OBP into the top half of the Flash PROM.
Verifying OBP in the top half of the Flash PROM.

Erasing the top half of the Flash PROM.
Programming POST into the top half of Flash PROM.
Verifying POST in the top half of the Flash PROM.
Programming was successful.

SC Alert: Host System has Reset
SC Alert: Host System has read and cleared bootmode.

Configuring system memory & CPU(s)
Probing system devices
Probing memory
NOTICE: Initializing security keystore
Probing I/O buses

Sun Fire V210, No Keyboard
Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.30.4.a, 4096 MB memory installed, Serial #57866961.
Ethernet address 0:3:ba:72:fa:d1, Host ID: 8372fad1.

NOTICE: Updating OpenBoot NVRAM diagnostic configuration variables..
diag-script =  normal
diag-trigger =          error-reset power-on-reset
diag-level =            max
verbosity =             normal
service-mode? =         false
auto-boot-on-error? =   true
error-reset-recovery =  sync

Your OBP is now updated. Now to the ALOM. From the OS

# firmware

# /usr/platform/`uname -i`/sbin/scadm version

SC Version v1.3
SC Bootmon Version:  v1.3.0
SC Firmware Version:  v1.3.0

# /usr/platform/`uname -i`/sbin/scadm download boot alombootfw
……………….. (100%)
Download completed successfully

Please wait for verification

…………
Complete

# sleep 60
#  /usr/platform/`uname -i`/sbin/scadm version

SC Version v1.3
SC Bootmon Version:  v1.6.10
SC Firmware Version:  v1.3.0

# sleep 120
#  /usr/platform/`uname -i`/sbin/scadm version

SC Version v1.6
SC Bootmon Version:  v1.6.10
SC Firmware Version:  v1.6.10

You ALOM is now updated. Nothing fancy really.