Tagged: Slackware

/usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exist status

I was in need of installing software on my Slackware64 14.1 on the other day and got a following error message: ... /bin/sh ../libtool --tag=CC --mode=link gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -fPIC -module -avoid-version -o export_jpg.la -rpath /usr/lib64/transcode export_jpg_la-export_jpg.lo -L/usr/lib -ljpeg -lm -lm -lz -ldl libtool: link: gcc -shared -fPIC -DPIC .libs/export_jpg_la-export_jpg.o -L/usr/lib /usr/lib/libjpeg.so -lm -lz -ldl -O2 -Wl,-soname -Wl,export_jpg.so -o .libs/export_jpg.so /usr/lib/libjpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: *** [export_jpg.la] Error 1 make[2]: Leaving directory `/tmp/SBo/transcode-1.1.7/export' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/SBo/transcode-1.1.7' make: *** [all] Error 2

From the error message, I can tell that it has something to do with linker and libraries, perhaps using 32-bit library on my 64-bit Slackware. I checked the LDFLAGS variable in its MakeFile and it was empty.

Ok, is there a way to force the compiler to use 64-bit libraries with SlackBuild scripts?

YES! A variable can be passed to SlackBuild script. To force the SlackBuild script to use 64-bit library, simply add variable with its value before executing a SlackBuild script.

$ LDFLAGS="-L/usr/lib64" ./[SlackBuildScript_name]

VoilĂ . The compilation went through without any more errors!

Disclaimer: The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb

Copying Files From Android Kitkat (4.4.4) to Slackware

I didn't know until I tried myself but when I connected my Samsung Galaxy Note 4 to my slacky64 (Slackware Linux) via USB, I no longer had an option to connect it as USB Mass Storage (UMS) like it did with other flash drives. In stead, it gave me two options: MTP and PTP. Hmm... what the heck are these?

mtp_php

Apparently, the old way of accessing the storage device had several drawbacks. One being how it was making its storage partition available to foreign systems. Whenever another system accessed the phone's storage area, it needed exclusive access to there, which means the entire storage partition was dedicated to that system and as long as that system was accessing there, the phone itself couldn't access any files or apps stored in that area. Also, this could easily mess up (or corrupt) the storage partition.

Another reason was the type of its file system. Because its storage partition needed to be available to various systems, mostly for Windows devices, it was formatted as the FAT file system (Duh...). FAT is an older and slower file system without the concept of file ownership. Not to mention Microsoft holds patents for which they demand royalties from OEM's for long file name support on the FAT file system, etc...

So what are MTP and PTP?

MTP (Media Transfer Protocol) is a subset of PTP (Picture Transfer Protocol) communication protocols that allow transferring media files from and to portable devices. These protocols have been around for a while but they are new to Android. They are considered better solutions to the problems UMS had. When a foreign system accesses the phone via MTP, it sends queries to Android and Android returns with the list of files requested. Then it downloads files. This allows access to file levels rather than exclusively opens up the entire storage portion and also allows Android choose which files to present.

This also enables Android format its storage device with ext3/ext4 or any other file systems - no longer limited to FAT!

PTP works the similar way and is mostly used by digital cameras.

For more information, please refer to Android USB Connections explained MTP, PTP, and USB Mass Storage

Now, some terminologies are out of the way, I tried transferring some photos from my Note 4 to slacky64 using MTP. Hm? It's very slow loading photos and it's even slower transferring them. Also, after photos were copied over, not only were their timestamp changed to current date and time instead of date and time taken but my photo viewer program also couldn't display them. That's not good...

I was hoping PTP would work better but no luck. It was even worse; I couldn't even get photos listed in my file manager.

Now, I went on a hunt for better ways to transfer photos.

I tried sftp and scp (with an option to retain the original timestamp) but its process kept dying on me while in the middle of transferring files.

I was kind of frustrated with this. Then, I found dukto in Google Play. It had good reviews and high rating points. I was a bit concerned about this program needing be installed on all devices, but, what the heck, as long as it'll transfer photos, I would be happy at this point.

Installation on the Android device was breeze. There were some extra steps needed to install it on my Slackware system because dukto was available in binary packages for CentOS, Fedora, OpenSUSE, RHEL, and Ubuntu and no source. This means the rpm package needs to be converted to the tgz format with the rpm2tgz command.

Converting rpm with rpm2tgz

Slackware comes with a handy utility to convert rpm files to tgz files. All you need is to run rpm2tgz with rpm file: # cd /tmp # rpm2tgz dukto-6.0-13.1.x86_64.rpm ... Slackware package /tmp/dukto-6.0-13.1.x86_64.tgz created # installpkg /tmp/dukto-6.0-13.1.x86_64.tgz Verifying package dukto-6.0-13.1.x86_64.tgz. Installing package dukto-6.0-13.1.x86_64.tgz: PACKAGE DESCRIPTION: Package dukto-6.0-13.1.x86_64.tgz installed. #

VoilĂ ! The conversion and installation went successful. To run the program, execute dukto: $ dukto

dukto_slacky64

Transferring Files

To transfer file from the Android device to PC:

  1. Open dukto on both devices
  2. On the Android device, click on the icon you want to send your files
  3. Choose Send some files and folders if you are sending files
  4. Locate files you wish to send
  5. Check files
  6. Click on the Send icon

Once selected files have been transferred, the confirmation message is displayed.

dukto_send

Transferring files was snap. In my opinion, the best way to transfer files for Android devices. Although this was the best method by far, I should note that the timestamp of transferred files was still changed. At this point, it's no longer a big issue because file name contains the date taken and this info as well as the time were embedded to file itself.

There are some drawbacks of this program:

  • There is no "select all" button. If you want to copy 100 files, you need to select all those files manually (or you could select a folder)
  • dukto needs to be running on both devices simultaneously
  • dukto must be active while transferring files; otherwise, it halts the process. This means no screensaver as well

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. It is solely used for my purpose and may not be suitable for others. I will NOT take any responsibility of end result after following these steps (although I will try to help if you send me your questions/problems).

That's all!
-gibb

Slackware64: Installing Openbox on Slackware64 14.1

Continued from my previous post, Slackware64: Installing Slackware 14.1, I'm going to install Openbox as my default window manager. And this is how it looks in vm client

slacky64

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

To install Openbox and other packages, visit SlackBuilds.org. Slackbuilds.org offers the collection of slackbuild scripts. A slackbuild script is just a shell script which contains none of the code from the application it is going to install. Its only purpose is to help you build a Slackware package, which you can then install using 'installpkg' or 'upgradepkg'.

Now let's get going...

Installation of Openbox:

First, download the source and slackbuild for openbox: $ cd Downloads/ $ tar -xzvf openbox.tar.gz ... $ mv openbox-3.5.0.tar.gz openbox/; cd openbox $ su # ./openbox.SlackBuild ... # installpkg /tmp/openbox-3.5.0-x86_64-1_SBo.tgz ... Executing install script for openbox-3.5.0-x86_64-1_SBo.tgz Package openbox-3.5.0-x86_64-1_SBo.tgz installed. #

Now, exit X, run 'xwmconfig' and choose xinitrc.openbox-session. Then start X again. I use openbox-session because this executes the 'autoscript' script when Openbox starts. 'autoscript' contains programs that are executed at start-up. At any rate, this time, your X Window is running Openbox. $ startx

slacky64_openbox

Don't be surprised if you see only blank screen. By default, openbox does not offer desktop icons, task bar, etc. But this means its customizable as you like.

obconf:

ObConf is a GTK+ tool to assist with the configuration of the Openbox window manager (from slackbuilds.org).

lxappearance:

LXAppearance is the standard theme switcher of LXDE. Users are able to change the theme, icons, and fonts used by applications easily (from slackbuilds.org).

tint2:

tint2 is a simple panel/taskbar intentionally made for openbox3, but should also work with other window managers.

The goal is to keep a clean and un-intrusive look with lightweight code and compliance with freedesktop specifications (from slackbuilds.org).

Requirement: imlib2

conky:

Conky is a system monitor for X originally based on the torsmo code. Since it's original conception, Conky has changed a fair bit from it's predecessor. Conky can display just about anything, either on your root desktop or in it's own window. Conky has many built-in objects, as well as the ability to execute programs and scripts, then display the output from stdout (from slackbuilds.org).

nitrogen:

Nitrogen is a background browser and setter for X windows (from slackbuilds.org).

Requirement: gtkmm, mm-common, atkmm, pangomm, cairomm, glibmm, libsigc++

rxvt-unicode:

rxvt-unicode is an enhanced version of the rxvt terminal emulator. It has full unicode and Xft support, does font antialiasing and italics, and has the same transparency capabilities as ATerm. It can be extended using Perl. (from slackbuilds.org).

Now follow my previous post, Openbox: Customizing to My Liking

That's all!
-gibb

Slackware64: Installing Slackware 14.1

Long waited new version of Slackware 14.1 was released a few days ago (11/07/2013). I also read a report from Alien Bob about this new version and it looks promising as ever!

Here is a screen shot of my slackware64 14.1 in vm client

slacky64

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

Installing Slackware64 14.1

The installation of this version of Slackware is pretty much the same as previous ones. If you have ever installed Slackware before, there is no surprise. Slackware uses a non-graphical installer. If this is your first try, you may feel a bit overwhelmed but it is really easy to understand.

The most tricky part may be creating partitions with 'fdisk' or 'cfdisk'.

slackware64_partition

I'm used to 'fdisk' so I just run the command: root@slackware:/# fdisk [path_to_drive] Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p) p Partition number (1-4, default 1): 1 First sector (2048-41943039, default 2048): 2048 Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +2G Partition 1 of type Linux and of size 2 GiB is set Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p) p Partition number (1-4, default 2): 2 First sector (4196352-41943039, default 4196352): 4196352 Using default value 4196352 Last section, +sectors or +size{K,M,G} (4196352-41943039, default 41943039): 41943039 Using default value 41943039 Partition 2 of type Linux and of size 18 GiB is set Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): 82 Changed system type of partition 1 to 82 (Linux swap) Command (m for help): a Partition number (1-4): 2 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. root@slackware:/#

After partitioning, run 'setup' to start the setup program.

Addswap:
This enables a selected partition as swap partition. In my case, it's /dev/sda1. The swap partition is an independent section of the hard disk used solely for swapping. Swapping is the process whereby a page of memory is copied to the pre-configured space on the hard disk to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

Linux installation partition:
Next step is to select a partition to install root Slackware files. In my case, I have only one partition to select, /dev/sda2.

Format partition:
Select "Format" to format above selected partition.

Select filesystem:
I choose ext4 filesystem. Ext4 is an advanced level of the ext3 filesystem which incorporates scalability and reliability enhancements for supporting large filesystems (64 bit) in keeping with increasing disk capacities and state-of-the-art feature requirements.

Source media selection:
Select "Install from a Slackware CD or DVD.

Package selection:
I choose the default selection.

Select Installation mode:
I choose "full" to install everything.

USB flash boot:
After the packages installation, it'll ask you whether you want to boot from a USB device. This is surely an option if you don't use LILO or traditional boot loader, but I use LILO to boot the system so I skip this section by selecting "Skip".

Install LILO:
LILO is a Linux Loader which boots the Linux kernel. The setup program offers a few options here. "Simple" and "Expert". Simple installation automatically tries to identify installed OS(es) and enables you to choose. "Export" installation allows you to edit the lilo.conf file. Since I'll have only one OS on this system, the simple method suffices.

Select frame buffer console for LILO to use:
I do not much care about the frame buffer console so I choose the standard.

Kernel parameters for LILO
No extra parameters are needed.

UTF-8 text console
I choose "No".

LILO installation location:
There are a few options here but since I don't have any other OS, it is safe for me to install LILO in the MBR.

Mouse configuration:
I use a USB connected mouse so my choice here is "usb".

Network configuration:
From here on there are questions for network configuration, such as hostname, domain name, network type (DHCP, static IP, etc).

Start-up services:
Default selection

Hardware clock:
The hardware clock is set to the current local time so my selection here is "No".

Timezone configuration:
I select "US/Eastern" here.

Default window manager for X:
Although I know I'm going to install Openbox for my window manager, I choose XFCE here. I used to like KDE but it's too fatty for me now. If you want, you can run 'xfwmconfig' to choose the default again.

Root password:
Choose some strong password for root.

DONE!
Now the installation of new Slackware is done. You can reboot the system and enjoy it.

If you'd like, you can follow my previous post, Slackware64 14: Post Installation Configuration.

That's all!
-gibb

slackware64: Installing qemu-kvm and virt-manager

I've been using VirtualBox for a while on my slackware box. It's been working ok but I recently read a couple of blogs/articles recommending KVM. They said that KVM is rapidly becoming the de facto standard for open source visualization. Interesting. So, I gave a shot with qemu-kvm with libvirt (for GUI).

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

Terminology:

libvirt
libvirt allows management of different virtualization solutions such as KVM and Xen through a common (programming and user) interface.
virt-manager
A graphical virtual machine manager
KVM (Kernel Virtual Machine)
KVM provides full virtualisation and can run unmodified Linux or Windows images, but it requires CPU virtualisation extensions (Intel VT or AMD-V).
Qemu
Qemu functioning as a userspace, software-only emulation package. It can be used standalone (that is, it does not require a special kernel module, or CPU virtualisation extensions, or a hypervisor layer) and is capable of running unmodified operating system images.

Prerequisite:

The CPU needs to support virtualization in order to take advantage of qemu-kvm. To check, execute below command: $ egrep -c '(vmx|svm)' /proc/cpuinfo

If the CPU supports virtualization, you should get a non-zero value.

Or, as Daniel Berrange suggested, virt-host-validate to validate host virtualization setup: # virt-host-validate qemu QEMU: Checking for hardware virtualization: PASS QEMU: Checking for device /dev/kvm : PASS QEMU: Checking for device /dev/whost-net : PASS QEMU: Checking for device /dev/net/tun : PASS

Installation and Post-Configurations:

Install qemu-kvm, libvirt, virt-manager and their dependencies from SlackBuilds.org.

There are a few notes for post-configuration:

  • Configure libvirt for user group and permission:
    Create a group called libvirt and assign a regular user to it. Then, uncomment unix_sock_group and unix_sock_rw_perms from /etc/libvirt/libvirtd.conf # groupadd libvirt # gpasswd -a USER libvirt # vim /etc/libvirt/libvirt.conf ----------------------------------------- unix_sock_group = "libvirt" unix_sock_ro_perms = "0770" unix_sock_rw_perms = "0770"
  • Default user group for kvm:
    The qemu-kvm SlackBuild patches the installed udev rules so that you no longer are required to use the system group kvm as the default. The users group is set as the default
  • Start the libvirt daemon at boot:
    To start the ibvirt daemon at boot, add a following piece of code to /etc/rc.d/rc.local # vim /etc/rc.d/rc.local ---------------------------------------- # Start libvirt: if [ -x /etc/rc.d/rc.libvirt ]; then /etc/rc.d/rc.libvirt start fi

Now Virtual Machine Manager (VMM) can be executed via: $ virt-manager

That's all!
-gibb