Karen Tung wrote:
> Hi Jean,
>
> Changes to the 2 files listed looks good. I understand there's no way
> to use webrev for
> the tar file. I assume you just changed the "post_process" script in
> there.
> Can you post a diff of the changes in that script?
>
Here it is (diff -c old new):
--- post_process Fri Oct 19 11:54:17 2007
***************
*** 131,136 ****
--- 131,149 ----
done
}
+ fatal_micro_exit()
+ {
+ /usr/sbin/mount | /usr/xpg4/bin/grep -q $MICROROOT2
+ if [ $? -eq 0 ] ; then
+ umount $MICROROOT2
+ lofiadm $BOOT_ARCHIVE2
+ if [ $? -eq 0 ] ; then
+ lofiadm -d $BOOT_ARCHIVE2
+ fi
+ fi
+ exit 2
+ }
+
BOOTCD_SKEL=./bootcd_skel
BOOTCD_SKEL_FILES=$BOOTCD_SKEL/bootcd_skel.files
WORKING_DIR=`pwd`
***************
*** 364,371 ****
#
/bin/rm -rf $MICROROOT/var/spool/postrun
- set -x
-
#
# HACK:
# remove all but the few necessary files in /usr in the microroot
--- 377,382 ----
***************
*** 375,386 ****
cd $PROTO
# Create a new smaller boot archive.
MICROROOT2=${MICROROOT}2
! BOOT_ARCHIVE2=$PROTO/boot/x86.microroot2
rm -f $BOOT_ARCHIVE2
/usr/sbin/mkfile 150000k $BOOT_ARCHIVE2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to create file for $BOOT_ARCHIVE2"
! exit 2
fi
# loopback mount the smaller boot archive
--- 386,398 ----
cd $PROTO
# Create a new smaller boot archive.
MICROROOT2=${MICROROOT}2
! BOOT_FILENAME=x86.microroot
! BOOT_ARCHIVE2=$TMPDIR/$BOOT_FILENAME
rm -f $BOOT_ARCHIVE2
/usr/sbin/mkfile 150000k $BOOT_ARCHIVE2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to create file for $BOOT_ARCHIVE2"
! fatal_micro_exit
fi
# loopback mount the smaller boot archive
***************
*** 387,393 ****
lofidev=`/usr/sbin/lofiadm -a $BOOT_ARCHIVE2`
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to create loopback device for $BOOT_ARCHIVE2"
! exit 2
fi
rlofidev=`echo $lofidev | sed s/lofi/rlofi/`
--- 399,405 ----
lofidev=`/usr/sbin/lofiadm -a $BOOT_ARCHIVE2`
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to create loopback device for $BOOT_ARCHIVE2"
! fatal_micro_exit
fi
rlofidev=`echo $lofidev | sed s/lofi/rlofi/`
***************
*** 394,411 ****
newfs -m 0 $rlofidev < /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to newfs $rlofidev"
! exit 2
fi
[ -d $MICROROOT2 ] || mkdir $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to mkdir $MICROROOT2"
! exit 2
fi
mount -o nologging $lofidev $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to mount $lofidev on $MICROROOT2"
! exit 2
fi
cd $MICROROOT
--- 406,423 ----
newfs -m 0 $rlofidev < /dev/null 2> /dev/null
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to newfs $rlofidev"
! fatal_micro_exit
fi
[ -d $MICROROOT2 ] || mkdir $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to mkdir $MICROROOT2"
! fatal_micro_exit
fi
mount -o nologging $lofidev $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to mount $lofidev on $MICROROOT2"
! fatal_micro_exit
fi
cd $MICROROOT
***************
*** 421,433 ****
lockfs -f $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: lockfs of $MICROROOT2 did not complete successfully"
! exit 2
fi
umount $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to unmount $MICROROOT2"
! exit 2
fi
rmdir $MICROROOT2
--- 433,445 ----
lockfs -f $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: lockfs of $MICROROOT2 did not complete successfully"
! fatal_micro_exit
fi
umount $MICROROOT2
if [ $? -ne 0 ] ; then
echo "FAILURE: Unable to unmount $MICROROOT2"
! fatal_micro_exit
fi
rmdir $MICROROOT2
***************
*** 434,444 ****
lofiadm -d $BOOT_ARCHIVE2;
if [ $? -ne 0 ] ; then
echo "FAILURE: Failure to perform lofiadm -d $BOOT_ARCHIVE2"
! exit 2
fi
cd $WORKING_DIR
-
grep -v "cadp \"\"" $MICROROOT/etc/driver_aliases > /tmp/d.tmp
cp /tmp/d.tmp $MICROROOT/etc/driver_aliases
exit 0
--- 446,455 ----
lofiadm -d $BOOT_ARCHIVE2;
if [ $? -ne 0 ] ; then
echo "FAILURE: Failure to perform lofiadm -d $BOOT_ARCHIVE2"
! fatal_micro_exit
fi
cd $WORKING_DIR
grep -v "cadp \"\"" $MICROROOT/etc/driver_aliases > /tmp/d.tmp
cp /tmp/d.tmp $MICROROOT/etc/driver_aliases
exit 0
> Thanks,
>
> --Karen
>
> Jean McCormack wrote:
>> This is a code review for the following item:
>>
>> 4) Optimization to the code:
>> - Create the "big" microroot in a regular directory.
>> - Create the "small" microroot in /tmp, then, move to the proto area.
>>
>> http://cr.opensolaris.org/~jeanm/distro_constructor/
>>
>> Jean
>> _______________________________________________
>> caiman-discuss mailing list
>> caiman-discuss at opensolaris.org
>> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
>>
>