Linux: Manjaro Fine-Tuning

Lately, I caught myself installing binary packages for Firefox, Thunderbird, LibreOffice, etc. instead of the source codes. Right, I became sick and tired from everyday recompilations, solving strange package dependancies, etc. Therefore, I decided to give a try to a binary distro. Having previous experience with Archlinux, I decided for Manjaro linux

Yes, compared to the complex installations for which people require handbook (such as with Gentoo), Manjaro linux developers designed an easy-to-use installation wizard. In about ten minutes, I was booting into a brand new Arch-based distro and enjoying ubuntu-like package update manager. Right, I still catch myself using pacman/yaourt as both are faster than clicking. But I always have a choice. On the other hand, some features did not work out of the box. And the following lines describe how to deal with them.

Hibernation

To make it work, edit the /etc/mkinitcpio.conf file and add: resume to the HOOK flag as follows:

HOOKS="base udev autodetect modconf block resume filesystems keyboard fsck"

After that, you rebuild the initcpio file accordingly:

sudo mkinitcpio -p linux3X

where X is the current kernel version (linux310 for 3.10).

Now, the kernel requires to have the information, where it should look for the hibernated data. Thus edit /etc/default/grub and update it accordingly:

GRUB_CMDLINE_LINUX="resume=/dev/sdXY"

or if using UUID:

GRUB_CMDLINE_LINUX="resume=UUID=DISKID"

where sdXY and DISKID are the respective identifiers of the SWAP partition.
Don’t forget to run grub-mkconfig -o /boot/grub/grub.cfg afterwards.

Udev’s Clumsy Interface Notation

The easiest method is to create a symlink as follows:

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

After the reboot, the ethX is back online ๐Ÿ™‚

Static IP Address Setup

Considering, there is no running NetworkManager which can be easily configured in XFCE.

From the project web page:
systemd is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic.

Since using systemd, some operations become more handy, some somehow not. Anyway, the elementary IPv4 setup become “different”.

First create configuration file for the systemd service, replace INTERFACE with proper interface name: /etc/conf.d/network@INTERFACE and insert, e.g.:

address=192.168.123.234
netmask=24
broadcast=192.168.123.255
gateway=192.168.123.1

Create a systemd unit file: /etc/systemd/system/network@.service and insert:

[Unit]
Description=Network connectivity (%i)
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/conf.d/network@%i

ExecStart=/usr/bin/ip link set dev %i up
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i
ExecStart=/usr/bin/ip route add default via ${gateway}

ExecStop=/usr/bin/ip addr flush dev %i
ExecStop=/usr/bin/ip link set dev %i down

[Install]
WantedBy=multi-user.target

Disable DHCP, enable the unit and start it, passing the name of the interface:

systemctl stop dhcpcd.service
systemctl enable network@INTERFACE.service
systemctl start network@INTERFACE.service

where INTERFACE is the identifier of the specific network interface.

And finally, edit the DNS setup in /etc/resolvconf.conf, e.g.:

nameserver 8.8.8.8
nameserver 8.8.4.4

which represent Google’s nameservers.

Terminal in XFCE4 Issue

Terminal in XFCE4 does not wrap lines if the command is longer than the window size. Rumors say that it is an issue related to Bash, some say it’s related to the Terminal application itself. Either way, it’s a stupid bug (feature?) which can be easily corrected by inserting the following line into user’s ~/.bashrc file:

shopt -s checkwinsize

VirtualBox

VirtualBox can be installed from the Manjaro repository. However, to make it work properly and to prevent errors such as “Implementation of the USB 2.0 controller not found.”, the Oracle VM VirtualBox Extension Pack needs to be installed from AUR.

Switch On Numlock Automatically

With XFCE4, a new display managers (login manager) has been integrated from Linux Mint. It is called the Mint Display Manager (MDM) and it looks quite cool ๐Ÿ™‚ Unfortunately, it does not provide the “numlock on” feature out of the box. On the other, it is an easy to resolve issue.

First, install the numlockx package:

pacman -S numlockx

And then edit the /etc/mdm/Init/Default file, and insert (after the comments) the following lines:

if [ -x /usr/bin/numlockx ]; then
  exec /usr/bin/numlockx on
fi

iptables and StrongSwan activation

iptables:

iptables-save > /etc/iptables/iptables.rules
systemctl enable iptables
systemctl start iptables
systemctl status iptables

ip6tables:

iptables-save > /etc/iptables/ip6tables.rules
systemctl enable ip6tables
systemctl start ip6tables
systemctl status ip6tables

StrongSwan (IPsec):

systemctl enable strongswan
systemctl start strongswan
systemctl status strongswan
Advertisements
This entry was posted in Linux and tagged , , , , , , , , , , , . Bookmark the permalink.