crux linux setup

disk setup

fdisk /dev/sda                  # virtual machine, scsi access to drives
create a [n]ew [p]rimary partition with a size of [+3G]
[a]dd boot flag to first partition [1]
create a [n]ew [p]rimary partition, use the rest of the drive
change the [t]ype of partition [2] to [82] Linux

[p]rint partition table
[d]elete a partition
[w]rite partition table and exit
fdisk -l                        # print partition table
mkfs.ext4 /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2
mount /dev/sda1 /mnt


Run setup; install core packages, run setup-chroot.


Replace the #EXT4FS_ROOT# and #SWAP# tokens in /etc/fstab.

# filesystem  mount-point  type    options                          dump  fsck
/dev/sda1     /            ext4    defaults                         0     1
/dev/sda2     swap         swap    defaults                         0     0
devpts        /dev/pts     devpts  noexec,nosuid,gid=tty,mode=0620  0     0

Edit the system configuration; /etc/rc.conf.

FONT=default                    # terminal font
KEYMAP=us                       # terminal keyboard layout
TIMEZONE=America/New_York       # set to the location of your vps
HOSTNAME=$VM                    # the machine's hostname
SYSLOG=sysklogd                 # the system logging daemon to run at startup
SERVICES=(lo net crond)         # services to load on startup

Generate locales;

localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1
localedef -i en_US -f UTF-8 en_US.UTF-8

linux kernel

cd /usr/src/linux-4.9.6
make menuconfig
make all
make modules_install
make oldconfig                  # merge previous settings
make mrproper                   # only if you decide to start fresh after a
                                # failed attempt; cleans up (deletes) all generated
                                # files, including .config!
cp arch/x86/boot/bzImage /boot/vmlinuz-4.9.6
cp /boot/

Replace the #DEVICE# and #ROOT_DEVICE# tokens in /etc/lilo.conf - run lilo.

# /etc/lilo.conf

      append="quiet rootfstype=ext4"

final steps

  -m             # create home directory under /home/[name]
  -G wheel       # add to the wheel group
  -s /bin/bash   # user's default shell, is an option from /etc/shells

passwd [name]

sudo (convenient)

Use visudo to uncomment two lines; set root's $PATH variable, and allow users in the wheel group to run ALL programs with sudo.

Defaults secure_path="/sbin:/usr/sbin:/bin:/usr/bin"
%wheel ALL=(ALL) ALL

shutdown and restart

shutdown -h now                 # -[h]alt or -[r]estart
VBoxManage storageattach $VM \
	   --storagectl "IDE Controller" \
	   --port 0 \
	   --device 0 \
	   --type dvddrive \
	   --medium none

VBoxManage modifyvm $VM --boot1 disk --boot2 none

2018 - Élő László hello at bald dot cat