Πέμπτη, Σεπτεμβρίου 27, 2007

FreeBSD: Rebuild the World, and Recompile the Kernel ( STABLE)

Login: root
password: password

Install cvsup-without-gui

# pkg_add -r cvsup-without-gui
# pkg_add -r fastest_cvsup

If you want to install these items via ports, the way would be like this "but as I mentioned, you can use the pkg_add method for these 2 applications without fear"

# cd /usr/ports/net/cvsup-without-gui; make install clean
# cd /usr/ports/sysutils/fastest_cvsup; make install clean

# ee /etc/ssh/sshd_config

CHANGE the following

# Protocol 2
to
Protocol 2

and CHANGE the following

# PermitRootLogin no
to
PermitRootLogin no

Save and Quit [ esc a a ]

changes the console to not logout

# ee /etc/ttys

CHANGE the following

console none unknown off secure
to
console none unknown off insecure

Save and Quit [ esc a a ]

Install ports tree

# cp /usr/share/examples/cvsup/ports-supfile /root/
# cp /usr/share/examples/cvsup/stable-supfile /root/

# ee /root/ports-supfile

CHANGE the following

*default host=CHANGE_THIS.FreeBSD.org
to
*default host=cvsup4.FreeBSD.org

Save and Quit [ esc a a ]

# ee /root/stable-supfile

CHANGE the following

*default host=CHANGE_THIS.FreeBSD.org
to
*default host=cvsup4.FreeBSD.org

Save and Quit [ esc a a ]

Setup scripts for maintaining systems

# mkdir /root/scripts
# cd /root/scripts
# ee ports-update.sh

Write the following

#!/bin/sh
# updating port
echo "Beginning Ports Update"
/usr/local/bin/cvsup -g -L 2 /etc/ports-supfile
echo "Ports Update Complete"


Save and Quit [ esc a a ]

# ee src-update.sh

Write the following

#!/bin/sh
# updating source
echo "Beginning Source Update"
/usr/local/bin/cvsup -g -L 2 /etc/stable-supfile
echo "Source Update Complete"

Save and Quit [ esc a a ]

# chmod +x *.sh
# cp /root/ports-supfile /etc/
# cp /root/stable-supfile /etc/

# chmod 640 /etc/ports-supfile
# chmod 640 /etc/stable-supfile

Rebuild the entire machine and Kernel

# /root/scripts/src-update.sh
# cd /usr/src/sys/i386/conf
# cp GENERIC CUSTOM

# cd /usr/src/
# make buildworld
# make buildkernel KERNCONF=GENERIC
# make installkernel KERNCONF=GENERIC
# reboot

Login: root
password: password

# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a

# cd /usr/src
# mergemaster -p
# make installworld
# mergemaster
# reboot

Login: root
password: password

# cd /usr/src
# make clean

Update ports now

# pkg_add -r portupgrade
# /usr/local/bin/portupgrade -a

Adding applications

# pkg_add -r portaudit
# pkg_add -r zsh
# pkg_add -r wget
# pkg_add -r screen

If pkg_add -r screen fails try the following

# cd /usr/ports/sysutils/screen
# make install clean

# pkg_add -r sudo
# pkg_add -r pcre

# cd /root/scripts
# ee check-ports.sh

Write the following

#!/bin/sh
#check ports
/usr/local/sbin/portaudit -Fda


Save and Quit [ esc a a ]

# chmod +x check-ports.sh

Δεν υπάρχουν σχόλια: