Re: Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread Doug Barton
Tom Judge wrote:
> Hi,
> 
> I have the following options in /etc/make.conf:
> 
> NO_PROFILE=true
> NO_SENDMAIL=true
> NO_GAMES=true
> NO_I4B=true
> NO_ATM=true
> NO_INET6=true
> NO_BLUETOOTH=true
> NO_IPFILTER=true
> NO_RCMDS=true
> NO_KERBEROS=true
> 
> 
> However after a "make buildworld installworld" the utilities and libs
> associated with these packages are still installed,  is there any easy
> way to remove them from the system?

I've used the following successfully for a long time:

doinstall ()
{
cd /usr && [ -d include-old ] && /bin/rm -r include-old;
[ ! -e include-old ] && mv -i include include-old;
/bin/rm -r /usr/share/man;
cd /usr/src && touch /var/tmp/installdate && make installworld
}

Then I use the attached script to delete things that weren't installed
above. One caveat, if you did not clean out /usr/obj before you built
the world, valid libraries will show up as older than the install
because of how the file dates are set in bsd.lib.mk. So, if you
cleared out /usr/obj before your build, then you can mv the libraries
safely. If you didn't, when the first library comes up hit q.

hth,

Doug

-- 

This .signature sanitized for your protection
#!/bin/sh

PATH=/usr/bin:/bin
export PATH

for dir in /bin /libexec /rescue /sbin /usr/bin /usr/games /usr/libdata \
/usr/libexec /usr/sbin /usr/share/games /usr/lib /lib ; do
if [ ! -d "$dir" ]; then continue; fi

for file in `find $dir \( -type f -o -type l \) -a \
! -newer /var/tmp/installdate`; do
case "${file}" in
/usr/lib/compat/*|*/0ld/*|/usr/libdata/perl/*) ;;
*/libexec/ld-elf.so.1*|/sbin/init.bak|/usr/bin/perl*) ;;
*)  echo ''
ls -lao ${file}
read -p "  *** Move ${file} to ${file%/*}/0ld? [n] " M
case ${M} in
[yY]*)  mkdir -p ${file%/*}/0ld
chflags 0 ${file} &&
mv -i ${file} ${file%/*}/0ld/
;;
[qQ])   exit 0 ;;
esac
;;
esac
done
done

exit 0

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Re: Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread Freddie Cash
On Wednesday 17 January 2007 10:20 am, Tom Judge wrote:
> I have the following options in /etc/make.conf:
> NO_PROFILE=true
> NO_SENDMAIL=true
> NO_GAMES=true
> NO_I4B=true
> NO_ATM=true
> NO_INET6=true
> NO_BLUETOOTH=true
> NO_IPFILTER=true
> NO_RCMDS=true
> NO_KERBEROS=true
>
> However after a "make buildworld installworld" the utilities and libs
> associated with these packages are still installed,  is there any easy
> way to remove them from the system?

There are scripts floating around the Internet that automate this.  There 
are a couple linked off http://www.bsdforums.org/forums/ but you'll have 
to search the archives to find them.

There's nothing built-in to FreeBSD that handles this.  At least not that 
I've found / heard of.  I could be wrong, though.
-- 
Freddie Cash
[EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread John Nielsen
On Wednesday 17 January 2007 14:29, John Nielsen wrote:
> On Wednesday 17 January 2007 13:52, Victor Snezhko wrote:
> > Tom Judge <[EMAIL PROTECTED]> writes:
> > > Hi,
> > >
> > > I have the following options in /etc/make.conf:
> > >
> > > NO_PROFILE=true
> > > NO_SENDMAIL=true
> > > NO_GAMES=true
> > > NO_I4B=true
> > > NO_ATM=true
> > > NO_INET6=true
> > > NO_BLUETOOTH=true
> > > NO_IPFILTER=true
> > > NO_RCMDS=true
> > > NO_KERBEROS=true
> > >
> > >
> > > However after a "make buildworld installworld" the utilities and libs
> > > associated with these packages are still installed,  is there any easy
> > > way to remove them from the system?
> >
> > make delete-old
>
> That will delete obsolete files no longer used by the current version of
> the operating system, but it won't do what the OP is asking.
>
> I don't know of a one-step way to do what you're asking. You could do a
> find over the base system directories and look for files older than your
> last installworld. That might not fit the "easy" part of the request since
> you'd have to go over the list manually to make sure it wasn't killing
> anything you actually need, but it should be mostly accurate.

Here's a script I just put together to get a good first approximation of 
outdated files using the approach above. Change the variables to be 
appropriate for your situation, review the output file carefully before 
deleting anything, and use at your own risk. :)

=== start prune.sh ===
#!/bin/sh

DIRS="/bin /lib /libexec /rescue /sbin /usr/bin /usr/games /usr/lib \
/usr/libdata /usr/libexec /usr/sbin"
OUTFILE=/usr/local/scripts/prune-files.txt
AGE="1 month"

rm -f ${OUTFILE}
for d in ${DIRS} ; do
find ${d} -type f ! -newermt "${AGE} ago" >> ${OUTFILE}.tmp
done

grep -vF "lib/compat" ${OUTFILE}.tmp | grep -vi perl > ${OUTFILE}
rm -f ${OUTFILE}.tmp

=== end prune.sh ===

JN
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread John Nielsen
On Wednesday 17 January 2007 13:52, Victor Snezhko wrote:
> Tom Judge <[EMAIL PROTECTED]> writes:
> > Hi,
> >
> > I have the following options in /etc/make.conf:
> >
> > NO_PROFILE=true
> > NO_SENDMAIL=true
> > NO_GAMES=true
> > NO_I4B=true
> > NO_ATM=true
> > NO_INET6=true
> > NO_BLUETOOTH=true
> > NO_IPFILTER=true
> > NO_RCMDS=true
> > NO_KERBEROS=true
> >
> >
> > However after a "make buildworld installworld" the utilities and libs
> > associated with these packages are still installed,  is there any easy
> > way to remove them from the system?
>
> make delete-old

That will delete obsolete files no longer used by the current version of the 
operating system, but it won't do what the OP is asking.

I don't know of a one-step way to do what you're asking. You could do a find 
over the base system directories and look for files older than your last 
installworld. That might not fit the "easy" part of the request since you'd 
have to go over the list manually to make sure it wasn't killing anything you 
actually need, but it should be mostly accurate.

JN
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread Victor Snezhko
Tom Judge <[EMAIL PROTECTED]> writes:

> Hi,
>
> I have the following options in /etc/make.conf:
>
> NO_PROFILE=true
> NO_SENDMAIL=true
> NO_GAMES=true
> NO_I4B=true
> NO_ATM=true
> NO_INET6=true
> NO_BLUETOOTH=true
> NO_IPFILTER=true
> NO_RCMDS=true
> NO_KERBEROS=true
>
>
> However after a "make buildworld installworld" the utilities and libs
> associated with these packages are still installed,  is there any easy
> way to remove them from the system?

make delete-old

-- 
WBR, Victor V. Snezhko
E-mail: [EMAIL PROTECTED]


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Removing unused core components. (Disabled in make.conf)

2007-01-17 Thread Tom Judge

Hi,

I have the following options in /etc/make.conf:

NO_PROFILE=true
NO_SENDMAIL=true
NO_GAMES=true
NO_I4B=true
NO_ATM=true
NO_INET6=true
NO_BLUETOOTH=true
NO_IPFILTER=true
NO_RCMDS=true
NO_KERBEROS=true


However after a "make buildworld installworld" the utilities and libs 
associated with these packages are still installed,  is there any easy 
way to remove them from the system?


Thanks

Tom
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"