User Tools

Site Tools


tech:linux:slackware:start

This is an old revision of the document!


Technical Information: Slackware Topics

Zenteknix Standard Installation

  • Plan out host name and IP address, configure DHCP server if relevant
  • Install from DVD, choosing generic kernel (omitting “huge” kernel)
  • Create initrd, using command generated by:
    chroot /mnt /usr/share/mkinitrd/mkinitrd_command_generator.sh

    … a fairly commonly-generated command:

    chroot /mnt mkinitrd -c -k 3.10.17 -f ext4 -r /dev/sda1 -m usb-storage:ehci-hcd:ehci-pci:usbhid:hid_generic:uhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
  • Edit /mnt/etc/lilo.conf to add initrd line, with a KVM-based VM using virtio, add:
    disk = /dev/vda
    bios = 0x80
    max-partitions = 7
  • Install lilo:
    chroot /mnt lilo
  • Make sure there's an /sbin/initscript for new system:
    cp /mnt/sbin/initscript.sample /mnt/sbin/initscript
  • Populate a ulimit setting for file descriptors:
    ulimit -Hn 32768
  • Make sure there's a link in /etc:
    ln -s /sbin/initscript /mnt/etc/initscript

… at this point, system can be booted, or some pre-emptive changes can be made:

  • Add $HOME/bin to PATH in /etc/profile
  • Change root shell to ksh: vi /mnt/etc/passwd
  • Make sure the wheel group is set up for sudo access: vi /mnt/etc/sudoers

… Now, log in as root and:

  • Correct and populate /etc/hosts
  • Change root shell to ksh (if desired and not already done) with: chsh -s /bin/ksh root
  • Edit /etc/group to make sure user(s) are in groups as desired (especially the wheel group)
  • Add user(s)
  • Edit /etc/sudoers to make sure the wheel group is set up for access
  • Change PermitRootLogin to no in /etc/ssh/sshd_config, then restart sshd with /etc/rc.d/rc.sshd restart
  • Populate the newterm script and accompanying symbolic links into /usr/local/bin
  • Remove undesired packages
    • ConsoleKit
  • Add routing (if applicable) to /etc/rc.d/rc.inet2 for other subnets:
    # Add routing for WAN network on physical host
    route add -host 24.159.210.154 eth0
    route add -net 24.159.210.152 netmask 255.255.255.248 gw 24.159.210.154 eth0
  • Configure NTP in /etc/ntp.conf and enable at startup with chmod 744 /etc/rc.d/rc.ntpd
    • server <ntpserveripaddr> iburst
    • restrict default ignore
    • restrict <ntpserveripaddr> mask 255.255.255.255 nomodify notrap noquery

Zenteknix "liveslack" Modifications

Migrate the ''/var'' footprint to a "live"-capable arrangement

  • Create directory /var/live
    … this will house the memory-resident “live” portion of the /var footprint
  • Initialize the “live” area: mount -t tmpfs tmpfs /var/live -o nodev,uid=0,gid=0,size=100m
  • Migrate these /var subdirectories to under the live portion, one at a time, with:
    cd /var ; mv subdirname live ; ln -s live/subdirname
    Including: cache, lib, lock, log, run, spool, state, tmp
  • Initialize the storage “layers” from the current “live” footprint
    • The static layer: rsync -ai /var/live /var/static
    • The peristent layer: rsync -ai /var/live/ /opt/sys/var
  • Prune the respective storage layers to accommodate desired layering (Note: see next section)

Design and Prune the Storage Layers

  • The /usr/share/mime directory is re-built at every boot, so migrating that into the “live” footprint makes sense:
    mkdir -p /var/static/usr /var/live/usr/share
    chmod 755 /var/static/usr /var/live/usr /var/live/usr/share
    cd /usr/share
    mv mime /var/live/usr/share
    ln -s /var/live/usr/share/mime
    rsync -ai /var/live/usr/ /var/static/usr/
  • I have these links:
    /var/live/log/setup               -> /opt/sys/var/log/setup
    /var/live/log/scripts             -> /opt/sys/var/log/scripts
    /var/live/log/removed_scripts     -> /opt/sys/var/log/removed_scripts
    /var/live/log/removed_packages    -> /opt/sys/var/log/removed_packages
    /var/live/log/packages            -> /opt/sys/var/log/packages
    /var/live/lib/virtuoso            -> /opt/sys/var/lib/virtuoso
    /var/live/lib/rpm                 -> /opt/sys/var/lib/rpm
    /var/live/cache/ldconfig          -> /opt/sys/var/cache/ldconfig
    /var/live/cache/fontconfig        -> /opt/sys/var/cache/fontconfig
    /var/static/cache/fontconfig      -> /opt/sys/var/cache/fontconfig
    /var/static/cache/ldconfig        -> /opt/sys/var/cache/ldconfig
    /var/static/log/setup             -> /opt/sys/var/log/setup
    /var/static/log/removed_packages  -> /opt/sys/var/log/removed_packages
    /var/static/log/scripts           -> /opt/sys/var/log/scripts
    /var/static/log/removed_scripts   -> /opt/sys/var/log/removed_scripts
    /var/static/log/packages          -> /opt/sys/var/log/packages
    /var/static/lib/virtuoso          -> /opt/sys/var/lib/virtuoso
    /var/static/lib/rpm               -> /opt/sys/var/lib/rpm

Adapt the startup scripts to engage the "live" footprint

  • Add to /etc/rc.d/rc.S before loading loop device kernel module:
    # Mount the live filesystem
    if [ -d /var/live/log ]; then
    	/sbin/mount -v -n -t tmpfs tmpfs /var/live -o nodev,uid=0,gid=0,size=100m
    fi
  • Add to /etc/rc.d/rc.S before Configure ISA Plug-n-Play devices:
    # Add /var/live to /etc/mtab, and sync from static:
    /sbin/mount -f tmpfs /var/live -t tmpfs
    /usr/bin/rsync -ai /var/static/ /var/live/


Links: Linux InfoTech Info

tech/linux/slackware/start.1437322527.txt.gz · Last modified: 2015/07/19 11:15 by rk4n3