Short HOWTO/FAQ for FreeBSD 9 (Tutorial: How to leave paradi


================================================
How to leave paradise and become a deamon?
================================================

Hi "Angels" and "Demons",
today I would like to share with you some of my HOWTO/FAQ.
For several years I have been studying FreeBSD, and it is my notes for myself. I want to share this with you. Perhaps. this is to answer some questions beginners FreeBSD Angels.

P.S. Sorry for my bad English.
P.P.S. If you find something interesting, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Content

HOWTO
1. Introduction in FreeBSD HOWTO.
2. Installing and configure FreeBSD.
. . 2.1. Create FreeBSD Live USB.
. . . . 2.1.1. Create FreeBSD Live USB (method of FreeBSD Developers).
. . . . 2.1.2. Create FreeBSD Live USB (method of VALSORYM).
. . 2.2. Partitioning a hard disk.
. . . . 2.2.1. Using gpart tool and UFS + J file system.
. . . . 2.2.2. Using fdisk tool and UFS + J file system.
. . 2.3. Installing FreeBSD 9.0.
. . . . 2.3.1. Installing FreeBSD on the UFS file system.
3. Configuration FreeBSD after install.
. . 3.1. Initial setup.
. . . . 3.1.1. Setting the date and time.
. . . . 3.1.2. Setting up the directory structure.
. . . . 3.1.3. Configure the bootloader menu.
. . . . 3.1.4. Customize text greetings.
. . 3.2. User management.
. . . . 3.2.1. Create, remove users account.
. . 3.3. Network configuration.
. . . . 3.3.1. Configuring the Ethernet.
. . . . 3.3.2. Configuration the WiFi (Intel adapter).
. . . . 3.3.3. Setting up SSH access.
. . 3.4. Install additional system files.
. . . . 3.4.1. Installing the Ports Collection.
. . . . 3.4.2. Installing FreeBSD source code.
. . 3.5. Fine-tuning FreeBSD.
. . . . 3.5.1. Build FreeBSD world.
. . . . 3.5.2. FreeBSD Kernel Configuration.
. . . . 3.5.3. Setting graphics mode in the console.
. . . . 3.5.4. Eliminating of demons cries.
. . . . 3.5.5. Check after crash disk.
. . . . 3.5.6. Locale UTF-8.
. . . . 3.5.7. Tuning and drivers.
. . 3.6. Additional settings.
. . . . 3.6.1. Configuring Sound Card.
. . . . 3.6.2. Configuring Xorg.
. . . . 3.6.3. Configuring nVidia Video Card.
. . . . 3.6.4. Configuring Intel Video Card.
4. Install and uninstall FreeBSD software.
. . 4.1. General theory.
. . . . 4.1.1. Finding application.
. . . . 4.1.2. Installation of the packages.
. . . . 4.1.3. Installation of the ports collections.
. . . . 4.1.4. Uninstall programs and clean debris.
. . 4.2. Installing the required software.
. . . . 4.2.1. Script automatic software installation (only from port collections).
. . 4.3. Setting up of special software.
. . . . 4.3.1. Databases MySQL55.
. . . . 4.3.2. Devel Ruby-Gems.
. . . . 4.3.3. Dynamic DNS.
. . . . 4.3.4. Editor Vim.
. . . . 4.3.5. Lang Python27 and Django.
. . . . 4.3.6. Sysutils Tmux.
. . . . 4.3.7. Web Server Apache22.
. . . . 4.3.8. Web Server Nginx.
. . . . 4.3.9. X11 Dwm (Part 1). . . . (Part 2).
. . . . 4.3.10. X11 Kde4.
. . . . 4.3.11. X11 Xcompmgr.
. . . . 4.3.12. X11 Xfce4.
5. Backup FreeBSD system.
. . 5.1. Backup of system.
. . . . 5.1.1. Dump and Restore.
. . 5.2. Backup of software.
. . . . 5.2.1. Create local repository.

FAQ
1. Databases
. . 1.1. MySQL.
. . . . 1.1.1. Short MySQL FAQ (Part 1).. . . (Part 2).
2. Programming
. . 2.1. Ruby.
. . . . 2.1.1. Ruby.
. . . . . . 2.1.1.1 Devel Ruby-Gems.
. . . . 2.1.1. RoR.
. . . . . . 2.1.1.1. Install Rails Framework.
. . . . . . 2.1.1.2. Create first RoR app.

........
 
2.1.1. Create FreeBSD Live USB (method of FreeBSD Developers

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Create FreeBSD Live USB (method of FreeBSD Developers).
=============================================================================
-----------------------------------------------------------------------------
Note.
-----------------------------------------------------------------------------
    For use this method, you must have already installed FreeBSD any version,
    or run system with FreeBSD Live CD. If system run with FreeBSD Live CD
    you can use extra memory stick for downloading files that we need.

-----------------------------------------------------------------------------
Create FreeBSD Live USB.
-----------------------------------------------------------------------------
  I.Download FreeBSD-9.0-RELEASE-i386-memstick.img image file.
    1.  Create temporary folder.
        # mkdir ~/freebsd
        # cd ~/freebsd
        
    2.  Download a FreeBSD image file.
        A.  Download use csh interpreter capabilities.
            # set host = "ftp://ftp.freebsd.org/pub/FreeBSD/releases/"
            # set release = "i386/i386/ISO-IMAGES/9.0/"
            # set img = "FreeBSD-9.0-RELEASE-i386-memstick.img"
            # fetch $host$release$img
            # unset host release img
        
        B.  Fast download.
            **  Remove all space characters in this URL.
            # fetch "ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/
                        ISO-IMAGES/9.0/FreeBSD-9.0-RELEASE-i386-memstick.img"

 II.Preparation of USB Flash Drive.
    Connect our USB Flash device and clear it.
    **  Assume that our USB Flash drive was defined as: /dev/da0.
    # dd if=/dev/zero of=/dev/da0 bs=64k

III.Create FreeBSD Live USB 9.0.
    Record the FreeBSD image file on our USB Flash device.
    # dd if=./FreeBSD-9.0-RELEASE-i386-memstick.img of=/dev/da0 bs=64k
    
 IV.Rewrite system parameters of our FreeBSD Live USB.
    Added opportunity write in root, and others sectors on Live USB.
    **  Now our flash drive has a slice: /dev/da0a.
    # moutn -t ufs /dev/da0a /mnt
    # set cmd = "/dev/ufs/FreeBSD_Install / ufs rw,noatime 1 1"
    # echo $cmd > /mnt/etc/fstab
    # unset cmd

    **  During markup of the disc, we will use the 4k alignment blocks. You
        must add the appropriate data to your FreeBSD Live USB. Assume that
        our HDD drive was defined as /dev/ada0 - is the drive on which
        we will be installing FreeBSD in the future, then:
        # vi /mnt/boot/loader.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + HDD.
kern.cam.ada.0.quirks="1"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  V.Finish.
    Unmount all parts and restart your computer.
    **  After load real system rewrite root password use passwd tool.
    # cd /
    # umount /mnt
    # shutdown -r now

=============================================================================
                                                             Author: valsorym
 
2.1.2. Create FreeBSD Live USB (method of VALSORYM).

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Create FreeBSD Live USB (method of VALSORYM).
=============================================================================
-----------------------------------------------------------------------------
Note.
-----------------------------------------------------------------------------
    For use this method, you must have already installed FreeBSD any version,
    or run system with FreeBSD Live CD. If system run with FreeBSD Live CD
    you can use extra memory stick for downloading files that we need.

-----------------------------------------------------------------------------
Required tools.
-----------------------------------------------------------------------------
  I.CD/DVD disk FreeBSD 9.0 or it ISO file.
    Our device: /cdrom.

 II.USB Flash Drive.
    **  In this example, we will use USB Flash drive 4G or more size.
    Our device: /dev/da0.

-----------------------------------------------------------------------------
Create partition on our USB Flash device.
-----------------------------------------------------------------------------
  I.Create new partitions.
    1.  Clean our Flash device.
        **  We use dd tool for clean our USB Flash device.
        # dd if=/dev/zero of=/dev/da0 bs=64k

    2.  Create a partitions.
        **  I want to create an universal device. USB Flash Drive must have a
            part that will store  personal information and this slice must be
            mounted in a working system. Accordingly, we use next partition:

                            +-------+------+-------+
                            | Label | Size |  F/S  |
                            |-------+------+-------|
                            | root  |   2G |  UFS  |
                            | heap  |    * |  UFS  |
                            +-------+------+-------+

        **  If your USB Flash Drive 8G or more - you can make the root
            partition size to 4G.
            
        **  The heap it is our special part for personal and system data.
            This part we will be mounted in /mnt/heap.

        # fdisk -BI /dev/da0
        # bsdlabel -w -B /dev/da0s1
        # bsdlabel -e /dev/da0s1

    3.  Use your editor (default vi editor) and edit open file:
        **  Not in any way not alter or delete the "c" label.

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# /dev/da0s1:
8 partitions:
#          size  offset   fstype  [fsize bsize bps/cpg]
    a:       2G      16   4.2BSD        0   0    # usbroot
    b:        *       *   4.2BSD        0   0    # usbheap
    c:  7823592       0   unused        0   0    # "raw" part, don't edit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    4.  Check the results of markup partitions.
        # ls /dev/ | grep ^da0
        da0
        da0s1
        da0s1a
        da0s1b
        
        **  If you do not see anything like it, open file again and remove
            your errors:
            # bsdlabel -e /dev/da0s1

    5.  Formatting an all parts.
        # newfs -L usbroot -U /dev/da0s1a
        # newfs -L usbheap -U /dev/da0s1b

 II.Mount a parts.
    1.  Partition.
        # mount /dev/ufs/usbroot /mnt
        # mkdir -p /mnt/heap
        # mount /dev/ufs/usbheap /mnt/heap
        
    2.  Create additional folders.
        # cd /mnt
        # mkdir -p tmp var
        # chmod 1777 tmp

-----------------------------------------------------------------------------
Install FreeBSD 9.0.
-----------------------------------------------------------------------------
  I.Unpack the system on our USB Flash device.
    1.  Choose the directory with the installation system files.
        A.  On the installation CD/DVD disk FreeBSD 9.0 or it ISO file you
            need unpack the installation files to our FreeBSD Live USB.
            # mkdir -p /cdrom
            # mount -t cd9660 -o -e /dev/cd0 /cdrom
            # cd /cdrom/usr/freebsd-dist/
        
        B.  If you boot the system from FreeBSD Live CD just go to the
            /usr/freebsd-dist/ directory.
            # cd /usr/freebsd-dist/

    2.  Install the base operating system FreeBSD 9.0.
        A.  Unpack use csh interpreter capabilities.
            # foreach file (base.txz kernel.txz)
            ?     cat $file | tar --unlink -xpJf - -C /mnt
            ? end
                
        B.  Hand mode unpack.
            # cat base.txz | tar --unlink -xpJf - -C /mnt
            # cat kernel.txz | tar --unlink -xpJf - -C /mnt

        **  If you use FreeBSD 9.0/amd64 unpack too:
            # cat lib32.txz | tar --unlink -xpJf - -C /mnt

        **  You can unpack other files: doc.txz, ports.txz, src.txz - but
            this is not necessary.

 II.In order for our USB Flash drive had the status of "installation" - you
    must copy the installation files.
    1.  Copy system files.
        # mkdir -p /mnt/heap/freebsd/source/9.0/i386
        
        A.  If you use a CD/DVD Rom.
            # cd /cdrom/usr/freebsd-dist/
            # cp -R ./* /mnt/heap/freebsd/source/9.0/i386/
        
        B.  If you use a FreeBSD Live CD.
            # cd /usr/freebsd-dist/
            # cp -R ./* /mnt/heap/freebsd/source/9.0/i386/

    2.  Check the results.
        # ls /mnt/heap/freebsd/source/9.0/i386/
        MANIFEST    doc.txz     kernel.txz    src.txz
        base.txz    games.txz   ports.txz

    **  When we perform the installation of the system from USB Flash device,
        we will use these files.
        
III.Create a hard link to /usr/home/ directory.
    1. Create hard link.
        # cd /mnt
        # mkdir -p usr/home
        # ln -s usr/home home
        
    2.  Check the results.
        # cd  home
        # pwd
        /mnt/usr/home
    
 IV.Create /etc/fstab file on our USB Flash device.
    Open and rewrite /etc/fstab on our USB Flash device.
    # vi /mnt/etc/fstab
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/dev/ufs/usbroot        /           ufs     rw     1     1
/dev/ufs/usbheap        /heap/      ufs     rw     0     0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

-----------------------------------------------------------------------------
At the end of.
-----------------------------------------------------------------------------
  I.Rewrite parameters of your FreeBSD Live USB. 
    **  During markup of the disc, we will use the 4k alignment  blocks. You
        must add the appropriate data to your FreeBSD Live USB. Assume that
        your HDD drive was defined as /dev/ada0 - is the drive on which
        we will be installing FreeBSD in the future, then:
        # vi /mnt/boot/loader.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + HDD.
kern.cam.ada.0.quirks="1"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    
 II.Unmounting all slices. 
    # cd /
    # umount /mnt/heap
    # umount /mnt

    **  If you used a CD not forget to unmount and it.
        # umount /cdrom
        
    **  If you can not unmount the partition, use the "-f" flag:
        # umount -f <MOUNT POINT>

III.Finish.
    Restart your computer and use your own FreeBSD Live USB.
    **  After load real system rewrite root password use passwd tool.
    # shutdown -r now

=============================================================================
                                                             Author: valsorym
 
2.2.1. Using gpart tool and UFS + J file system.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Partitioning a hard disk using a gpart tool. File system: ufs + journal.
=============================================================================
-----------------------------------------------------------------------------
Create partition on your HDD.
-----------------------------------------------------------------------------
  I.Run our FreeBSD Live USB.
    **  In your BIOS choose option boot from USB Flash device or use F12 key
        to select the boot method.

 II.Check the settings.
    **  Assume that our HDD was defined as: /dev/ada0.
    **  If you use 4k sector size alignment and added 'kern.cam.ada.0.quirks'
        in your /boot/loader.conf, you should get the following result:
        # geom disk list ada0
        Geom name: ada0
        Providers:
        1. Name: ada0
            ...
            Stripesize: 4096
            ...

        We can see "Stripesize: 4096", else you see "Stripesize: 512" bytes.

III.Destroy all partitions of our HDD.
    A.  Step by step.
        # gpart show ada0
        =>      63 312581745 ipsd0 MBR  (298G)        
                63  11293632     1 !12 [active]  (5.4G)   
        11293695 301288113       - free -  (298G)

        In this example we have a single partition.
        # gpart delete -i 1 ada0

        **  If you have some others partition (2, 3, 4 ... 128) - remove it.
            If you do not do this - you can not run 'gpart destroy ada0'. You
            will receive a message: "Device busy!".
            # gpart delete -i 2 ada0
            # gpart delete -i 3 ada0
            ...
            # gpart delete -i 128 ada0

        Delete MBR sector or other old scheme partition.
        # gpart destroy ada0

    B.  All at once.
        For the rapid destruction of sections, use:
        # gpart destroy -F ada0

 IV.Create new partition scheme on our HDD.
    **  We will be use the partitioning scheme GPT.

    1.  Create GPT scheme.
        # gpart create -s GPT ada0

    2.  Partitioning.
        **  We use the alignment of 4k - it is "-a" flag.
        **  If you plan to install packages such as LibreOffice or
            KDE/Gnome2/Xfce4 - for the /usr partition is better to 
            allocate 24G.
        # gpart add -s 512k -a 4k -t freebsd-boot -l "boot" ada0
        # gpart add -b 1m -s 2g -a 4k -t freebsd-ufs -l "root" ada0
        # gpart add -s 4g -a 4k -t freebsd-swap -l "swap" ada0
        # gpart add -s 4g -a 4k -t freebsd-ufs -l "var" ada0
        # gpart add -s 4g -a 4k -t freebsd-ufs -l "tmp" ada0
        # gpart add -s 16g -a 4k -t freebsd-ufs -l "usr" ada0
        # gpart add -s 8g -a 4k -t freebsd-ufs -l "home" ada0
        # gpart add -a 4k -t freebsd-ufs -l "heap" ada0

        **  We have created a small home part because of all the personal
            data we store in the heap part.

    3.  Check result.
        **  It should look something like this.
        # gpart show ada0
        =>       34  250069613  ada0  GPT  (119G)
                 34          6        - free -  (3.0k)
                 40       1024     1  freebsd-boot  (512k)
               1064    4194304     2  freebsd-ufs  (2.0G)
            4195368    8388608     3  freebsd-swap  (4.0G)
           12583976    8388608     4  freebsd-ufs  (4.0G)
           20972584    8388608     5  freebsd-ufs  (4.0G)
           29361192   33554432     6  freebsd-ufs  (16G)
           62915624   16777216     7  freebsd-ufs  (8.0G)
           79692840  170376800     8  freebsd-ufs  (81G)
          250069640          7        - free -  (3.5k)

    4.  Install the boot loader.
        **  The boot partition is placed first on the list so we use: "-i 1".
        # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0

    5.  Checking the alignment.
        **  It should look something like this.
        # diskinfo -v ada0 | grep stripesize
                4096            # stripesize
        # diskinfo -v ada0 | grep "stripeoffset"
                0               # stripeoffset

        **  If <stripoffset> % <stripsize> equal zero - all good.
            # echo 0%4096 | bc
            0

  V.Create new file system.
    **  Use journaling filesystem: UFS+J.
    # newfs -j /dev/gpt/root
    # newfs -j /dev/gpt/var
    # newfs -j /dev/gpt/tmp
    # newfs -j /dev/gpt/usr
    # newfs -j /dev/gpt/home
    # newfs -j /dev/gpt/heap

 VI.Mount all parts for our system.
    # mkdir -p /mnt/hdd/a
    # mount /dev/gpt/root /mnt/hdd/a
    # cd /mnt/hdd/a
    # mkdir -p boot var tmp usr

    # chmod 1777 tmp
    
    # mount /dev/gpt/var /mnt/hdd/a/var
    # mount /dev/gpt/tmp /mnt/hdd/a/tmp
    # mount /dev/gpt/usr /mnt/hdd/a/usr
    
    # mkdir -p /mnt/hdd/a/usr/home
    # mount /dev/gpt/home /mnt/hdd/a/usr/home
    # cd /mnt/hdd/a
    # ln -s usr/home home
    
    # mkdir -p /mnt/hdd/a/heap
    # mount /dev/gpt/heap /mnt/hdd/a/heap
    # touch /mnt/hdd/a/heap/heap.ok

=============================================================================
                                                             Author: valsorym
 
2.2.2. Using fdisk tool and UFS + J file system.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Partitioning a hard disk using a fdisk tool. File system: ufs + journal.
=============================================================================
-----------------------------------------------------------------------------
Create partition on your HDD.
-----------------------------------------------------------------------------
  I.Run our FreeBSD Live USB.
    **  In your BIOS choose option boot from USB Flash device or use F12 key
        to select the boot method.

 II.Check the settings.
    **  Assume that our HDD was defined as: /dev/ada0.
    **  If you use 4k sector size alignment and added 'kern.cam.ada.0.quirks'
        in your /boot/loader.conf, you should get the following result:
        # geom disk list ada0
        Geom name: ada0
        Providers:
        1. Name: ada0
            ...
            Stripesize: 4096
            ...
            
        We can see "Stripesize: 4096", else you see "Stripesize: 512" bytes.

III.Destroy all partitions of our HDD.
    # dd if=/dev/zero of=/dev/ada0 bs=64k

 IV.Create new partition scheme on our HDD.
    **  We will use the partitioning scheme MBR.

    1.  Create MBR scheme and boot sector.
        # fdisk -BI /dev/ada0
        # bsdlabel -w -B /dev/ada0s1
        # bsdlabel -e /dev/ada0s1

    2.  Use your editor (default vi) and edit open file:
        **  Not in any way not alter or delete the "c" label.
        **  If you plan to install packages such as LibreOffice or
            KDE/Gnome2/Xfce4 - for the /usr partition is better to 
            allocate 24G.

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# /dev/ada0s1:
8 partitions:
#           size  offset   fstype  [fsize bsize bps/cpg]
    a:        2G      16   4.2BSD        0   0    # root
    b:        4G       *     swap                 # swap
    c: 625142369       0   unused        0   0    # "raw" part, don't edit
    d:        4G       *   4.2BSD                 # var
    e:        4G       *   4.2BSD                 # tmp
    f:       16G       *   4.2BSD                 # usr
    g:        8G       *   4.2BSD                 # home
    h:         *       *   4.2BSD                 # heap
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    3.  Check the results of markup partitions.
        # ls /dev/ | grep ^ada0
        ada0        ada0s1e
        ada0s1      ada0s1f
        ada0s1a     ada0s1g
        ada0s1b     ada0s1h
        ada0s1d

        **  If you do not see anything like it, open file again and remove
            your errors:
            # bsdlabel -e /dev/ada0s1

    4.  Formatting an all partitions:
        # newfs -L root -j /dev/ada0s1a
        # glabel label swap /dev/ada0s1b
        # newfs -L var -j /dev/ada0s1d
        # newfs -L tmp -j /dev/ada0s1e
        # newfs -L usr -j /dev/ada0s1f
        # newfs -L home -j /dev/ada0s1g
        # newfs -L heap -j /dev/ada0s1h

  V.Mount all parts in our system.
    # mkdir -p /mnt/hdd/a
    # mount /dev/ufs/root /mnt/hdd/a
    
    # cd /mnt/hdd/a 
    # mkdir -p boot var tmp usr
    # chmod 1777 tmp
    # cd ~/
    
    # mount /dev/ufs/var /mnt/hdd/a/var
    # mount /dev/ufs/tmp /mnt/hdd/a/tmp
    # mount /dev/ufs/usr /mnt/hdd/a/usr

    # mkdir -p /mnt/hdd/a/usr/home
    # mount /dev/ufs/home /mnt/hdd/a/usr/home
    # cd /mnt/hdd/a
    # ln -s usr/home home

    # mkdir -p /mnt/hdd/a/heap
    # mount /dev/ufs/heap /mnt/hdd/a/heap
    # touch /mnt/hdd/a/heap/heap.ok

=============================================================================
                                                             Author: valsorym
 
2.3.1. Installing FreeBSD on the UFS file system.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Installing FreeBSD 9.0/i386 on the UFS file system.
=============================================================================
-----------------------------------------------------------------------------
Note!
-----------------------------------------------------------------------------
    Before installing, make sure that you mount your HDD in accordance with
    our method of partitioning.

    **  It is assumed that you have used the method of partitioning gpart or
        fdisk to UFS + J file system.

    **  It is assumed that the operating system is running with the our
        FreeBSD Live USB.

-----------------------------------------------------------------------------
Install FreeBSD 9.0/i386.
-----------------------------------------------------------------------------
  I.Install a system.
    # cd /heap/freebsd/source/9.0/i386/
    
    A.  Unpack use csh interpreter capabilities.
        # foreach file (base.txz kernel.txz)
        ?     cat $file | tar --unlink -xpJf - -C /mnt/hdd/a
        ? end

    B.  Hand mode unpack.
        # cat base.txz | tar --unlink -xpJf - -C /mnt/hdd/a
        # cat kernel.txz | tar --unlink -xpJf - -C /mnt/hdd/a
    
    **  If you use FreeBSD 9.0/amd64 unpack too:
        # cat lib32.txz | tar --unlink -xpJf - -C /mnt/hdd/a
        
    **  If you want, unpack other files: doc.txz, ports.txz, src.txz, - but
        this is not necessary.

 II.Create /etc/fstab file.
    Open /mnt/hdd/a/etc/fstab file, and write it:
    
    A.  If you use gpart for partition your HDD.
        # vi /mnt/hdd/a/etc/fstab

    **  procfs (or the proc filesystem) is a special filesystem in UNIX-like
        operating systems that presents information about processes and other
        system information in a hierarchical file-like structure, providing a
        more convenient and standardized method for dynamically accessing
        process data held in the kernel than traditional tracing methods or
        direct access to kernel memory.

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/dev/gpt/swap   none        swap    sw      0   0
/dev/gpt/root   /           ufs     rw      1   1
/dev/gpt/var    /var        ufs     rw      0   0
/dev/gpt/tmp    /tmp        ufs     rw      0   0
/dev/gpt/usr    /usr        ufs     rw      0   0
/dev/gpt/home   /home       ufs     rw      0   0
/dev/gpt/heap   /heap       ufs     rw      0   0
proc            /proc       procfs  rw      0   0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    B.  If you use fdisk and bsdlabel for partition your HDD.
        # vi /mnt/hdd/a/etc/fstab

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/dev/ada0s1b    none        swap    sw      0   0
/dev/ufs/root   /           ufs     rw      1   1
/dev/ufs/var    /var        ufs     rw      0   0
/dev/ufs/tmp    /tmp        ufs     rw      0   0
/dev/ufs/usr    /usr        ufs     rw      0   0
/dev/ufs/home   /home       ufs     rw      0   0
/dev/ufs/heap   /heap       ufs     rw      0   0
proc            /proc       procfs  rw      0   0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

III.Unmount all parts and reboot our computer.
    1.  Unmount all parts.
        # cd /
        # umount /mnt/hdd/a/heap
        # umount /mnt/hdd/a/usr/home
        # umount /mnt/hdd/a/usr
        # umount /mnt/hdd/a/tmp
        # umount /mnt/hdd/a/var
        # umount /mnt/hdd/a
    
    2.  Reboot our computer.
        # shutdown -r now

    **  If you can not unmount the partition, use the "-f" flag:
        # umount -f <MOUNT POINT>

    **  Do not forget to disconnect the USB Flash or change the settings in
        your BIOS.
        
    **  After load real system rewrite root password use passwd tool.
    
=============================================================================
                                                             Author: valsorym
 
3.1.1. Setting the date and time.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Setting the date and time.
=============================================================================
-----------------------------------------------------------------------------
Hand installing.
-----------------------------------------------------------------------------
  I.Use date tools and tzsetup.
    **  To set the date and time need to be root.
    **  Date has format: yymmddhhss
        + yy - year
        + mm - month.
        + dd - day.
        + hh - hour.
        + ss - minute.
        
    A.  Setup time zone.
        **  Use tzsetup manager and setting your time zone.
        # tzsetup
        
    B.  Setting date and time.
        **  For example: 17:29 17.08.2012
        # date 201208171729

        **  For example too: 17:29 17.08.2012
        # date 1208171729

    C.  Setting only time.
        **  Set the time without having to modify the date - hours:minutes.
        **  For example: 17:30
        # date 1730

=============================================================================
                                                             Author: valsorym
 
3.1.2. Setting up the directory structure.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Setting up the directory structure.
=============================================================================
-----------------------------------------------------------------------------
Directories to mount.
-----------------------------------------------------------------------------
  I.Create a mount directory.
    # foreach i (hdd cdrom usb)
    ?     foreach j (a b c)
    ?         mkdir -p /mnt/$i/$j
    ?     end
    ? end
        
    **  Where is:
        + /mnt/cdrom/[a,b,c] - for the first, second and third CD/DVD-Rom.
        + /mnt/hdd/[a,b,c] - for the first, second and third HDD.
        + /mnt/usb/[a,b,c] - for the first, second and third USB Device.

=============================================================================
                                                             Author: valsorym
 
3.1.3. Configure the bootloader menu.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Configure the bootloader menu.
=============================================================================
-----------------------------------------------------------------------------
Disable boot loader menu.
-----------------------------------------------------------------------------
  I.Add to /boot/loader.conf.
    # vi /boot/loader.conf
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Bootloader menu.
autoboot_delay="7"
beastie_disable="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    **  Where is:
        + autoboot_delay    - delay time (seconds) to automatically loading.
        + beastie_disable   - disable menu (YES).

=============================================================================
                                                             Author: valsorym
 
3.1.4. Customize text greetings.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Customize text greetings.
=============================================================================
-----------------------------------------------------------------------------
Create new text greetings.
-----------------------------------------------------------------------------
  I.Modified greetings file.
    # vi /etc/motd

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Welcome to FreeBSD!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    **  You can write your text greetings or use ASCII Art pic.

=============================================================================
                                                             Author: valsorym
 
3.2.1. Create, remove users account.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Create, remove users account.
=============================================================================
-----------------------------------------------------------------------------
The general theory.
-----------------------------------------------------------------------------
  I.Software for account management.
    1. adduser(8) - add new users.
    2. rmuser(8) - remove user.
    3. chpass(1) - change the information in the user database.
    4. passwd(1) - change user passwords.
    5. pw(8) - change any information associated with user account.

-----------------------------------------------------------------------------
Blowfish hash function.
-----------------------------------------------------------------------------
  I.Enable the Blowfish hash function instead of the default aging MD5
    algorithm.
    # vi /etc/auth.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# BLOWFISH
# + Enable Blowfish hash function.
crypt_default=blf
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    # vi /etc/login.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...
default:\
    :passwd_format=blf:\
    :copyright=/etc/COPYRIGHT:\
...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
**  Modified passwd_format=sha512 to passwd_format=blf.

 II.Rebuild the login database with cap_mkdb /etc/login.conf, then set your
    new blf-hashed root password with passwd.
    # cap_mkdb /etc/login.conf
    # passwd

-----------------------------------------------------------------------------
Adding new user.
-----------------------------------------------------------------------------
  I.Hand mode use adduser tool.
    **  Then the answer to several questions.
    **  Better use of next group: wheel,operator,man,ftp,sshd,www.
    # adduser
    ...

 II.Use automatic mode.
    1.  Create chs script.
        # vi ~/newuser.csh

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#!/bin/csh
# 1.  User name.
# 2.  User ID, UserID, must be unique in the system, that is, to choose
#     one that is not used for convenience, you can  leave it blank, ID
#     will be assigned automatically.
# 3.  Group ID, GroupID, it satisfies all of the above UserID.
# 4.  User class we leave the field blank, will be assigned the default
#     class.
# 5.  Validity user password.
# 6.  Validity of a user account.
# 7.  The full name of the user.
# 8.  The home directory.
# 9.  The shell as in the case of creating an interactive user, you can
#     choose from several, or prohibit the  use of nologin, I appointed
#     all the different.
# 10. The user password.

set user = 'USERNAME'
set pswd = 'USERPASSWORD'
set efile = '/tmp/newuser.txt'
set group = 'wheel'

echo "${user}:::::::/usr/home/${user}:/bin/csh:${pswd}" > $efile

adduser -f $efile
pw usermod $user -G $group
rm -f $efile

exit(0)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run the script.
        # csh ~/newuser.csh

-----------------------------------------------------------------------------
Change the user group.
-----------------------------------------------------------------------------
  I. Use pw tool.
    **  You can use the following Group.
        The database of user group (text file): /etc/group.
        * "wheel" allows you to switch to root user.
        * "operator" can  work with devices from  not use root user.
        * [wheel,dialer,operator,man,ftp,sshd,www,network].

    Example, add user to wheel group.
    # pw usermod <USERNAME> -G wheel

-----------------------------------------------------------------------------
Delete user.
-----------------------------------------------------------------------------
  I.Using rmuser tool.
    # rmuser <USERNAME>
    Matching password entry:
    ...

=============================================================================
                                                             Author: valsorym
 
3.3.1. Configuring the Ethernet.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Configuring the Ethernet.
=============================================================================
-----------------------------------------------------------------------------
Search for equipment.
-----------------------------------------------------------------------------
  I.Search Ethernet controller.
    # ifconfig
    iwn0:   flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
            ether 00:21:6a:26:34:c0
            nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
            media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
            status: no carrier
    bge0:   flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
            ether 00:21:b9:26:85:2a
            nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
            media: Ethernet autoselect (100baseTX <full-duplex>)
            status: no carrier
    lo0:    flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
            options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
            inet6 ::1 prefixlen 128
            inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
            inet 127.0.0.1 netmask 0xff000000
            nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

    **  In the "media" we are interested in the inscription: "Ethernet
        autoselect". Thus, our ethernet device - bge0.

    **  You can have: re0, eth0, bge0, etc ...

-----------------------------------------------------------------------------
Setting up configuration files.
-----------------------------------------------------------------------------
  I.Add to file /etc/rc.conf.
    A.  If our router IP: 192.168.1.1, Machine IP: 192.168.1.33
        # vi /etc/rc.conf 

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# NETWORK
# + Main.
hostname="bsd"
defaultrouter="192.168.1.1"

# + Ethernet.
ifconfig_bge0="inet 192.168.1.33 netmask 255.255.255.0"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    B.  If you use DHCP.
        # vi /etc/rc.conf 

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# NETWORK
# + Main.
hostname="bsd"
defaultrouter="192.168.1.1"

# + Ethernet.
ifconfig_bge0="DHCP"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 II.Restart network connect.
    # /etc/rc.d/netif restart && /etc/rc.d/routing restart

=============================================================================
                                                             Author: valsorym
 
3.3.2. Configuration the WiFi (Intel adapter).

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Configuration the WiFi (adapter Intel).
=============================================================================
-----------------------------------------------------------------------------
WiFi configuration.
-----------------------------------------------------------------------------
  I.FreeBSD 9.0 has iwn driverin GENERIC kernel.
    1.  Determine the device.
        **  So, We use WPA2 crypts, router IP: 192.168.1.1, Machine IP: DHCP
        # ifconfig
        ...
        iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>
        metric 0 mtu 2290
            ether dc:a9:71:7b:cb:3b
            nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
            media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
            status: associated
        ...

        **  Our WiFi adapter - iwn0, because in the "media" is written:
            "IEEE 802.11 Wireless Ethernet".
        
    2.  Configuration rc.conf.
        **  We use DHCP.
        # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# NETWORK
# + Main.
hostname="bsd"
defaultrouter="192.168.1.1"

# + WiFi.
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    3.  Configuration wpa_supplicant.conf.
        **  SSID in your WiFi adapter should be visible.
        # vi /etc/wpa_supplicant.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
network={
    ssid="<WIFI SSID NAME>"
    psk="<WIFI PASSWORD>"
}
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    4.  Restart network connect.
        # /etc/rc.d/netif restar && /etc/rc.d/routing restart

=============================================================================
                                                             Author: valsorym
 
3.3.3. Setting up SSH access.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Setting up SSH access.
=============================================================================
-----------------------------------------------------------------------------
Enabling sshd.
-----------------------------------------------------------------------------
  I.In FreeBSD, sshd daemon must be enabled during installation.
    1.  Modified rc.conf.
        # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# NETWORK
# + SSH.
sshd_enable="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run sshd.
        # /etc/rc.d/sshd start

        **  sshd configuration in /etc/ssh/sshd_config. After making changes:
            # /etc/rc.d/sshd reload
       
 II.In /etc/ssh/sshd_config uncomment and edit the following string.
    1.  Modified sshd_config.
        # vi /etc/ssh/sshd_config
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Port 22
Protocol 2
PasswordAuthentication yes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Reload options:
        # /etc/rc.d/sshd reload
        
-----------------------------------------------------------------------------
Open access to root user.
-----------------------------------------------------------------------------
    **  Attention! It is not safe! Use any other account to connect via SSH.
        Do not use the root account.

  I.In /etc/ssh/sshd_config uncomment and edit the following string.
    1.  Modified sshd_config.
        # vi /etc/ssh/sshd_config
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PermitRootLogin yes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Reload options.
        # /etc/rc.d/sshd reload

=============================================================================
                                                             Author: valsorym
 
3.4.1. Installing the Ports Collection.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Installing the Ports Collection.
=============================================================================
-----------------------------------------------------------------------------
Install the ports collection.
-----------------------------------------------------------------------------
  I.Installing the Ports Collection from the Internet.
    A.  The first method - use a portsnap utility.
        # /usr/sbin/portsnap fetch && /usr/sbin/portsnap extract

    B.  The second method - use a csup utility.
        1.  Create special file.
            # vi ~/ports-all

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*default host=cvsup3.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
*default compress
ports-all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        
        2.  Run it:
            # csup ~/ports-all

=============================================================================
                                                             Author: valsorym
 
3.4.2. Installing FreeBSD source code.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Installing the source code, documentation, etc.
=============================================================================
-----------------------------------------------------------------------------
Installing FreeBSD source code.
-----------------------------------------------------------------------------
  I.Update all source code.
    1.  Create special file.
        # vi ~/src-all
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*default host=cvsup3.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_9_0
*default delete use-rel-suffix
*default compress
src-all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run it.
        # csup ~/src-all
    
-----------------------------------------------------------------------------
Installing FreeBSD Ports Collection.
-----------------------------------------------------------------------------
  I.Update the ports collection.
    1.  Create special file.
        # vi ~/ports-all
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*default host=cvsup3.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
*default compress
ports-all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run it.
        # csup ~/ports-all

-----------------------------------------------------------------------------
Installing FreeBSD documentation
-----------------------------------------------------------------------------
  I.Update the documentation.
    1.  Create special file.
        # vi ~/doc-all

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*default host=cvsup3.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_9_0
*default delete use-rel-suffix
*default compress
doc-all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run it.
        # csup ~/doc-all

=============================================================================
                                                             Author: valsorym
 
3.5.1. Build FreeBSD world.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Build FreeBSD world.
=============================================================================
-----------------------------------------------------------------------------
Download the source system tree.
-----------------------------------------------------------------------------
  I.Update all source code.
    1.  Create special file.
        **  If you want to download the latest source code, use: tag=RELENG_9
        # vi ~/src-all
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*default host=cvsup3.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_9_0
*default delete use-rel-suffix
*default compress
src-all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  Run it.
        # csup ~/src-all    

-----------------------------------------------------------------------------
Configure system files.
-----------------------------------------------------------------------------
  I.Configure /etc/make.conf, for example.
    # vi /etc/make.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# MAIN
# + Compiler options.
CPUTYPE?=nocona
CFLAGS=-O2 -fno-strict-aliasing -pipe

# + Ports.
PORTSDIR?=/usr/ports

# + Others.
MAKE_SHELL?=sh
NO_PROFILE=true

NO_CPU_CFLAGS=false
NO_CPU_COPTFLAGS=false

NO_SENDMAIL=true
NO_GAMES=true
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

-----------------------------------------------------------------------------
Starting single-user mode.
-----------------------------------------------------------------------------
  I.Modification of the configuration files.
    1.  Allow to show bootloader menu.
        # vi /boot/loader.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Bootloader menu.
autoboot_delay="7"
beastie_disable="NO"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 II.Starting single-user mode.
    1.  Reboot the system.
        # shutdown -r now
        
    2.  In bootloader menu select: "6. Boot [S]ingle User: NO".
    
III.In single-user mode.
    1.  Mount all partitions.
        # fsck -p
        # mount -u /
        # mount -a -t ufs
        # swapon -a
        
    2.  Remove /usr/obj.
        # cd /usr/obj
        # chflags -R noschg *
        # rm -rf *
        
-----------------------------------------------------------------------------
Build world.
-----------------------------------------------------------------------------
  I.Build world.
    1.  Build world.
        # cd /usr/src
        # make -j4 buildworld
        
    2.  Necessarily build and install kernel again.
        **  My kernel has name: ADAMO13KERNEL86
        **  Necessarily read HOWTO: "FreeBSD Kernel Configuration".

        A.  Hand mode:
            # cd /usr/src/
            # make buildkernel KERNCONF=ADAMO13KERNEL86
            # make installkernel KERNCONF=ADAMO13KERNEL86

        B   Automatic mode:
            # cd /usr/src/
            # foreach cmd (buildkernel installkernel)
            ?     make $cmd KERNCONF=ADAMO13KERNEL86
            ? end

    3.  Install world.
        # make installworld
        
    4.  Output of single-user mode.  
        # reboot now
    
        **  After the login in multi-user mode, do not forget to change
            the settings in /boot/loader.conf.

=============================================================================
                                                             Author: valsorym
 
3.5.2. FreeBSD Kernel Configuration.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    FreeBSD Kernel Configuration.
=============================================================================
-----------------------------------------------------------------------------
Note.
-----------------------------------------------------------------------------
    Make sure that the kernel source installed.

-----------------------------------------------------------------------------
Backup original kernel.
-----------------------------------------------------------------------------
  I.Backup old kernel.
    # cp -R /boot/kernel /boot/kernel.generic
    
    **  If after rebuild your kernel your computer can not run:
        1. Start your FreeBSD Live USB.
        2. Mount root part:
            A.  If you used gpart for installation FreeBSD.
                # mkdir -p /mnt/hdd/a
                # mount /dev/gpt/root /mnt/hdd/a
              
            B.  If you used fdisk for installation FreeBSD.
                # mkdir -p /mnt/hdd/a
                # mount /dev/ufs/root /mnt/hdd/a

        3.  Remove bad kernel and install the old kernel.
            # chflags -R noschg /boot/kernel/
            # rm -R /boot/kernel
            # cp -R /boot/kernel.generic /boot/kernel
              
        4.  Reboot FreeBSD Live USB system.
            # shutdown -r now

-----------------------------------------------------------------------------
Rebuilding new kernel.
-----------------------------------------------------------------------------
    **  For example, add the kernel option "graphics mode in the console".
    
  I.Copy kernel file.
    **  Do not modify the standard kernel file. Copy original file and think
        sup new name for it, for example: ADAMO13KERNEL86.
        
    **  My laptop Dell Adamo 13, My FreeBSD system: i386.
        # mkdir -p /heap/freebsd/system/kernels
        # cd /usr/src/sys/i386/conf
        # cp GENERIC /heap/freebsd/system/kernels/ADAMO13KERNEL86
        # ln -s /heap/freebsd/system/kernels/ADAMO13KERNEL86

 II.Options.
    **  Add to your kernel next options:
        1. SC_PIXEL_MODE       - setting the graphics mode in the console.
        2. SC_NORM_ATTR        - text and background color.
        3. SC_KERNEL_CONS_ATTR - color kernel messages and background.

III.Modified kernel file.
    **  Rewrite conf file, add next strings to your kernel.
    # vi ADAMO13KERNEL86
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# Graphic mode
### options SC_PIXEL_MODE # [!] SC_PIXEL_MODE enabled by default in GENERIC.
options SC_NORM_ATTR=(FG_WHITE|BG_BLACK)
options SC_KERNEL_CONS_ATTR=(FG_RED|BG_BLACK)

# UTF8 support
options	VESA
options TEKEN_UTF8
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    **  Will be used white text on black background.
    **  Will be used red kernel message on a black background.

 IV.Rebuilding new kernel.
    A.  Hand mode:
        # cd /usr/src/
        # make buildkernel KERNCONF=ADAMO13KERNEL86
        # make installkernel KERNCONF=ADAMO13KERNEL86

    B.  Automatic mode:
        # cd /usr/src/
        # foreach cmd (buildkernel installkernel)
        ?     make $cmd KERNCONF=ADAMO13KERNEL86
        ? end
        
  V.Finish.
    Restart your computer.
    # shutdown -r now
        
    **  After reboot you should see something as follows:
        # uname -a
        FreeBSD adamo 9.0-RELEASE-p4 FreeBSD 9.0-RELEASE-p4 #0: Thu Aug 23
        05:46:28 UTC 2012 root@:/usr/obj/usr/src/sys/ADAMO13KERNEL86  i386
        
=============================================================================
                                                             Author: valsorym
 
3.5.3. Setting graphics mode in the console.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Setting graphics mode in the console.
=============================================================================
-----------------------------------------------------------------------------
Note.
-----------------------------------------------------------------------------
    Before you do this, make sure you add the options in your kernel:
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# Graphic mode
options SC_NORM_ATTR=(FG_WHITE|BG_BLACK)
options SC_KERNEL_CONS_ATTR=(FG_RED|BG_BLACK)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    **  Will be used white text on black background.
    **  Will be used red kernel message on a black background.

-----------------------------------------------------------------------------
Setting up configuration files.
-----------------------------------------------------------------------------
  I.Rewrite /boot/loader.conf and add this:
    # vi /boot/loader.conf
    
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# VIDEO
# + Graphic mode in console.
vesa_load="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 II.Rewrite /etc/rc.conf.
    # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# VIDEO
# + Graphic mode in console.
allscreens_flags="MODE_280"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    **  Need to boot the new kernel.
    **  You can't use vidcontrol via SSH.
    **  In order to know the available modes, use:
        # vidcontrol -i mode >> /tmp/gmode
        # less /tmp/gmode

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
     mode#     flags   type    size    font     window      linear   buffer
----------------------------------------------------------------------------
  0 (0x000) 0x00000001 T 40x25         8x8  0xb8000 32k 32k 0x00000000 32k
  1 (0x001) 0x00000001 T 40x25         8x8  0xb8000 32k 32k 0x00000000 32k
  2 (0x002) 0x00000001 T 80x25         8x8  0xb8000 32k 32k 0x00000000 32k
  3 (0x003) 0x00000001 T 80x25         8x8  0xb8000 32k 32k 0x00000000 32k
  4 (0x004) 0x00000003 G 320x200x2 C   8x8  0xb8000 32k 32k 0x00000000 32k
  5 (0x005) 0x00000003 G 320x200x2 C   8x8  0xb8000 32k 32k 0x00000000 32k
  6 (0x006) 0x00000003 G 640x200x1 C   8x8  0xb8000 32k 32k 0x00000000 32k
 13 (0x00d) 0x00000003 G 320x200x4 4   8x8  0xa0000 64k 64k 0x00000000 256k
 14 (0x00e) 0x00000003 G 640x200x4 4   8x8  0xa0000 64k 64k 0x00000000 256k
 16 (0x010) 0x00000003 G 640x350x2 2   8x14 0xa0000 64k 64k 0x00000000 128k
 18 (0x012) 0x00000003 G 640x350x4 4   8x14 0xa0000 64k 64k 0x00000000 256k
 19 (0x013) 0x00000001 T 40x25         8x14 0xb8000 32k 32k 0x00000000 32k
 20 (0x014) 0x00000001 T 40x25         8x14 0xb8000 32k 32k 0x00000000 32k
 21 (0x015) 0x00000001 T 80x25         8x14 0xb8000 32k 32k 0x00000000 32k
 22 (0x016) 0x00000001 T 80x25         8x14 0xb8000 32k 32k 0x00000000 32k
 23 (0x017) 0x00000001 T 40x25         8x16 0xb8000 32k 32k 0x00000000 32k
 24 (0x018) 0x00000001 T 80x25         8x16 0xb8000 32k 32k 0x00000000 32k
 26 (0x01a) 0x00000003 G 640x480x4 4   8x16 0xa0000 64k 64k 0x00000000 256k
 27 (0x01b) 0x00000003 G 640x480x4 4   8x16 0xa0000 64k 64k 0x00000000 256k
 28 (0x01c) 0x00000003 G 320x200x8 P   8x8  0xa0000 64k 64k 0x00000000 64k
 30 (0x01e) 0x00000001 T 80x50         8x8  0xb8000 32k 32k 0x00000000 32k
 32 (0x020) 0x00000001 T 80x30         8x16 0xb8000 32k 32k 0x00000000 32k
 34 (0x022) 0x00000001 T 80x60         8x8  0xb8000 32k 32k 0x00000000 32k
 37 (0x025) 0x00000003 G 320x240x8 V   8x8  0xa0000 64k 64k 0x00000000 256k
112 (0x070) 0x00000000 T 80x43         8x8  0xb8000 32k 32k 0x00000000 32k
113 (0x071) 0x00000001 T 80x43         8x8  0xb8000 32k 32k 0x00000000 32k
257 (0x101) 0x0000000f G 640x480x8 P   8x16 0xa0000 64k 64k 0xd0000000 300k
259 (0x103) 0x0000000f G 800x600x8 P   8x16 0xa0000 64k 64k 0xd0000000 487k
261 (0x105) 0x0000000f G 1024x768x8 P  8x16 0xa0000 64k 64k 0xd0000000 768k
273 (0x111) 0x0000000f G 640x480x16 D  8x16 0xa0000 64k 64k 0xd0000000 600k
274 (0x112) 0x0000000f G 640x480x32 D  8x16 0xa0000 64k 64k 0xd0000000 1200k
276 (0x114) 0x0000000f G 800x600x16 D  8x16 0xa0000 64k 64k 0xd0000000 937k
277 (0x115) 0x0000000f G 800x600x32 D  8x16 0xa0000 64k 64k 0xd0000000 1875k
279 (0x117) 0x0000000f G 1024x768x16 D 8x16 0xa0000 64k 64k 0xd0000000 1536k
280 (0x118) 0x0000000f G 1024x768x32 D 8x16 0xa0000 64k 64k 0xd0000000 3072k
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

=============================================================================
                                                             Author: valsorym
 
3.5.4. Eliminating of demons cries.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Eliminating of demons cries.
=============================================================================
-----------------------------------------------------------------------------
Setting up configuration files.
-----------------------------------------------------------------------------
  I.Setting up file /boot/loader.conf
    # vi /boot/loader.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Demons scream in FreeBSD.
kern.hz="100"
hint.p4tcc.0.disabled="1"
hint.acpi_throttle.0.disabled="1"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  II.Setting up file /etc/rc.conf.
    # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Demons scream in FreeBSD.
powerd_enable="YES"
performance_cx_lowest="C2"
economy_cx_lowest="C2"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

=============================================================================
                                                             Author: valsorym
 
3.5.5. Check after crash disk.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Check after crash disk.
=============================================================================
-----------------------------------------------------------------------------
Setting up configuration files.
-----------------------------------------------------------------------------
  I.Improving the start of the fsck tool.
    # vi /etc/rc.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + FSCK enhancements.
fsck_y_enable="YES"
background_fsck="NO" 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

=============================================================================
                                                             Author: valsorym
 
3.5.6. Locale UTF-8.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Locale UTF-8.
=============================================================================
-----------------------------------------------------------------------------
Setting.
-----------------------------------------------------------------------------
  I.Check  list of every available UTF-8 locale.
    # locale -a | grep UTF-8
    
    **  For me: ru_RU.UTF-8

 II.Edit the login database  to add a default character set and locale.
    # vi /etc/login.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...
    :ignoretime@:\
    :umask=022:\
    :charset=UTF-8:\
    :lang=ru_RU.UTF-8:

...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
**  Add this after :ignoretime@:\ command line.

III.Rebuild the login database with cap_mkdb /etc/login.conf, then add the
    new locale to /etc/profile as well, so GDM and GNOME pick it up properly.
    # cap_mkdb /etc/login.conf
    # passwd

    # vi /etc/profile

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LANG=ru_RU.UTF-8; export LANG
GDM_LANG=ru_RU.UTF-8; export GDM_LANG
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

=============================================================================
                                                             Author: valsorym
 
3.5.7. Tuning and drivers.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Tuning and drivers.
=============================================================================
-----------------------------------------------------------------------------
Setting.
-----------------------------------------------------------------------------
  I.Change a few sysctl variables to enhance the experience of FreeBSD on the
    desktop, including expanding the amount of shared memory, tuning the 
    process scheduler for desktop use, and increasing the limit of 
    simultaneously-open files to something sensible.
    
    # vi /etc/sysctl.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# Enhance shared memory X11 interface.
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768

# Enhance desktop responsiveness under high CPU use (200/224).
kern.sched.preempt_thresh=224

# Bump up maximum number of open files.
kern.maxfiles=200000

# Disable PC Speaker.
hw.syscons.bell=0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 II.Some knobs can only be set at boot by the loader by setting them in
    /boot/loader.conf. 
    # vi /boot/loader.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Boot-time kernel tuning.
kern.ipc.shmseg=1024
kern.ipc.shmmni=1024
kern.maxproc=10000

# + Access ATAPI devices through the CAM subsystem.
atapicam_load="YES"

# + Asynchronous I/O.
aio_load="YES"

# MOUNTING
# + Filesystem.
libiconv_load="YES"
libmchain_load="YES"
cd9660_iconv_load="YES"
msdosfs_iconv_load="YES"

# + Load MMC/SD card-reader support.
mmc_load="YES"
mmcsd_load="YES"
sdhci_load="YES"

# + Filesystems in userspace (SSHFS, etc).
fuse_load="YES"

# + In-memory filesystems.
tmpfs_load="YES"

# WEBCAM
# + Userland character device driver for webcams.
cuse4bsd_load="YES"

# THERMAL SENSORS
# + Intel Core thermal sensors.
coretemp_load="YES"

# + AMD K8, K10, K11 thermal sensors.
amdtemp_load="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

III.Finally, enable everything else.
    # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SYSTEM
# + Powerd: adaptive speed while on AC power, adaptive while on battery power.
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"

# NETWORK
# + Enable BlueTooth.
hcsecd_enable="YES"
sdpd_enable="YES"

# GUI I/O
# + Mouse and Keyboard in GUI.
hald_enable="YES"
dbus_enable="YES"

# DE/WM
# + KDE
### kdm4_enable="YES"

# + Gnome2
gdm_enable="YES"
gdm_lang="ru_RU.UTF-8"

# WEBCAM
# + Webcam daemon.
webcamd_enable="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 IV.Mounts.
    # vi /etc/fstab

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/dev/gpt/swap   none                swap        sw  0   0
/dev/gpt/root   /                   ufs         rw  1   1
/dev/gpt/var    /var                ufs         rw  0   2
/dev/gpt/tmp    /tmp                ufs         rw  0   2
/dev/gpt/usr    /usr                ufs         rw  0   2
/dev/gpt/home   /home               ufs         rw  0   2
/dev/gpt/heap   /heap               ufs         rw  0   2
proc            /proc               procfs      rw  0   0
fdesc           /dev/fd             fdescfs     rw  0   0
linproc         /compat/linux/proc  linprocfs   rw  0   0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  V.Device Permissions.
    # vi /etc/devfs.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# Allow all users to access optical media
perm    /dev/acd0       0666
perm    /dev/acd1       0666
perm    /dev/cd0        0666
perm    /dev/cd1        0666

# Allow all USB Devices to be mounted
perm    /dev/da0        0666
perm    /dev/da1        0666
perm    /dev/da2        0666
perm    /dev/da3        0666

# Misc other devices
perm    /dev/pass0      0666
perm    /dev/xpt0       0666
perm    /dev/uscanner0  0666
perm    /dev/video0     0666
perm    /dev/dvb/adapter0/demux0    0666
perm    /dev/dvb/adapter0/dvr       0666
perm    /dev/dvb/adapter0/frontend0 0666
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    # vi /etc/devfs.rules

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
[devfsrules_common=7]
add path 'ad[0-9]*'       mode 666
add path 'ada[0-9]*'  mode 666
add path 'da[0-9]*'       mode 666
add path 'acd[0-9]*'  mode 666
add path 'cd[0-9]*'       mode 666
add path 'mmcsd[0-9]*'    mode 666
add path 'pass[0-9]*' mode 666
add path 'xpt[0-9]*'  mode 666
add path 'ugen[0-9]*' mode 666
add path 'usbctl'     mode 666
add path 'usb/*'      mode 666
add path 'lpt[0-9]*'  mode 666
add path 'ulpt[0-9]*' mode 666
add path 'unlpt[0-9]*'    mode 666
add path 'fd[0-9]*'       mode 666
add path 'uscan[0-9]*'    mode 666
add path 'video[0-9]*'    mode 666
add path 'dvb/*'      mode 666
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# ENABLE DEVFS RULES
devfs_system_ruleset="devfsrules_common"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

=============================================================================
                                                             Author: valsorym
 
3.6.1. Configuring Sound Card.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Configuring the sound card.
=============================================================================
-----------------------------------------------------------------------------
Analysis.
-----------------------------------------------------------------------------
  I.Available devices.
    # cat /dev/sndstat
    FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
    Installed devices:
    pcm0: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play) default
    pcm1: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
    pcm2: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
    pcm3: <HDA NVidia (Unknown) PCM #0 DisplayPort> (play)
    pcm4: <HDA IDT 92HD81B1X PCM #0 Analog> (play/rec)
    pcm5: <HDA IDT 92HD81B1X PCM #1 Analog> (rec)

    **  For me, the attention has: pcm4

-----------------------------------------------------------------------------
Setting up configuration files.
-----------------------------------------------------------------------------
  I.Setting up system files.
    1.  File loader.conf.
        # vi /boot/loader.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SOUND
# + Sound settings.
snd_hda_load="YES"
sound_load="YES"
snd_uaudio_load="YES"
hw.snd.default_unit="4"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    2.  File rc.conf.
        # vi /etc/rc.conf

[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# SOUND
# + Sound settings.
snddetect_enable="YES"
mixer_enable="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    3.  Set the of the device number a manually.
        **  In the example, the target device under the number - 4.
        # sysctl hw.snd.default_unit=4

=============================================================================
                                                             Author: valsorym
 
3.6.2. Configuring Xorg.

To view the complete contents of the HOWTO/FAQ: Back to content.

P.S. Sorry for my bad English.
P.P.S. If you find something of interest, tell me: "thank you man" - I will be pleased. If you think that this is useless, do not scold me - I will be unpleasant. If you know a better solution - I'll be glad to see your adjustments.

Code:
=============================================================================
                            HOWTO FOR FREEBSD 9.x.
=============================================================================
CREATED:
    Author: valsorym
    E-mail: valsorym.e@gmail.com
    
DATE:
    2013.03.23

DESCRIPTION:
    Configuring Xorg.
=============================================================================
-----------------------------------------------------------------------------
Note.
-----------------------------------------------------------------------------
    You must have installed the ports collection.

-----------------------------------------------------------------------------
Install software.
-----------------------------------------------------------------------------
  I.Install drivers.
    A.  Install drivers from ports collection.
        # setenv BATCH yes

        # cd /usr/ports/x11/xorg
        # make && make install clean

        # cd /usr/ports/x11/linux-f10-xorg-libs
        # make && make install clean

    B.  Install drivers from packages.
        # pkg_add -r xorg
        # pkg_add -r linux-f10-xorg-libs

-----------------------------------------------------------------------------
Additional settings.
-----------------------------------------------------------------------------
  I.Keyboard and mouse support.
    1.  Configure rc.conf.
        # vi /etc/rc.conf
        
[ F I L E ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# LINUX
# + Binary compatibility with Linux.
linux_load="YES"

# GUI I/O
# + Mouse and Keyboard.
hald_enable="YES"
dbus_enable="YES"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 II.Create xorg.conf.
    1.  Configure Xorg.
        # Xorg -configure
        # Xorg -config /root/xorg.conf.new
        
    2.  After go to next screen - Alt+F2, and.
        # cd /root/
        # cp xorg.conf.new /etc/X11/xorg.conf
        
        **  If you use nVidia video card, then see installing nVidia drivers 
            and configuration it.
            # nvidia-xconfig

=============================================================================
                                                             Author: valsorym
 
Back
Top