FsOS without X11: Difference between revisions

From LFScript
 
(One intermediate revision by the same user not shown)
Line 28: Line 28:
''Sound'':
''Sound'':
* <dependency>alsa-utils</dependency>
* <dependency>alsa-utils</dependency>
''Programming'':
* <dependency>java-bin</dependency>


''Networking:''
''Networking:''
Line 162: Line 165:
         if [ "\$(which ssh-keygen)" != "" ]; then
         if [ "\$(which ssh-keygen)" != "" ]; then
             for algo in rsa dsa ecdsa ed25519; do
             for algo in rsa dsa ecdsa ed25519; do
                 yes | ssh-keygen -N "" -t \${algo} -f /etc/ssh/ssh_host_\${algo}_key
                 yes | ssh-keygen -N "" -t \${algo} -f /etc/ssh/ssh_host_\${algo}_key > /dev/null
             done
             done
         fi
         fi

Latest revision as of 18:57, 28 April 2017

This package lists all software to be included in the fsOS distribution as a dependency, with the exception of graphical software. It further contains the instructions that configure and brand the distribution.

LFScript can find this software under the name fsos-nox.

Sources


MD5 Checksums:

f7828ddf8eef71a2d269462d9cef3a03  fsos_boot.png
4ad62706f96d28304a501b96ecd107a7  MnmKr16-IBMPC.psf.gz

The file fsos_boot.png is used as background image for the isolinux boot menu on the Live CD. MnmKr16-IBMPC.psf.gz is a custom font which is heavily based on the font presented on http://powerman.name/config/font.html.

Dependencies

File systems:

  • btrfs-progs
  • ntfs-3g

Tools:

  • cpio
  • nano
  • postlfs
  • screen
  • unrar
  • which

Sound:

  • alsa-utils

Programming:

  • java-bin

Networking:

  • dhcpcd
  • networkmanager
  • nmap
  • openssh
  • rsync
  • traceroute
  • wget
  • whois
  • wpa_supplicant

Installation and Live CD:

Installation

As the root user:

# Install the custom font
mkdir -pv /usr/share/consolefonts
mkdir -pv /etc/sysconfig

cat MnmKr16-IBMPC.psf.gz > /usr/share/consolefonts/MnmKr16-IBMPC.psf.gz

cat > /etc/sysconfig/console << "EOF"
# Begin /etc/sysconfig/console

FONT="MnmKr16-IBMPC -m 8859-1"

# End /etc/sysconfig/console
EOF

As the root user:

# Prepare a LiveCD configuration with a graphical boot menu
local LIVEDIR="usr/share/live"

mkdir -pv /${LIVEDIR}/medium/boot/isolinux
cat fsos_boot.png > /${LIVEDIR}/medium/boot/isolinux/fsos_boot.png 

cat > /${LIVEDIR}/medium/boot/isolinux/isolinux.cfg << "EOF"
DEFAULT vesamenu.c32
PROMPT 0
TIMEOUT 300

MENU BACKGROUND fsos_boot.png

MENU COLOR border 0 #00000000 #00000000 none
MENU COLOR title  0 #00000000 #00000000 none
MENU COLOR tabmsg 0 #00000000 #00000000 none
MENU COLOR unsel  0 #FFFFFFFF #00000000 none
MENU COLOR hotkey 0 #FFFFFFFF #00000000 none
MENU COLOR sel    0 #FF006080 #FFFFFFFF none
MENU COLOR hotsel 0 #FF006080 #FFFFFFFF none

MENU VSHIFT 15
MENU MARGIN 22
MENU ROWS 4
MENU TIMEOUTROW -1
MENU CMDLINEROW -1

INCLUDE i486.cfg
INCLUDE i586.cfg
INCLUDE i686.cfg
INCLUDE x86_64.cfg
INCLUDE memtest86plus.cfg

LABEL harddisk
    MENU LABEL Boot from first ^Hard disk
    LOCALBOOT 0x80

EOF

cat > /${LIVEDIR}/medium/boot/isolinux/$(uname -m).cfg << "EOF"
LABEL system_<ARCH>
    MENU LABEL ^Boot fsOS (<ARCH>, default)
    KERNEL /boot/<ARCH>/vmlinuz
    APPEND initrd=/boot/<ARCH>/initram.fs quiet

LABEL system_<ARCH>_force_vga
    MENU LABEL ^Boot fsOS (<ARCH>, 1024x768)
    KERNEL /boot/<ARCH>/vmlinuz
    APPEND initrd=/boot/<ARCH>/initram.fs quiet vga=792
EOF
sed -i "s/<ARCH>/$(uname -m)/g" /${LIVEDIR}/medium/boot/isolinux/$(uname -m).cfg

As the root user:

# If this system is to be used as a Live CD, configure it as such
cat > /${LIVEDIR}/sec_init.sh << EndOfFile
#!/bin/busybox sh

# This script modifies the system at boot time, but only if it is started from
# a Live CD. This way, the system image remains clean of any Live CD specific
# settings, and can be installed to harddisk as a normal OS.

# Print a welcome message before login
b="\033[1;34m" # Light Blue
c="\033[0;1m"  # Bright White
d="\033[1;33m" # Bright Yellow
e="\033[1;31m" # Bright Red

(/bin/busybox clear;
 echo -en "\${b}______________________________________________________________";
 echo -e "___";
 echo -e "";
 echo -e "\${c}  Welcome to the 'From Script' Live OS! ";
 echo -e "";
 echo -e "\${b}    Created on \${d}_DATE_STAMP_\${b}.";
 echo -e "\${b}    Created with an \${e}$(uname -m)\${b} processor.";
 echo -e "\${b}    You are now using an \${e}\\m\${b} processor.";
 echo -e "";
 echo -e "\${c}  Login instructions:";
 echo -e "\${b}    In addition to the 'root' account, an unpriviledged account";
 echo -e "\${b}    called 'user' is also available. There is no password set";
 echo -e "\${b}    for either account.";
 echo -en "\${b}______________________________________________________________";
 echo -e "___";
 echo -e "\033[0m") > \${ROOT}/etc/issue

# Configure users
cat > \${ROOT}/etc/rc.d/rcS.d/S80livesetup << "EOF"
#!/bin/sh

case "\${1}" in
    start)
        # Add a normal user with sound card privileges
        groupadd user
        useradd -m user -g user -G audio

        # Remove passwords for LiveCD users
        echo "user:" | chpasswd
        echo "root:" | chpasswd

        # (Re)generate SSH keys for security
        if [ "\$(which ssh-keygen)" != "" ]; then
            for algo in rsa dsa ecdsa ed25519; do
                yes | ssh-keygen -N "" -t \${algo} -f /etc/ssh/ssh_host_\${algo}_key > /dev/null
            done
        fi
        ;;
    *)
        echo "Usage: \${0} {start}"
        exit 1
        ;;
esac
EOF
chmod 755 \${ROOT}/etc/rc.d/rcS.d/S80livesetup

EndOfFile
chmod +x /${LIVEDIR}/sec_init.sh

Post-installation

Note: Post-installation of this software should be performed after all other software has been installed.

local LIVEBOOT="/usr/share/live/medium/boot"
# Slightly change the colors of the "OK" messages on boot
sed -i 's@#BRACKET="\\\\033\[1;34m" # Blue@BRACKET="\\\\033\[0;34m"@g' \
        /etc/sysconfig/rc.site
sed -i 's@#SUCCESS="\\\\033\[1;32m" # Green@SUCCESS="\\\\033\[1;34m"@g' \
        /etc/sysconfig/rc.site
# Apply a datestamp
local DATESTAMP="$(date +%B\ %d,\ %C%y)"
sed -i "s@_DATE_STAMP_@${DATESTAMP}@g" /usr/share/live/sec_init.sh
# Ensure the installed version of syslinux' vesamenu is copied to the live cd
cp -v /usr/share/syslinux/vesamenu.c32 ${LIVEBOOT}/isolinux
cp -v /usr/share/syslinux/libcom32.c32 ${LIVEBOOT}/isolinux
cp -v /usr/share/syslinux/libutil.c32  ${LIVEBOOT}/isolinux
# If memtest has been installed, make it available in the live cd boot menu
[ ! -r /boot/memtest86plus ] ||
cp -v /boot/memtest86plus ${LIVEBOOT}

[ ! -r /boot/memtest86plus ] ||
cat > ${LIVEBOOT}/isolinux/memtest86plus.cfg << "EOF"
LABEL memtest86plus
    MENU LABEL ^Memory test (Memtest86+)
    KERNEL /boot/memtest86plus
EOF
# Set distribution codename
sed 's/<your name here>/fsOS (LFScript 4)/g' -i /etc/lsb-release