teelime
teeli****@users*****
2006年 8月 30日 (水) 00:15:23 JST
Index: dlkit2/cl/disklessify diff -u dlkit2/cl/disklessify:1.1.2.2 dlkit2/cl/disklessify:1.1.2.3 --- dlkit2/cl/disklessify:1.1.2.2 Wed Mar 29 01:48:30 2006 +++ dlkit2/cl/disklessify Wed Aug 30 00:15:23 2006 @@ -16,7 +16,7 @@ # NOTE: names of each slices in current and existing environment. # system cannot hold more than one (potential) root slice. -set -e +#set -e #---------------------------------------------------------------------- # subroutines @@ -56,13 +56,12 @@ if [ "x$mntpt" = x/ ]; then if [ "x$fstype" = xnfs ]; then echo "yes" - return 0 else echo "no"; perror "rootdir should be NFS volume" + perror "rootdir not found in $mnttab" fi fi done < $mnttab - perror "rootdir not found in $mnttab" } enum_slice_devices() { @@ -161,6 +160,15 @@ fi } +is_fin_root_notclean() { + if [ `/bin/ls $CL_ROOT|wc -l` -ne 0 ]; then + echo "Error: Operation aborted. SV_FIN_ROOT is not clean" + return 0 + else + return 1 + fi +} + find_root_slice() { echo "Searching for ufs slice(s) on local disk(s)... " for ldev in `enum_slice_devices` @@ -298,13 +306,21 @@ fi } +config_bootrc() { + echo "Changing default boot device..." + cat $CL_ROOT/boot/solaris/bootenv.rc.localdisk | grep -v "setprop bootpath" \ + > $CL_ROOT/boot/solaris/bootenv.rc +} + setup_bootenv() { backup_file $CL_ROOT/etc/vfstab backup_file $CL_ROOT/etc/default/nfs + backup_file $CL_ROOT/boot/solaris/bootenv.rc config_vfstab config_default_nfs config_autofs + config_bootrc # TODO: An allopathy mkdir -p $CL_ROOT/etc/skel/.gnome2/panel2.d/default/launchers @@ -312,7 +328,8 @@ #---------------------------------------------------------------------- -mode=${1:-"-probe"} +#mode=${1:-"-probe"} +mode=${1} CL_ROOT=/a tmpfile=/tmp/disklessiy @@ -331,13 +348,20 @@ case "x$mode" in x-probe) find_root_slice - enum_existing_slices ;; + enum_existing_slices + usage ;; x-copy) + if is_fin_root_notclean; then + echo "Unmounting $CL_ROOT..." + umount $CL_ROOT > /dev/null 2>&1 + exit 1 + fi find_root_slice transfer_existing_slices ;; x-bootenv) find_root_slice - setup_bootenv ;; + setup_bootenv + /boot/solaris/bin/create_ramdisk $CL_ROOT ;; *) usage ;; esac Index: dlkit2/cl/install-setup-disklessify diff -u dlkit2/cl/install-setup-disklessify:1.1.2.1 dlkit2/cl/install-setup-disklessify:1.1.2.2 --- dlkit2/cl/install-setup-disklessify:1.1.2.1 Sun Mar 12 14:18:56 2006 +++ dlkit2/cl/install-setup-disklessify Wed Aug 30 00:15:23 2006 @@ -24,7 +24,7 @@ if [ -f $script ]; then chmod a+x $script - if $script; then + if $script -probe ; then # installation successful : else