Edit: I still love getting scripts from readers
Originally posted May 31, 2016 on AIXchange
In January I posted some scripts I’d received from Simon Taylor. He’s since provided me with more:
“Hi Rob,
Annual upgrades are happening again. We have the common problems with getting downtime, etc., and I wasn’t over keen on the published methods of upgrading sddpcm device drivers. Fortunately, I came across a post by Josh-Daniel S. Davis on replacing the pre-deinstallation script (which fails if there are any active disks) with one that just exits 0.
Here’s how it works:
I’ve added a post installation (-z) script for nimadm alt_disk_migration. The alt_disk migration takes place in a chroot environment and I expected that there would be no real access to disk device drivers from within the chroot. This seems to be true and my environment migrated successfully from AIX 6 and devices.sddpcm.61.rte 2.6.0.3 to AIX 7 and devices.ssdpcm.71.rte 2.6.7.0
I bundled the sddpcm and devices.fcp.disk.ibm.mpio into the post installation script using uuencode because by the time the post installation script runs, the migration lpp_source had been unmounted. (There’s an install_all_updates script built into the migration that tries to upgrade all software in the lpp_source not already updated by the main upgrade logic. The install_all_updates fails on sddpcm).
The script includes a bit of logic (lslpp -Lqc “devices.sddpcm*”) to find the current version and decides whether or not to upgrade. If an upgrade is necessary, the deinstallation script is found using “ls /usr/lpp/devices.sddpcm*/deinstl/*pre_d” and replaced with the exit 0 script. This has helped us towards our goal of one-click upgrades.”
Simon’s .tar file
includes this information:
The mk_alt_post_script tars up the contents of the tar subdirectory
and uuencodes them into a script called post_alt_mig_script which is
called by the nimadm command. The attached tar file contains:
./alt_disk/
./alt_disk/tar/ # add the lpps here and run inutoc
./alt_disk/tar/readme
./alt_disk/tar/upgrade_sddpcm.ksh # removes old sddpcm and installs new
./alt_disk/mk_alt_post_script # builds post_alt_mig_script
./alt_disk/readme
What do you think? Is this something you’d find useful in your environments? If you have similar scripts or ideas that can be shared, please contact me.