teelime
teeli****@users*****
2006年 3月 4日 (土) 00:04:50 JST
Index: dlkit2/cl.diskless-installer diff -u dlkit2/cl.diskless-installer:1.7 dlkit2/cl.diskless-installer:1.8 --- dlkit2/cl.diskless-installer:1.7 Fri Mar 3 09:52:54 2006 +++ dlkit2/cl.diskless-installer Sat Mar 4 00:04:50 2006 @@ -42,6 +42,13 @@ mount -F nfs -o $CL_MOUNT_OPTION $SV_IPADDR:$SV_DVDDIR /cdrom } +check_fin_root_clean() { + if [ `/bin/ls $CL_ROOT|wc -l` -ne 0 ]; then + echo "Error: Installation aborted. SV_FIN_ROOT is not clean" + exit 1 + fi +} + install_pkgs() { mkdir -p $LOGDIR set +e @@ -247,6 +254,7 @@ case "$1" in -nopkg) mount_fin_root + check_fin_root_clean mount_cdrom install_non_std_driver config_etc @@ -258,6 +266,7 @@ *) mount_fin_root + check_fin_root_clean mount_cdrom install_pkgs install_non_std_driver Index: dlkit2/cl.disklessify diff -u dlkit2/cl.disklessify:1.5 dlkit2/cl.disklessify:1.6 --- dlkit2/cl.disklessify:1.5 Fri Mar 3 09:52:54 2006 +++ dlkit2/cl.disklessify Sat Mar 4 00:04:50 2006 @@ -8,6 +8,13 @@ printf "%s" "$@" } +usage() { + echo + echo "Usage: $0 {-probe | -copy | -bootenv}" + exit 0 +} + + backup_file() { file=${1:?} if [ ! -f "$file.localdisk" ]; then @@ -131,54 +138,46 @@ fi } -#---------------------------------------------------------------------- - -mode=${1:--probe} - -trandir=/cl.trandir -. $trandir/config.in - -check_nfsroot - -umount /localdisk > /dev/null 2>&1 -mkdir -p /localdisk +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 +} -echo "Mounting $CL_ROOT on $SV_IPADDR:$SV_FIN_ROOT..." -umount $CL_ROOT > /dev/null 2>&1 -mount $SV_IPADDR:$SV_FIN_ROOT $CL_ROOT +find_root_slice() { + echo "Searching for ufs slice(s) on local disk(s)... " + for ldev in `enum_slices` + do + if slice_is_ufs "$ldev"; then + ufs_slices="$ufs_slices $ldev" + fi + done -echo "Searching for ufs slice(s) on local disk(s)... " -for ldev in `enum_slices` -do - if slice_is_ufs "$ldev"; then - ufs_slices="$ufs_slices $ldev" - fi -done - -for ldev in $ufs_slices -do - echon "Checking if $ldev is root slice... " - if slice_is_root_slice "$ldev"; then - echo "yes"; root_slice="$ldev" - else - echo "no" - fi -done -if [ -z "$root_slice" ]; then - echo "Error: root slice not found"; exit 1 -fi - -echo "Gathering /dev and vfstab info from root slice..." -mount -F ufs -o ro $root_slice /localdisk -(cd /localdisk - cp etc/vfstab /tmp/.v.vfstab - find ./dev -type l -ls > /tmp/.v.ldisk_devlist) -(cd / - find ./dev -type l -ls > /tmp/.v.curr_devlist) -umount /localdisk + for ldev in $ufs_slices + do + echon "Checking if $ldev is root slice... " + if slice_is_root_slice "$ldev"; then + echo "yes"; root_slice="$ldev" + else + echo "no" + fi + done + if [ -z "$root_slice" ]; then + echo "Error: root slice not found"; exit 1 + fi -#---------------------------------------------------------------------- -# + echo "Gathering /dev and vfstab info from root slice..." + mount -F ufs -o ro $root_slice /localdisk + (cd /localdisk + cp etc/vfstab /tmp/.v.vfstab + find ./dev -type l -ls > /tmp/.v.ldisk_devlist) + (cd / + find ./dev -type l -ls > /tmp/.v.curr_devlist) + umount /localdisk +} copy_local_disks() { echo "Copying ufs directories on local disk(s)... " @@ -301,16 +300,44 @@ mkdir -p $CL_ROOT/etc/skel/.gnome2/panel2.d/default/launchers } +#---------------------------------------------------------------------- + +#mode=${1:--probe} +mode=${1} +[ -z "$mode" ] && usage && exit 1 + +trandir=/cl.trandir +. $trandir/config.in + +check_nfsroot + +umount /localdisk > /dev/null 2>&1 +mkdir -p /localdisk + +echo "Mounting $CL_ROOT on $SV_IPADDR:$SV_FIN_ROOT..." +umount $CL_ROOT > /dev/null 2>&1 +mount $SV_IPADDR:$SV_FIN_ROOT $CL_ROOT case "x$mode" in + x-probe) + find_root_slice + enum_local_disks ;; 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 copy_local_disks ;; x-bootenv) + find_root_slice setup_bootenv ;; *) - enum_local_disks ;; + usage ;; esac + echo "Unmounting $CL_ROOT..." umount $CL_ROOT rmdir /localdisk Index: dlkit2/cl.install-setup-diskless diff -u dlkit2/cl.install-setup-diskless:1.2 dlkit2/cl.install-setup-diskless:1.3 --- dlkit2/cl.install-setup-diskless:1.2 Thu Mar 2 23:06:41 2006 +++ dlkit2/cl.install-setup-diskless Sat Mar 4 00:04:50 2006 @@ -20,14 +20,10 @@ Solaris/x86 diskless-kit2: diskless [0;39m' -if [ -f /cl.trandir/cl.diskless-installer ]; then - if ( sh /cl.trandir/cl.diskless-installer ); then +if ( sh /cl.trandir/cl.diskless-installer ); then # installation successful : - else - echo "Installation failed. Fix problem and exit shell." - fi else - echo "Error: cannot run /cl.trandir/cl.diskless-installer" + echo "Installation failed. Fix problem and exit shell." fi exec /bin/sh Index: dlkit2/cl.install-setup-disklessify diff -u dlkit2/cl.install-setup-disklessify:1.3 dlkit2/cl.install-setup-disklessify:1.4 --- dlkit2/cl.install-setup-disklessify:1.3 Thu Mar 2 23:04:27 2006 +++ dlkit2/cl.install-setup-disklessify Sat Mar 4 00:04:50 2006 @@ -24,6 +24,6 @@ # execution successful : else - echo "Error: /cl.trandir/cl.disklessify: not found or not executable" + echo "Execution failed. Fix problem and exit shell." fi exec /bin/sh Index: dlkit2/sv.grub-menu.m4 diff -u dlkit2/sv.grub-menu.m4:1.2 dlkit2/sv.grub-menu.m4:1.3 --- dlkit2/sv.grub-menu.m4:1.2 Sun Feb 26 04:16:06 2006 +++ dlkit2/sv.grub-menu.m4 Sat Mar 4 00:04:50 2006 @@ -69,14 +69,21 @@ define(`KERNFILE', ``kernel/unix'')dnl define(`MODULE', ``/boot/boot_archive'')dnl define(`PROPDEF', `fstype=nfs,server-ip=SV_IPADDR,server-name=SV_NAME,server-path=SV_INSTROOT')dnl +define(`POSTPROPDEF', `fstype=nfs,server-ip=SV_IPADDR,server-name=SV_NAME,server-path=SV_FIN_ROOT')dnl #---------------------------------------------------------------------- -title Install Solaris (PXE) +title Install (or disklessify) Solaris (PXE) * You shuld remove this section after installing kernel LOADER KERNFILE - nowin -B PROPDEF module MODULE -title Install Solaris with kernel debugger (PXE) +title Install (or disklessify) Solaris with kernel debugger (PXE) * You shuld remove this section after installing kernel LOADER KERNFILE -kv - nowin -B PROPDEF module MODULE +title Solaris (PXE) * Use this section after installing + kernel LOADER KERNFILE -B POSTPROPDEF + module MODULE +title Solaris with kernel debugger (PXE) * use this section after installing + kernel LOADER KERNFILE -kv -B POSTPROPDEF + module MODULE ')dnl dnl dnl ######################################################################