Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2002 09:12:52 -0700 (PDT)
From:      walkpad <walkpad@hotmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/40298: using swapfile as /tmp
Message-ID:  <200207071612.g67GCqso069453@www.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         40298
>Category:       misc
>Synopsis:       using swapfile as /tmp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          wish
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 07 09:20:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     walkpad
>Release:        4.6-STABLE
>Organization:
personal
>Environment:
4.6-STABLE

>Description:
the following patch allows using swapfile as /tmp.
It can be applied to 4-STABLE and not to 5-current.

>How-To-Repeat:

>Fix:
$ diff /etc/rc.dist /etc/rc 
282,285c282,308
< 	if [ -w "${swapfile}" -a -c /dev/vn0b ]; then
< 		echo "Adding ${swapfile} as additional swap"
< 		vnconfig -e /dev/vn0b ${swapfile} swap
< 	fi
---
> 	case ${swapfile_as_tmp} in
> 	[Yy][Ee][Ss])
> 		if [ -w "${swapfile}" -a -c /dev/vn0 -a -c /dev/vn0b ]; then
> 			echo "Adding ${swapfile} as additional swap"
> 			vnconfig -e -s labels /dev/vn0 ${swapfile}
> 			disklabel -r -w vn0 auto
> 			if T=`mktemp /tmp/_vn0.XXXXX`; then
> 				disklabel -r vn0 > "$T"
> 				echo ' b: 100% 0 swap' >> "$T"
> 				disklabel -R vn0 "$T"
> 				swapon /dev/vn0b
> 				rm -f "$T"
> 				echo "Mounting ${swapfile} as /tmp"
> 				mount_mfs /dev/vn0b /tmp 2>/dev/null
> 			else
> 				vnconfig -u vn0
> 				vnconfig -e /dev/vn0b ${swapfile} swap
> 			fi
> 		fi
> 		;;
> 	*)
> 		if [ -w "${swapfile}" -a -c /dev/vn0b ]; then
> 			echo "Adding ${swapfile} as additional swap"
> 			vnconfig -e /dev/vn0b ${swapfile} swap
> 		fi
> 		;;
> 	esac

diff /etc/defaults/rc.conf.dist /etc/defaults/rc.conf
22a23
> swapfile_as_tmp="NO"	# Set to YES to use swapfile as /tmp.

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207071612.g67GCqso069453>