[dl-x86solaris-devel 109] CVS update: dlkit2/sv

Back to archive index

SAWADA Keiji card_capto****@users*****
2006年 4月 8日 (土) 04:08:27 JST


Index: dlkit2/sv/add-client.sub
diff -u dlkit2/sv/add-client.sub:1.1.2.3 dlkit2/sv/add-client.sub:1.1.2.4
--- dlkit2/sv/add-client.sub:1.1.2.3	Sat Apr  1 15:02:36 2006
+++ dlkit2/sv/add-client.sub	Sat Apr  8 04:08:27 2006
@@ -58,27 +58,50 @@
 # basic preparations
 
 sanity_check() {
-    x=${SV_INSTROOT:?"SV_INSTROOT is not set"}
     x=${CL_CONFIG:?"CL_CONFIG is not set"}
 }
 
 check_install_type() {
-    echon "Checking installation type... "
+    echon "Checking boot and installation type... "
+
+    case "$BOOT_TYPE" in
+	newboot)
+	    echon "newboot, "
+	    ;;
+	*)
+	    echo "unknown"
+	    perror "BOOT_TYPE should be 'newboot'"
+	    ;;
+    esac
+
     case "$INSTALL_TYPE" in
 	disklessify)
 	    use_dvddir=false		# already installed
 	    use_pkgenum=false		# already installed
+	    use_instroot=true		# rootdir on NFS at install-time
 	    use_fin_root=true		# rootdir on NFS (postinstall)
+	    use_swapfile=true		# use swap at install/postinstall
 	    ;;
 	netinstall)
 	    use_dvddir=true		# going to use content
 	    use_pkgenum=false		# we use suninstall instead
+	    use_instroot=true		# rootdir on NFS at install-time
 	    use_fin_root=false		# rootdir on hard drive (postinstall)
+	    use_swapfile=false		# we don't use swap over NFS
 	    ;;
-	diskless|offline)
+	diskless)
 	    use_dvddir=true		# going to use content
 	    use_pkgenum=true		# we choose packages by myself
+	    use_instroot=true		# rootdir on NFS at install-time
 	    use_fin_root=true		# rootdir on NFS (postinstall)
+	    use_swapfile=true		# use swap at install/postinstall
+	    ;;
+	offline)
+	    use_dvddir=true		# going to use content
+	    use_pkgenum=true		# we choose packages by myself
+	    use_instroot=false		# no rootdir at install-time
+	    use_fin_root=true		# rootdir on NFS (postinstall)
+	    use_swapfile=true		# use swap at postinstall
 	    ;;
 	*)
 	    perror "choose INTALL_TYPE value from: " \
@@ -86,15 +109,6 @@
 	    ;;
     esac
     echo "$INSTALL_TYPE"
-
-    case "$BOOT_TYPE" in
-	newboot)
-	    use_instroot=true		# rootdir on NFS at install-time
-	    ;;
-	*)
-	    perror "BOOT_TYPE should be 'newboot'"
-	    ;;
-    esac
 }
 
 prepare_pool_dir() {
@@ -117,7 +131,7 @@
 }
 
 check_dir_existence() {
-    # subroutine for directory existence checking
+    # checks directory existence. used by check_base_dirs().
     var=${1:?}
     dir=${2:?}
 
@@ -248,7 +262,7 @@
     $use_dvddir || touch $cachedir/instdir_exported
     $use_instroot || touch $cachedir/instroot_exported
     $use_fin_root || touch $cachedir/fin_root_exported
-    $use_fin_root || touch $cachedir/swapfile_exported
+    $use_swapfile || touch $cachedir/swapfile_exported
 
     echo ""
     warn_export=false
Index: dlkit2/sv/finish-client.sub
diff -u dlkit2/sv/finish-client.sub:1.1.2.3 dlkit2/sv/finish-client.sub:1.1.2.4
--- dlkit2/sv/finish-client.sub:1.1.2.3	Wed Mar 29 01:50:05 2006
+++ dlkit2/sv/finish-client.sub	Sat Apr  8 04:08:27 2006
@@ -26,12 +26,16 @@
 update_grub_menu_for_postinstall() {
     case "$BOOT_TYPE" in
 	newboot)
-	    echo "Updating GRUB menu for postinstall..."
+	    echo "Updating GRUB menu for postinstallation..."
 	    menu=`echo menu.lst.01$CL_MAC | sed -e 's/://g'`
 	    cp -p $cl_pool/menu-fin.lst $SV_TFTPROOT/$menu
 	    ;;
     esac
 }
 
-sync_postinstall_boot_archive
-update_grub_menu_for_postinstall
+if [ "$INSTALL_TYPE" != netinstall ]; then
+    # For netinstall, we don't need setup pxegrub because client will
+    # use its boot loader
+    sync_postinstall_boot_archive
+    update_grub_menu_for_postinstall
+fi
Index: dlkit2/sv/install-client.sub
diff -u dlkit2/sv/install-client.sub:1.1.2.5 dlkit2/sv/install-client.sub:1.1.2.6
--- dlkit2/sv/install-client.sub:1.1.2.5	Sat Apr  1 15:02:36 2006
+++ dlkit2/sv/install-client.sub	Sat Apr  8 04:08:27 2006
@@ -48,10 +48,31 @@
 
 #----------------------------------------------------------------------
 sanity_check() {
-    x=${SV_INSTROOT:?"SV_INSTROOT is not set"}
     x=${CL_CONFIG:?"CL_CONFIG is not set"}
 }
 
+check_install_type() {
+    case "$INSTALL_TYPE" in
+	disklessify)
+	    use_swapfile=true		# use swap at install/postinstall
+	    ;;
+	netinstall)
+	    use_swapfile=false		# we don't use swap over NFS
+	    ;;
+	diskless)
+	    use_swapfile=true		# use swap at install/postinstall
+	    ;;
+	offline)
+	    use_swapfile=true		# use swap at postinstall
+	    ;;
+	*)
+	    perror "choose INTALL_TYPE value from: " \
+		"disklessify, netinstall, diskless, offline"
+	    ;;
+    esac
+}
+
+
 #----------------------------------------------------------------------
 make_swap_file() {
     echon "Making swap file for client... "
@@ -185,11 +206,17 @@
     echo '.'
 }
 
-install_non_std_driver() {
+copy_non_std_driver() {
     for drv in $NON_STD_DRIVER; do
-	echo "Installing $drv driver..."
+	echo "Copying $drv driver..."
 	mkdir -p $trandir/site_drv
 	cp site_drv/$drv.* $trandir/site_drv
+    done
+}
+
+install_non_std_driver() {
+    for drv in $NON_STD_DRIVER; do
+	echo "Installing $drv driver..."
 	sh $trandir/cm.non-std-driver.$drv server $trandir
 	echo "Installing $drv driver... done"
     done
@@ -355,14 +382,27 @@
 #----------------------------------------------------------------------
 
 sanity_check
-make_swap_file
-[ "$INSTALL_TYPE" != "netinstall" -a "$BOOT_TYPE" = "newboot" ] && create_mininfsroot
-prepare_installation_env
-install_non_std_driver
-prepare_postinstall_env
-transfer_installation_script
-[ "$BOOT_TYPE" = "newboot" ] && create_boot_archive
+check_install_type
+$use_swapfile && make_swap_file
+
+case "$INSTALL_TYPE" in
+    disklessify|netinstall|diskless)
+	create_mininfsroot
+	prepare_installation_env
+	copy_non_std_driver
+	install_non_std_driver
+	prepare_postinstall_env
+	transfer_installation_script
+	create_boot_archive
+	;;
+    offline)
+	copy_non_std_driver
+	prepare_postinstall_env
+	. sv/offline-installer.sub
+	;;
+esac
+
 restart_dhcpd
 
 echo ""
-echo "Done installation for client \"$CL_CONFIG\" (on server side)"
+echo "Done server-side installation for client \"$CL_CONFIG\""
Index: dlkit2/sv/non-std-driver-setup.sh
diff -u dlkit2/sv/non-std-driver-setup.sh:1.1.2.2 dlkit2/sv/non-std-driver-setup.sh:1.1.2.3
--- dlkit2/sv/non-std-driver-setup.sh:1.1.2.2	Sun Mar 12 17:10:11 2006
+++ dlkit2/sv/non-std-driver-setup.sh	Sat Apr  8 04:08:27 2006
@@ -100,7 +100,7 @@
     offline)
 	# assuming $CWD/config.in exists. ran at server-side.
 	# modifies postinstall-time root filesystem.
-	. $DEST_DIR/config.in
+	. ./config.in
 	targetdir=$SV_FIN_ROOT/kernel/drv
 	root=$SV_FIN_ROOT
 	;;
Index: dlkit2/sv/offline-installer.sub
diff -u dlkit2/sv/offline-installer.sub:1.1.2.3 dlkit2/sv/offline-installer.sub:1.1.2.4
--- dlkit2/sv/offline-installer.sub:1.1.2.3	Sat Apr  1 15:02:36 2006
+++ dlkit2/sv/offline-installer.sub	Sat Apr  8 04:08:27 2006
@@ -12,7 +12,8 @@
 # absolutely no warranty.
 
 set -eu
-trandir=pool/$CL_CONFIG/trandir
+cl_pool=pool/$CL_CONFIG
+trandir=$cl_pool/trandir
 CL_ROOT=$SV_FIN_ROOT
 PKGDIR=$SV_PKGDIR
 
@@ -33,7 +34,8 @@
 }
 
 add_package() {
-    cat > .v.admin <<EOF
+    if [ ! -f $cl_pool/admin ]; then
+	cat > $cl_pool/admin <<EOF
 mail=
 instance=overwrite
 partial=nocheck
@@ -46,7 +48,8 @@
 action=nocheck
 basedir=default
 EOF
-    pkgadd -d $SV_PKGDIR -a .v.admin -R $SV_FIN_ROOT "$@"
+    fi
+    pkgadd -d $SV_PKGDIR -a $cl_admin -R $SV_FIN_ROOT "$@"
 }
 
 install_pkgs() {
@@ -63,7 +66,7 @@
 	name=`get_package_name "$pkg"`
 	printf "Installing %s, %s [%d/%d]... " $pkg "$name" $i $total
 
-	if add_package $pkg > $LOGDIR/$pkg 2>&1; then
+	if add_package $pkg > $LOG_DIR/$pkg 2>&1; then
 	    echo "done"
 	    touch $DONE_DIR/$pkg; rm -f $FAIL_DIR/$pkg
 	else
@@ -113,7 +116,7 @@
 	backup_distfile $CL_ROOT/etc/default/nfs
 	(cat $CL_ROOT/etc/default/nfs.dist
 	    echo ""
-	    echo "#Added by sv.offline-installer"
+	    echo "#Added by sv/offline-installer"
 	    echo "NFS_CLIENT_VERSMAX=$CL_NFS_CLIENT_VERSION"
 	) > $CL_ROOT/etc/default/nfs
     fi


dl-x86solaris-devel メーリングリストの案内
Back to archive index