Fri Jan 1 17:17:45 2021 UTC

NuTyX version 20.12 manual

CONFIGURATION

  1. Language and locale

  2. The command to adjust language and locale:

    sudo setup-nutyx -cl

    The file /etc/profile.d/i18n.sh defines the language of the user interface.

    The link /etc/localtime defines your time zone.

    To find out the various possibilities for Europe, for example, use the command:

    ls /usr/share/zoneinfo/Europe
    Then adjust the link to match the city closest to your location. For example, the command:
    sudo ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
    will define Rome as city of your region.
  3. The keyboard

  4. The command to select your keyboard:

    sudo setup-nutyx -ck

    The file /etc/sysconfig/console defines the configuration of the keyboard when you are not in graphical mode.

    Here is an example of a console configuration:

    FONT="LatGrkCyr-8x16"
    UNICODE="1"
    LOGLEVEL=1
    KEYMAP=fr_CH-latin1.map
    The FONT variable defines the font that will be used. The UNICODE variable specifies the use of utf8 coding. LOGLEVEL defines the level of verbosity during the booting process (1 for least verbose, 7 for most). KEYMAP defines the keyboard mapping. All available keyboard maps are listed in the folder /lib/kbd/keymaps/i386/. Available fonts are listed in the folder /lib/kbd/consolefonts/.

    The file /etc/X11/xorg.xonf.d/20-keyboard.conf does the same thing for your graphical keyboard. This is a wide subject; please use the Xorg main page for further information on how to configure it. You will also find a lot of examples on the Internet.

  5. Setting date and time

  6. The command for setting up the date and time:

    sudo setup-nutyx -cc

  7. Creating a new user account

  8. The command to add a new user on your system:
    sudo setup-nutyx -cu

    If you wish to activate the autologin behaviour, edit /etc/lxdm/lxdm.conf file.

    The more basic commands useradd/userdel can also be used to add/delete user accounts.

  9. The network

  10. Automatic configuration via DHCP

    The command below will configure you network:

    sudo setup-nutyx -cn

    Manual Configuration

    The command below will configure you network:
    sudo setup-nutyx -cn

    The file /etc/sysconfig/network contains all the network information.

    HOSTNAME='nutyx'        # Hostname of this machine
    MANAGER=''              # Network manager (wicd/networkmanager/cli/nothing)
    NETWORKWAIT='no'        # Wait or not for network
    LINKDELAY='15'          # init delay for initialisation of Networkmanager
    NETWORKDELAY='0'        # init delay to wait after initialisation of Networkmanager
    The script taking care of the network will adapt by checking which application is installed.

    If wicd is found, the wicd service will be started; if networkmanager is found, the networkmanager service will be started.

    If both applications are installed, networkmanager is started preferentially.

    If neither is found, the cli script will be started.

    For a static address configuration, it is necessary to specify the address of your DNS servers manually. For example, if you wish to use the google DNS servers, put this in the file /etc/resolv.conf:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    EOF
    

    You can often use the address of your router, as most routers are also DNS servers.

    Define a wireless network and activate the wpa key

    If your computer support wireless access, you can now configured it:

    The command below will setup the wireless network

    sudo setup-nutyx -cw

    If you wish to do all by hand, here's how to proceed:

    To know the name of the network card, use the command (as root):

    iwconfig
    If the result is something like:
    eth0       no wireless extensions.
    
    eth1       IEEE 802.11abg 
               Mode:Managed  Frequency:2.417 GHz  Access Point: C4:3D:C7:9F:D0:CF
               Tx-Power=200 dBm
               Retry  long limit:7   RTS thr:off   Fragment thr:off
               Encryption key:off
               Power Management:off

    In the example above, the eth1 card supports WiFi.

    We just have to provide the configuration file which will be used by the network connection.

    ATTENTION: it is important to name the configuration file correctly so that the script can find it.

    In this example, the name of the card is eth1, the name of the WiFi network is casabianca and the access key will be Gg6!-@1234. From this information, we created this configuration file:

    wpa_passphrase "casabianca" "Gg6!-@1234" > /etc/wpa_supplicant.conf.eth1

    Then we add the configuration file as explained in the manual under the configuration section.

    In this example, we have to create the file /etc/sysconfig/ifconfig.eth1.

    Once this is done, you can restart the network by restarting the service:

    /etc/rc.d/init.d/network restart
    Make sure you adjust the definition of the variable MANAGER as defined in the file /etc/sysconfig/network.

    The management of the network service can be done through the command line. The value of the variable is then cli. If you want to use wicd, put wicd as a value; if networkmanager (which comes with the 'mate' graphical interface), then put networkmanager.

  11. Setting the name of your computer

  12. The file /etc/hostname defines the name of the local machine.

    it's containing the name of your machine.

    Example:

    nutyx
  13. Configuring the boot process

  14. If you used an ISO image to install NuTyX and you installed GRUB as your bootloader, its configuration file is located in /boot/grub/grub.cfg.

    The name of the NuTyX kernel file is kernel, and the name of the initrd is initrd.

    Both files are located in the /boot folder.

    In the following example, NuTyX is installed on the first partition of the second hard drive and grub is installed on the first hard drive.

    The configuration file will be:

    menuentry "NuTyX 20.12" {
      set root=(hd1,1)
      linux /boot/kernel root=/dev/sdb1 ro quiet 3
      initrd /boot/initrd
      }

    If we want to have an extra entry for maintenance, the entry will look like:

    menuentry "NuTyX maintenance" {
      set root=(hd1,1)
      linux /boot/kernel ro quiet 3
      initrd /boot/initrd
      }

    Note that this entry doesn't have the option root=/dev/sdb1 so the root partition will not be mounted. This would allow you to carry out maintenance tasks on this partition.

    If the bootloader is not yet installed, (for example because you installed NuTyX from a script rather than from an ISO image), you can install grub separately by specifying the disk on which which the NuTyX partition is located. In our example below, we will use the following command:

    sudo grub-install /dev/sdb

    Ajust according your settings

  15. Adding a partition, a disk or a NFS shared folder

  16. [NOTE IMPORTANT] If you have already defined the user(s) on this machine and wish to mount their /home folder (which contains the users personal files) on a separate partition/disk/NFS folder, it is important to back up the existing contents of this folder first.

    There are several ways of doing this. Whichever way you use, make sure you are logged in as root and that the X server is not running.

    As root, type the following commands:

    init 3
    sync
    cd /home
    tar cf /root/users.tar *

    If everything went well (no error messages), you can erase the folders, still as root

    cd /home
    rm -r *

    The home folder is now empty and ready to become a mount point for the real home partition.

    The file /etc/fstab defines the mount points of partition devices when the machine boots up.

    You will probably want to use a partition or a disk or even a NFS folder to store the personal data of the registered users on this machine.

    In our example, GRUB is on the first partition, NuTyX rootfs is on the second partition, the swap partition is the third.

    The file /etc/fstab of our example initially contains the following information:

    # file/device   mountpoint  type      options    dump fsck order
    ...
    /dev/sda1       /boot       ext2      defaults     0        0
    /dev/sda2       /           reiserfs  defaults     0        1
    /dev/sda3       swap        swap      pri=1        0        0

    We wish to add the second partition (formatted as ext4) of the second disk to be installed on the mount point /home. We need to add the following line:

    echo "/dev/sdb2  /home  ext4     defaults   0   0" >> /etc/fstab

    To add a NFS folder /srv located on a remote server with the IP address 192.168.254.254 to the mounting point /server, we add the following line:

    cat "192.168.254.254:/srv /server  nfs  rw,vers=3,_netdev,rsize=8192,wsize=8192   0   0" \
    >> /etc/fstab

    Once this is done, you can activate the mount points using the command:

    mount -a

    The folder /server must have been created earlier on your local machine. The values of rsize and wsize have the default values. Feel free to experiment with your own values for these. Make sure the package nfs-utils and the associated services are launched. Note that the version 3 of NFS has been chosen.

    You should not see any error messages during the mount operation. You can check the result by using the command:

    mount
    it should return something like this:
    ...
    /dev/sdb2 on /home type ext4 (rw)
    192.168.254.254:/srv on /server type nfs (rw,vers=3,rsize=8192,wsize=8192,addr=192.168.254.254)
    ...

    It is now time to restore the content of the /home folder.

    This assumes that some users are already created and you choose to mount the /home folder:

    cd /home
    tar xf /root/users.tar

    You can now switch back to graphical mode and login as a normal user.

  17. Adding a swap partition or a swap file

  18. The command fdisk lets you modify the organisation of your disk(s).

    If you have less than 1 GB of RAM (for a 32-bit system) or less than 4 GB (for a 64-bit one), you definitely should create a swap partition.

    If there is no space for another partition, you can still create a swap file and mount it automatically at boot.

    We first create a file big enough (here +/- 500 MB):

    dd if=/dev/zero of=/SWAP bs=1024 count=500000

    A file named SWAP of 512Mbytes is created in the root directory of the filesystem.

    Next we format it and make it active:

    mkswap /SWAP
    swapon /SWAP

    Finally we add an entry for it in the /etc/fstab:

    echo "/SWAP     swap       swap     pri=1       0        0" >> /etc/fstab
  19. Manual loading of the kernel modules

  20. A module is a piece of code used by the kernel which can be loaded while the machine is running.

    The command:

    lsmod
    lists all the currently loaded modules.

    The command:

    modprobe-v module
    manually loads the module module into the kernel.

    The command:

    rmmod -v module
    unloads module from the kernel.

    Deactivate the loading of a module (blacklist).

    Sometimes it is necessary to blacklist a module that is causing problems, to prevent it from being loaded automatically.

    The folder /etc/modprobe.d contains all the files that specify modules to blacklist.

    File syntax example, the file /etc/modprobe.d/ati.conf contains:

    blacklist radeon
  21. Modify/Create folders/files at booting

  22. The file /etc/sysconfig/createfiles specifies files and/or folders that need to be created or modified automatically when the machine starts.

    It is unlikely that you will need to adjust these.

    BINARY PACKAGE MANAGEMENT (REMOTE)

    1. Configuration of cards

    2. The file /etc/cards.conf defines the behavior of the cards package manager.

      Each line in this file is a <variable> <value> pair

    3. Commands to know

    The cards command has a lot of possible options. Only a few are listed here.

    To get complete help information, use the command:

    cards help

    Any options that modify your installation must be used from the administrator (root) account or via the sudo command.

    Synchronisation, to check the available updates.

    check
    or
    sudo cards sync -i

    Installing package(s)

    get packageX .. packageY
    or
    sudo cards install packageX .. packageY

    Uninstalling a package

    del packageX
    or
    sudo cards remove paquetX

    Updating of the X package. Note that all the dependencies will be updated if necessary.

    up paquetX
    or
    sudo cards install -u packageX

    Searching for a string in the name or description of the available packages.

    search <string>
    or
    sudo cards search <string>

    Print out a list of out-of-date packages.

    sudo cards diff -i

    BINARY PACKAGE MANAGEMENT (LOCAL) (for advanced users)

    To manage local binary packages, we use the commands pkgadd, pkgrm, and pkginfo.

    These commands modify your installation, so they need root access.(su -)

    To get access to thoses commands, you need to install the cards.devel package:

    get cards.devel
    1. Configuration of pkgadd

    2. The file /var/lib/pkg/pkgadd.conf defines the installation and upgrade rules for binary packages.

      It contains three columns: EVENT, PATTERN and ACTION. The EVENT column describes the type of situation to which this rule applies.

      Currently there are two types of events: UPGRADE and INSTALL. UPGRADE rules are applied when a package is installed over an existing version. INSTALL rules are applied in all cases.

      The pattern is a regular expression representing a class of files.

      The action applicable to both the UPGRADE and INSTALL event is YES and NO.

      More than one rule of the same event type is allowed, in which case the first rule will have the lowest priority and the last rule will have the highest priority.

      Example:

      UPGRADE         ^etc/.*$                NO
      UPGRADE         ^var/log/.*$            NO
      UPGRADE         ^etc/X11/.*$            YES
      UPGRADE         ^etc/X11/XF86Config$    NO

      The above example will prevent pkgadd from upgrading anything in /etc/ or /var/log/ (subdirectories included), except files in /etc/X11/ (subdirectories included).

      However the file /etc/X11/XF86Config is not to be updated.

      The default rule is to upgrade/install everything, rules in this file are exceptions to that rule.

      (NOTE! A pattern should never contain an initial "/" since you are referring to the files in the package, not the files on the disk.)

      If pkgadd finds that a specific file should not be upgraded it will install it under /var/lib/pkg/rejected/.

      The user is then free to examine/use/remove that file manually.

    3. Commands to knows

    Install a local package

    sudo pkgadd /path/to/package

    Upgrade a local package

    sudo pkgadd -u /path/to/package

    Delete the package silently

    sudo pkgrm package

    List all the installed packages

    pkginfo -i

    List the file list of a package

    pkginfo -l package

    Find out the owner of a filename

    pkginfo -o FileName

    Find out details of a package

    pkginfo -d package

    PACKAGE MANAGEMENT USING PORTS WITH DEPENDENCY MANAGEMENT (for advanced users)

    The management of recipes for packages and their dependencies is carried out using the cards command as well.

    1. cards configuration

    2. As mentioned above, the /etc/cards.conf file defines rules for this command.

      The line dir /var/lib/pkg/depot/... is very important for ports management.

      The order defines the order in which directories will be searched for recipes.

      If a recipe is available in two directories, the first one listed will always be used.

    3. Commands you need to know

    List dependencies of a package and see if they are installed.

    cards deptree package

    Check if package is available

    cards search package

    Search a package with the description

    cards info -p package

    Build and install a port (needs root access)

    cd /var/lib/pkg/depot/<collection>/packageX && pkgmk -d -i

    Download, build and install the package in one single command

    sudo cards create -n packageX
    Download, build and install the package. Its dependencies MUST be already available. They will not be compiled.

    SERVICES

    Various service packages are available for installation under the name <nameoftheservice>.service.

    The command cards search service will printout the list of all available service packages.

    Once installed, their start-up scripts (cups, gdm, sshd, etc...) can be found in the /etc/rc.d/init.d directory

    Example: Starting the X service

    /etc/rc.d/init.d/Xservice start

    Stopping the X service

    /etc/rc.d/init.d/Xservice stop

    Restarting the service (this option is not available for all services).

    /etc/rc.d/init.d/Xservice restart

    IN CASE OF PROBLEMS

    If you run into a problem, Linux automatically produces a variety of log files which can provide useful information.

    There is a record of the boot process in /var/log/boot.log and more complete system messages in /var/log/sys.log.

    A record of the last start-up of the X server is in the file /var/log/Xorg.0.log.

    Most of the services have there own logs.If you have a ssh connection problem, some info will be found in the file /var/log/auth.log of the ssh server.

    To find out about installed binary packages, check the file /var/log/cards.log.

    ONLINE HELP

    IRC: join the chat room #nutyx on the irc.freenode.net (utf-8) network

    WEB site: http://www.nutyx.org

    FILES

    Here are listed the configuration files mentioned in this manual. You may like to study them for yourself.

    /etc/cards.conf,
    /etc/pkgmk.conf,
    /etc/sysconfig/console,
    /etc/sysconfig/clock,
    /etc/sysconfig/network,
    /etc/wpa_supplicant.conf.*,
    /etc/sysconfig/ifconfig.*,
    /boot/grub/grub.cfg,
    /etc/fstab,
    /etc/profile.d/i18n.sh,
    /var/lib/pkg/nutyx-version,
    /var/lib/pkg/pkgadd.conf

    AUTHORS

    Thierry Nuttens

    SEE ALSO

    man pages of
    nutyx(8), cards(8), pkgmk(8) pkgadd(8),
    cards.conf(5), pkgmk.conf(5), pkgrm(8), pkginfo(8), modprobe(8), modprobe.conf(5),
    useradd(8), userdel(8)

    COPYRIGHT

    Copyright (C) 2013 - 2021 Thierry Nuttens
    
    This free document is published under the free license WTFPL - Do What The F*** You Want To Public License.
    ( http://www.wtfpl.net/ )