Monday, February 8, 2021

Slackware64-current In MacBook Pro

I am just another regular Slackware user, who likes tinkering around with machines and installing Slackware64-current on them to check on their performance and if Slackware64-current can work on them.

I received a MacBook Pro from one of my customers and wanted to see if I could install Slackware64-current natively on it, since it had an issue that would cost $300 to $500 to fix with the built-in or integrated (soldered to the motherboard) video card, which all laptops have anyway.  These are the steps I took and the URLs I gathered in this process.

Note:  Do this at your own risk.  I assume no responsibility if something goes wrong.  This procedure will format the whole drive and you will lose macOS on it.

01) Download Slackware64-current iso (https://slackware.nl/slackware/slackware64-current-iso/) and create a USB bootable stick with it

02) Hold "alt" or "option" before pressing the power button on the MacBook Pro.  Release it when you see "EFI Boot"

03) Double click on "EFI Boot" to start the Slackware64-current installation

04) Use cfdisk or cgdisk to create partitions.  The first partition should be a 100M EFI partition.  Other partitions can include a swap partition, a root ("/") partition and a home ("/home") partitions or any other partition that you need.  The EFI partition is required for this procedure to work

05) Run setup as with any other installation and follow the prompts.  After it finishes installing the system, it will encounter the EFI partition and ask you if you want to format it

06) Click on "install" on the "ELILO (EFI Linux Loader) installation" screen

Note:  The text mentions "Apple computers use a different type of EFI firmware and efibotmgr has been know to damage them.  On all other computers, it is recommended to add a boot menu entry." and give the options to "install" or "skip".  This is the step that creates the boot entry and makes the MacBook Pro recognize the partition and allow you to boot from the installation

07) Remove elilo and configure grub.  I could not get elilo to work once I updated the kernel, plus I "pimped" my Slackware64-current installation a bit, by creating a png file to display while grub loads with 5 a seconds countdown.  I also downloaded a font to use in this splash screen in grub.  You can still use "e" while grub is displayed on the screen to login into a different runlevel

Files:

# grub (place it in /etc/default/ or run the script)

# If you change this file, run grub-mkconfig -o /boot/grub/grub.cfg
# afterwards to update /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Slackware"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vga=current"
GRUB_FONT="/boot/grub/fonts/unicode.pf2"
GRUB_DISABLE_OS_PROBER=true
GRUB_BACKGROUND="/boot/grub/SlackGrub.png"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1280x1024

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

# Save this image as SlackGrub.png and place it in /boot/grub/


Script:

# I saved it as grubconf.sh and chmod +x for it to run

#!/bin/bash
echo "Removing elilo"
removepkg elilo
cd /boot/efi/EFI/Slackware
mv elilo.conf elilo.conf.orig
mv elilo.efi elilo.efi.orig

echo "Configuring grub"
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck --debug
mkdir -p /boot/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

echo "Copying grub files"
cp grub /etc/default/grub
cp SlackGrub.png /boot/grub/SlackGrub.png
mkdir /boot/grub/fonts
cp unicode.pf2 /boot/grub/fonts/unicode.pf2

echo "Reconfiguring grub"
grub-mkconfig -o /boot/grub/grub.cfg

URLs:

https://docs.slackware.com/howtos:slackware_admin:set_up_grub_as_boot_loader_on_uefi_based_hardware

https://github.com/anak10thn/ign-bootloader/blob/master/ign-grub2/config/boot/grub/ -- Download unicode.pf2 from it

Regards,

F. Bobbio C.

Monday, January 18, 2021

Citrix WorkSpace In Slackware64-current

Some time ago I wrote about Citrix Receiver In Mozilla Firefox (64-bit) In Slackware64-current. Citrix Receiver has been replaced by Citrix WorkSpace. These are the steps to install it in Slackware64-current. 

1) Repackage and install libmanette (SlackBuild: https://github.com/conraid/SlackBuilds/tree/master/libmanette and package: https://ftp.acc.umu.se/pub/GNOME/sources/libmanette/) and webkit2gtk (SlackBuild: http://cgit.ponce.cc/slackbuilds/tree/libraries/webkit2gtk and package: https://www.webkitgtk.org/releases/)

2) Download the "Tarball Packages" Citrix WorkSpace app for Linux (x86_64) from https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html

3) Untar the package

4) Open a terminal, su, enter root password

5) Run ./setupwfc and accept all defaults for installation

6) cd /opt/Citrix/ICAClient

7) Run ./selfservice or open Citrix WorkSpace app from KDE menu

8) Check https://www.citrix.com/content/dam/citrix/en_us/documents/downloads/citrix-receiver/linux-oem-guide-13-1.pdf for information on mapping drives (Hint: Search for "DrivePathA...Z" on page 72 of 104 and read on ~/.ICAClient/wfclient.ini file)

Regards,

F. Bobbio C.

Monday, December 23, 2019

Grub In Slackware64-current

After upgrading to kernel 5.4.1 in Slackware64-current, elilo did not work at all, even after running eliloconfig. I realized that the latest Slackware64-current ISO (http://slackware.uk/people/alien-current-iso/slackware64-current-iso/) was running grub as the bootloader. I decided to give grub a try. These are the steps I followed:

1) Uninstall elilo (removepkg elilo)
2) Removed all files under /boot/efi/EFI/elilo (create a backup before removing the folder, in case you need the files afterwards)
3) Run "grub-mkconfig -o /boot/grub/grub.cfg" to create the required boot entries
4) Reboot and test

Regards,

F. Bobbio C.

NVIDIA GeForce GTX 1050 In Slackware64-current

Update 12-30-2019: My DisplayLink based USB 3.0 docking station is working nicely with the NVIDIA driver now. I had to modify the /etc/rc.d/rc.local file and add the following lines:

# Load evdi after reboot
modprobe evdi
cd /usr/lib64/displaylink
./DisplayLinkManager &
# Create missing nvidia device nodes after reboot
/usr/bin/nvidia-modprobe -c 0 -u

I am also using the latest versions of xorg-server, x-org-server-xephyr, xorg-server-xnest and xorg-server-xvfb. I documented all the changes here: http://docs.slackware.com/talk:howtos:hardware:displaylink

Update 12-26-2019: My DisplayLink based USB 3.0 docking station did not play nicely with the NVIDIA driver. I am using it without the xorg.conf file and the Intel chip. I will use the xorg.conf file and NVIDIA driver in situations when I have to use the HDMI port and the Intel driver without the xorg.conf file when using the USB 3.0 docking station

My old and trusty Toshiba laptop "died" and I needed to replace it. I purchased an Acer Nitro 5 AN515-53-52FA laptop with an Intel Core i5-8300H Processor 2.3GHz and an NVIDIA GeForce GTX 1050 4GB GDDR5 video card. The Intel built-in video driver worked out of the box on Slackware64-current (kernel 5.4.6), but the NVidia driver could not install and work properly. At the time of this writing, the latest version was 440.44 (https://www.nvidia.com/Download/driverResults.aspx/156086/en-us). The Intel driver did not display the HDMI port at all when running xrandr, only eDP-1-1. I read various pages of tutorials and gathered enough information to fix the issue

I repackaged nvidia-kernel (http://www.slackbuilds.org/repository/14.2/system/nvidia-kernel/) and nvidia-driver (http://www.slackbuilds.org/repository/14.2/system/nvidia-driver/) using the latest .run file. Once the driver and kernel packages were ready, I installed them and rebooted, with some issues. I rebooted again, and pressed "e" at the grub screen and added "3" at the line starting with "linux" and pressed F10 to boot into runlevel 3 (multiuser, no GUI, just cli, with networking)

I edited the following files:

/etc/X11/xorg.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Files"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "Yes"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection

/usr/share/sddm/scripts/Xsetup
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

I also removed all files under /var/lib/sddm
rm -R /var/lib/sddm/*

Upon reboot in runlevel 4, I was able to view port HDMI-0 and plugged in a TV with an HDMI cable. The resolution was 1920 x 1080. The audio also worked in the TV and the laptop was able to use the HDMI port for audio

I hope this helps someone

Regards,

F. Bobbio C.

Monday, July 22, 2019

Meraki L2TP VPN Connection In Slackware64-current Plasma 5 - KDE 5

I needed a Meraki VPN connection for Slackware64-current as listed here: https://documentation.meraki.com/MX/Client_VPN/Client_VPN_OS_Configuration#Linux

I took the idea from http://stuffjasondoes.com/2018/08/16/configuring-meraki-client-vpn-on-linux-mint-19-network-manager/

You can find more information here: https://wiki.gnome.org/Projects/NetworkManager/VPN

1) Download NetworkManager-l2tp 1.2.12 from https://github.com/nm-l2tp/NetworkManager-l2tp/releases

2) Repackage NetworkManager-l2tp using the following, modified SlackBuild:

#!/bin/sh

# Slackware build script for NetworkManager-l2tp

# Copyright 2010-2017 Robby Workman, Tuscaloosa, Alabama, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PRGNAM=NetworkManager-l2tp
VERSION=${VERSION:-1.2.12}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--without-libnm-glib \
--build=$ARCH-slackware-linux

make
make install DESTDIR=$PKG

# Create the chroot directory
mkdir -p $PKG/var/lib/l2tp/chroot

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

3) Download, repackage and install xl2tpd 1.3.14 using the SlackBuild from ponce's repository: http://cgit.ponce.cc/slackbuilds/tree/network/xl2tpd

4) Download, repackage and install strongswan 5.8.0 using the SlackBuild from ponce's repository: http://cgit.ponce.cc/slackbuilds/tree/network/strongswan

5) Create the VPN connection using NetworkManager, as a "Layer 2 Tunneling Protocol (L2TP)" connection:

Give the connection a name under "Connection name:" on the top section
Under the "VPN (l2tp)" tab, enter the "Gateway:", "User name:", "Password:" and "NT Domain:"
Under the "VPN (l2tp)" tab, click on "IPsec Settings...", check "Enable IPsec tunnel to L2TP host", enter your secret under "Pre-shared Key:", enter 3des-sha1-modp1024 under "Phase1 algorithms:" and 3des-sha1 under "Phase2 algorithms:", click on "OK"
Under the "VPN (l2tp)" tab, click on "PPP Settings...", check only "PAP" under "Allow following authentication methods" and uncheck all other methods, uncheck "Use MPPE Encryption", check "Allow BSD compression", "Allow Deflate compression", "Allow TCP header compression", "Use protocol field compression negotiation", and "Use Address/Control compression". Leave "Send PPP echo packets" unchecked. Under "Other Settings", change "MRU:" and "MTU:" to 1400, click on "OK"
Under the "IPv4" tab, enter your Active Directory domain or domains under "Search Domains:". Click on "Routes...". Click on "+ Add" and enter the proper "Address", "Netmask", "Gateway" and "Metric". Click on "+ Add" and follow the same instructions until you add all proper routes (Hint: Routes can be found by running route in a terminal session). Click on "OK"
Click on "Apply" and then on "OK"

6) Test your newly created L2TP connection

Regards,

F. Bobbio C.

Friday, September 28, 2018

Microsoft Exchange Mozilla Thunderbird Integration

Update 08-28-2022: TbSync does not work with Thunderbird 102.2.0.  I am now using OWA

Update 09-21-2019: ExchangeCalendar does not work with Thunderbird 68.1.0. I am now using IMAP + TbSync successfully

Update 08-18-2019: Since ExQuilla has slowed down the opening of Thunderbird (2 to 3 minutes to open Thunderbird, with constant "freezing" during the day) I am now using the Exchange accounts via IMAP + TbSync + ExchangeCalendar

Update 12-30-2018: I now use ExchangeCalendar (https://github.com/ExchangeCalendar/exchangecalendar/releases) instead of TbSync. ExchangeCalendar integrates seamlessly with Thunderbird to display meetings and times slotted in Exchange

Most of the users I encounter work in a Microsoft Windows environment or use a Microsoft Windows based machine (desktop or laptop). Some others use a macOS based machine (iMac, MacBook Air or MacBook Pro). The rest of us, though, prefer to work in a Linux based machine, some with access to cli and others with a GUI

In a Microsoft Windows business environment, the business "de facto" E-Mail client is Microsoft Outlook, since it communicates with Exchange servers to synchronize E-Mails, calendars, tasks and contacts. Microsoft Outlook can also be installed in macOS based devices, with similar capabilities. In Linux, some of us use Mozilla Thunderbird

One big issue that most Mozilla Thunderbird users encounter is the inability to tie directly to Exchange. The workaround is either using the web portal for Microsoft (https://outlook.office365.com), but in some cases (nowadays less and less) the Exchange server is on premises. Meet ExQuilla for Microsoft Exchange by R Kent James and TbSync by John Bieling. Both, ExQuilla and TbSync, are add-ons for Mozilla Thunderbird

ExQuilla can be downloaded from https://addons.thunderbird.net/en-US/thunderbird/addon/exquilla-exchange-web-services/ as an xpi file and installed in Mozilla Thunderbird by clicking on "Tools", "Add-ons", the gear on the top section, towards the left, "Install Add-on From File...". Once it is installed, either use the "Autodiscover" feature or the "Manual" one. In my case, I had to use the "Manual" one, enter the "Microsoft Exchange EWS URL" (https://outlook.office365.com/EWS/Exchange.asmx) and "Test EWS URL". The proper EWS URL can be found following step 2. in https://support.neuxpower.com/hc/en-us/articles/202482832-Determining-the-Exchange-Web-Services-EWS-URL

TbSync can be downloaded from https://github.com/jobisoft/TbSync/releases as an xpi file as well using the same procedure for installing ExQuilla. Once installed, double click the icon on the lower right corner of Mozilla Thunderbird labeled "TbSync: Idle", click on "Account actions", "+ Add new account", "Exchange ActiveSync (EAS)", enter proper information and either use the "Automatic configuration via ActiveSync Autodiscover" or "Custom configuration". In my case, I had to use the "Custom configuration", with "Server address" https://outlook.office365.com and "ActiveSync version" v2.5. Click on "Enable account & try to connect to server"

The E-Mails will show as a new account with an "X" preceding it on the left pane in Mozilla Thunderbird. The contacts will show in the "Address Book". The address book with "/GAL" will allow for contact queries/searches, as if you were using Microsoft Outlook. The same procedure can be used in Mozilla Thunderbird in Microsoft Windows and macOS based machines

Regards,

F. Bobbio C.

Friday, August 3, 2018

Automated Data Transfer - Linux To Windows + Vice Versa

Recently one of the developers where I work had an interesting task to accomplish: Transfer data from a Windows server to a Linux server and vice versa automatically every 5 minutes for a production environment. The data originated at the Windows server, was processed in the Linux server, copied to a different path and the result needed to be copied back to the Windows server, to a different folder. The accounting users were saving the original data to a Windows shared folder. The process needed to originate at the Windows server, since my team mates were not proficient in Linux, in case the files needed to be modified later on

Thanks to WinSCP, the solution was simple:

1) Create a batch file (WinSCP2Linux.bat) with permissions for service account to read and execute. The content should be something similar to this:

winscp.com /ini=nul /synchronize /script=C:\Users\LocalAdmin\ScriptCopyToOracle.txt

2) Create a text file (C:\Users\LocalAdmin\ScriptCopyToOracle.txt), with permissions for service account to read and execute. The content should be something similar to this:

open sftp://LinuxServerUsername:LinuxServerUserPassword@LinuxServerName/ -hostkey="ssh-rsa 2048 xx:yy:zz:aa:bb:cc..."
put C:\Path\To\Windows\Original\Files\* /path/to/Linux/server/firstfolder/
get /path/to/Linux/server/secondfolder/* C:\Path\To\Windows\Processed\Files\
exit

Note: LinuxServerUsername requires read and write permissions to both Linux folders for this procedure to work. Both Windows folders have read and write permissions

3) Create a task via "Task Scheduler" which runs the batch file every 5 minutes and runs under the service account specified in step 1)

The task will only synchronize files that are not in the folders every 5 minutes. I would recommend testing if the task works by opening an elevated command prompt ("Start", cmd, right click, "Run as administrator"), pasting winscp.com /ini=nul /synchronize /script=C:\Users\LocalAdmin\ScriptCopyToOracle.txt into it and hitting the "Enter" key. If there are no errors, you should see the processed files in the firstfolder in Linux and in the processed files folder in Windows

The Linux server was running Red Hat Linux and the Windows server was on Windows Server 2012

Regards,

F. Bobbio C.