Tagged: command

Kernel 4.4.172 on Slackware64 and VirtualBox

In my previous post, I mentioned that I had issues with NVIDIA after updating the kernel to 4.4.172 from Security Advisories. It appears that this kernel update is breaking some applications for many people. For me, it broke NVIDIA video driver and now I found that I can't run VirtualBox.

When I execute the virtualbox command, it complained about vboxdrv not running. Then, when I tried to start vboxdrv, it said vboxdrv not found! # /etc/rc.d/rc.vboxdrv start bash: /etc/rc.d/rc.vboxdrv: No such file or directory

After looking for a solution in linuxquestions.org and other sites, I ended up following the instruction from SlackBlogs.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Download the virtualbox binary:

Download the source binary from VirtualBox site. Choose for All distributions, then execute it as root. The installation will fail but don't worry about it.# sh VirtualBox-6.0.4-128413-Linux_amd64.run ...

Update the source code:

Open the source code for /usr/src/vboxhost-6.0.4/vboxdrv/r0drv/linux/memobj-r0drv-linux.c with your favorite editor, look for below lines and update it with new KERNEL_VERSION(4, 4, 168). There are three locations you'd need to update.# nvim /usr/src/vboxhost-6.0.4/vboxdrv/r0drv/linux/memobj-r0drv-linux.c ... if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0) <-- Change the kernel version to KERNEL_VERSION(4, 4, 168) fWrite ? FOLL_WRITE | /* Write to memory. */ FOLL_FORCE /* force write access. */ : 0, /* Write to memory. */

Restart the setup process:

Now, execute the /sbin/vboxconfig as root to re-start the setup process:# /sbin/vboxconfig vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: Starting VirtualBox services. ... #

Run vboxdrv:

So far so good. It's now the moment of the truth. If I can get vboxdrv running, it's all set:# /etc/rc.d/rc.vboxdrv start Starting VirtualBox kernel modules ...done. #

Hooray! it's working. In fact, I can bring up VirtualBox. All I need to do is to update their Guest Addition images to the latest.

That's all!
-gibb

Kernel 4.4.172 on Slackware64 and NVIDIA

Today, I noticed the kernel update to 4.4.172 from Security Advisories and updated my system. After rebooting the system, it couldn't start my X-Window system! It just failed. From the log file, I was able to determine that there was some kind of incompatibility with current NVIDIA driver.

After much of trial-and-error, I was able to install the correct NVIDIA driver for my system and got X-Window system running again. This is just a note to myself and others who might face the same issues, and hopefully they don't need to go through all the troubles.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

First of all, I just go though the ways to install package updates from the slackware website, just for a formality. The procedure was pretty simple and I followed the instruction in that page (well, most of the part). $ cd /tmp/patches $ wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.2/patches/packages/*.txz # upgradepkg *.txz ... #

Now, download the kernel packages:$ wget ftp://ftp.slackware.com/pub/slackware/slackware64-14.2/patches/packages/linux-4.4.172/*.txz # upgradepkg kernel-*.txz ... # /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.172 | bash ...

The instruction says to run the lilo command to reinstall lilo:# lilo Fatal: open /boot/vmlinuz-generic=4.4.xx: No such file or directory

Oops, it looks like I do need to update the lilo.conf file to reflect with new updated kernel image and version. To do this, open the /etc/lilo.conf file and point to the right image name and label:# nvim /etc/lilo.conf ... image = /boot/vmlinuz-generic-4.4.xx <-- Change this to /boot/vmlinuz-generic-4.4.172 initrd = /boot/initrd.gz root = /dev/sda2 label = 4.4.xx <-- Change this to 4.4.172 read-only ...

Then, re-run the lilo command:# lilo Added 4.4.172 + * # reboot

After rebooting and loging in, startx failed.

The log, /var/log/Xorg.0.log, indicates something about nvidia driver missing, so I figured there was an incompatibility with the updated kernel. Then, I google'ed for a solution and learned that SlackBuilds.org had NVIDIA driver packages (418.43).

I downloaded and installed. During the installation, it warned that this driver packages were not compatible with my NVIDIA card, GeForce GTS 450, and recommended to use 390.xx. Of course, installation of this packages didn't fix the problem.

Then, I searched the nvidia site for the correct driver for my card and found 390.87. But this driver always failed to build against the kernel 4.4.172. I desperately searched the Net for a solution but couldn't find any. So, I went back to the nvidia site for older drivers to try on. Under the Beta and older version link, I found the newer version 390.116, which was released a few weeks ago. This driver set does support my old card, GeForce GTS 450, so I gave it a shot.# sh NVIDIA-Linux-x86_64-390.116.run ...

The installation went successful without any issues. Moreover, startx was able to bring up the X-Window system!

That's all!
-gibb

Creating ISO images from CD or DVD

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

1. Reading the block size and the volume size:
# isoinfo -d -i /dev/sr0 | grep -i -E 'block size|volume size' Logical block size is: 2048 Volume size is: 327867

2. Running dd with the parameters for block size and volume size: # dd if=/dev/sr0 of=/tmp/test.iso bs= count= status=progress

That's all!
-gibb

Building My Work Environment (Part 6)

Part 6 - Let's type in Japanese

Now, we can view Japanese in terminal, let's try installing some input method framework. The CHANGES_AND_HINTS.TXT for Slackware64 14.2 suggests to use SCIM, but according to Arch wiki, SCIM is a dead project now. So, we'll try installing IBus.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Installation:

Installation of ibus as well as its dependencies and Japanese engine, ibus-anthy, is no difficult tasks. If you are planning to input Japanese characters, you might consider installing ibus-qt as well. They are available from Slackbuilds.org as usual.

Configurations:

Once the installation is done, start the setup program to do some configurations.$ ibus-setup

All I changed was the keyboard shortcuts and input methods. For keyboard shortcuts, I was hoping Alt+Shift would just work but it didn't, so I changed it to Alt+Shift+space.

For input methods, I added Japanese - Anthy to enable Japanese input. You might have noticed that its icon is different from the default one. This is because I replaced its default icon with my own.

The configuration of ibus should be done now. You'll see a small EN icon in its systray. That confirms ibus is running now. Left click on the icon will show you the list available input methods, in this case, English and Japanese - Anthy.

.bashrc:

We need to tell the system that we are using ibus for alternate language inputs after logging out or shutdown. To do this, we update .bashrc and add some environment variables.$ nvim ~/.bashrc ----------------------------------------- ... export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus ...

i3/config:

Now, we need to start ibus each time we log into i3 window manager. To do this, we add ibus-autostart to at the end of i3's config file.$ nvim ~/.config/i3/config ----------------------------------------- ... exec --no-startup-id ibus-autostart

Japanese input is enabled and available for terminal as well.

Changing Default Anthy Icon:

I thought the default Anthy icon was not pretty and didn't like it. So, I decided to change it to my own. After searching for the icon in the system, I found it in /usr/share/ibus-anthy/icons/. It's called ibus-anthy.png. I used GIMP to create another icon and replaced it.

That's all!
-gibb

Building My Work Environment (Part 5)

Part 5 - Show Me Japanese in my Terminal

At this moment, any Japanese characters will show up as little rectangle shapes or some gibberish characters. This is, by default, because Slackware uses en_US as its locale. Locale is set using an environment variable, $LANG, and it is set in /etc/profile.d/lang.sh for system wide configuration.

I'd like to be able to read Japanese in terminals for myself, and don't need to apply this for the whole system. All I need to do is to export $LANG in .bashrc.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

The locale for Japanese can be found by running the following command:$ locale -a | grep -i jp ja_JP.eucjp ja_JP.utf8

The Japanese locale for my system is jp_JP.utf8 (or jp_JP.UTF-8). To apply this in my environment, update .bashrc:$ nvim ~/.bashrc ----------------------------------------- export LANG=ja_JP.UTF-8

After this, either logout and back-in or source .bashrc will display Japanese characters properly in terminal.

However, this brings a bit of problem in my status bar. Time/date is displaying in Japanese as well. This is not what I wanted.

To fix this, I forced i3pystatus to use the en_US locale in its configuration file.$ nvim ~/.config/i3/i3pystatusconfig.py ----------------------------------------- from i3pystatus import Status import os # Setting LANG to en_US to avoid # showing dates in Japanese os.environ['LANG'] = 'en_US' ...

After saving the file, $Mod+Shift+r will change date/time in English.

In next article, let's talk about enabling Japanese input.

That's all!
-gibb