Thanks for sharing your script.  This is very similar to how we make 
modifications
and debug problems with the bootroot(aka: microroot).

Just FYI, you don't need to do the 2 step lofiadm, then mount to mount 
the ISO and
the bootroot.  You can just do mount, and everything will be taken care 
of for you.
Take a look at
http://www.opensolaris.org/jive/thread.jspa?messageID=230143&#230143

--Karen

Rachapong P. wrote:
> While waiting for the details, I found another way to add CPQary3 driver 
> directly into OpenSolaris ISO. Please see my quick & dirty script below with 
> your caution. 
>
> 1. You will need to unpack your CPQary3 driver into a folder called "driver".
> 2. The final ISO file is called as "new.iso"
>
> Let me know if you have any problem.
>
> -------------------------------------------------------------------------------
> #!/usr/bin/bash
> org_iso=`pwd`/org.iso
> org_mnt=/mnt/org
> new_iso=`pwd`/new.iso
> new_mnt=/mnt/new
> new_usb=`pwd`/new.usb
> mr_iso=`pwd`/mr.iso
> mr_mnt=/mnt/mr
>
> # Extract original iso
> echo "Extracting original iso"
> org_dev=`lofiadm -a $org_iso`
> mkdir $org_mnt
> mount -F hsfs $org_dev $org_mnt
> cp -R $org_mnt $new_mnt
> umount $org_mnt
> rm -rf $org_mnt
> lofiadm -d $org_dev
>
> # Extract microroot
> echo "Extracting microroot"
> cp $new_mnt/boot/x86.microroot ./mr.gz
> gunzip -c mr.gz > $mr_iso
> rm mr.gz
> mr_dev=`lofiadm -a $mr_iso`
> mkdir $mr_mnt
> mount $mr_dev $mr_mnt
>
> # Add driver to microroot
> pkgadd -R $mr_mnt -d ./driver/CPQary3.pkg CPQary3
>
> # Repack microroot
> echo "Repack microroot"
> umount $mr_mnt
> rm -rf $mr_mnt
> lofiadm -d $mr_dev
> gzip -c $mr_iso > mr.gz
> rm $mr_iso
> mv mr.gz $new_mnt/boot/x86.microroot
>
> # Repack iso
> echo "Repack iso"
> mkisofs \
> -r \
> -b boot/grub/stage2_eltorito \
> -no-emul-boot \
> -boot-load-size 4 \
> -boot-info-table \
> -uid 65432 \
> -gid 1 \
> -dir-mode 0755 \
> -new-dir-mode 0755 \
> -file-mode 0755 \
> -c .catalog \
> -relaxed-filenames \
> -ldots \
> -allow-lowercase \
> -allow-multidot \
> -l \
> -o $new_iso \
> $new_mnt
> rm -rf $new_mnt
> -------------------------------------------------------------------------------
>   


Reply via email to