Moksha from source on debian bullseye i386 [TUTORIAL]
Feb 1, 2021 2:48:03 GMT
Hippytaff, ylee, and 4 more like this
Post by enigma9o7 on Feb 1, 2021 2:48:03 GMT
Only organic free-range electrons were used in this process.
0. Install Debian 11
Download, boot, and install any of the following ISO:

When prompted to install popularity contest, say yes so they know people still use 32-bit! (optional)

When presented with menu of desktop environments and other add-ons, you can un-select everything. (optional)

After installation login at console with the username and password you created.
Complete Automatic Desktop Installation
This tutorials steps are formatted as a script that will take you all the way from console to a Moksha Desktop with basic apps, two web browsers, plus a youtube app and a few games.
You can download and run directly from a debian console after login with the following commands, which may take around an hour to complete depending on internet, disk, and cpu speed.
Sorry for the complicated syntax on wget, it removes the dos formatted line endings from pastebin.
Spectre/Meltdown Warning: In step 5 I add mitigations=off to kernel boot parameters. This increases speed at the cost of the possibility of apps seeing each others memory, and a rogue app could exploit that maliciously. This is due to a feature implemented for i386 as of kernel 4.19 to mitigate the effects of cpu hardware issues that have always been present that were discovered a couple years ago. If you're using the kernel that comes with Bodhi Legacy (4.9) it does not offer these mitigations so you are already experiencing full speed (and living dangerously) - which would make this new kernel slower than your old one if you don't disable them! The kernel that came with the last Ubuntu 32-bit (4.15) also does not have these mitigations fully implemented. Debian Buster used kernel 4.19 and thus already has these mitigations (and performance hit) in place unless you disabled it this same way, as does Debian Bullseye with kernel version 5.10. Remove that parameter if you prefer security over speed, but in my case this computer is not used for anything important and all the software is from debian or bodhi repos or other trusted sources so I'm not concerned at all.
I recorded a video doing this in a virtual machine with 512MB, all the way through installing debian from iso to full Moksha desktop using this script. Most of the video is boring unedited real time footage, 8 minutes to install debian and over an hour to run the script, then half an hour playing around. See the youtube description for some relevant timestamps.
youtu.be/WdeOmb3L_gI
# Script Begins Here
#1. Install build tools and Moksha dependencies from bullseye repository
#3. Download, Build and Install Moksha

#7. Install Web Browsers (optional)
# Alternatively, bullseye repositories contain firefox-esr (extended service release version 78), epiphany-browser (gnome web), and current chromium packages.




0. Install Debian 11
Download, boot, and install any of the following ISO:
- Testing Daily Free Only: cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd/debian-testing-i386-netinst.iso
- Testing Daily with Proprietary Drivers: cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/daily-builds/sid_d-i/current/i386/iso-cd/firmware-testing-i386-netinst.iso
- Bullseye RC3 (31 July 2021) cdimage.debian.org/cdimage/bullseye_di_rc2/i386/iso-cd/debian-bullseye-DI-rc3-i386-netinst.iso
- Bullseye RC3 with Proprietary Drivers: cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/bullseye_di_rc2+nonfree/i386/iso-cd/firmware-bullseye-DI-rc3-i386-netinst.iso
On real hardware you probably want the proprietary drivers version, but on virtual machine it doesn't really matter, you can add non-free repositories later if desired (and this tutorial includes the steps for that).
There is no reason to use the rc over the daily unless something is broken in today's daily, but that's unlikely since bullseye is close to stable release they are being very selective about targeted fixes and updates only. Release is tentatively scheduled for 14 August 2021.
256MB Note: You must select the text installer from debian installation menu or it will crash, and you wont be offered choice of installer language, but everything works fine.
512MB Note: If you pick the graphical installer, it will tell you not enough memory and force the text based installer anyway (with no limitations).
When prompted for root password, leave it blank and press continue which will force setup of sudo for default user.


When presented with menu of desktop environments and other add-ons, you can un-select everything. (optional)

After installation login at console with the username and password you created.
Complete Automatic Desktop Installation
This tutorials steps are formatted as a script that will take you all the way from console to a Moksha Desktop with basic apps, two web browsers, plus a youtube app and a few games.
You can download and run directly from a debian console after login with the following commands, which may take around an hour to complete depending on internet, disk, and cpu speed.
Sorry for the complicated syntax on wget, it removes the dos formatted line endings from pastebin.
To remove any unwanted optional steps, use nano or vi to edit gomoksha.sh before running (between 2nd & 3rd command).
sudo apt install -y wget nano
wget https://pastebin.com/raw/B31xTq9e -O -|tr '\r' ' ' >gomoksha.sh
sudo bash gomoksha.sh $USER
Spectre/Meltdown Warning: In step 5 I add mitigations=off to kernel boot parameters. This increases speed at the cost of the possibility of apps seeing each others memory, and a rogue app could exploit that maliciously. This is due to a feature implemented for i386 as of kernel 4.19 to mitigate the effects of cpu hardware issues that have always been present that were discovered a couple years ago. If you're using the kernel that comes with Bodhi Legacy (4.9) it does not offer these mitigations so you are already experiencing full speed (and living dangerously) - which would make this new kernel slower than your old one if you don't disable them! The kernel that came with the last Ubuntu 32-bit (4.15) also does not have these mitigations fully implemented. Debian Buster used kernel 4.19 and thus already has these mitigations (and performance hit) in place unless you disabled it this same way, as does Debian Bullseye with kernel version 5.10. Remove that parameter if you prefer security over speed, but in my case this computer is not used for anything important and all the software is from debian or bodhi repos or other trusted sources so I'm not concerned at all.
I recorded a video doing this in a virtual machine with 512MB, all the way through installing debian from iso to full Moksha desktop using this script. Most of the video is boring unedited real time footage, 8 minutes to install debian and over an hour to run the script, then half an hour playing around. See the youtube description for some relevant timestamps.
youtu.be/WdeOmb3L_gI
#1. Install build tools and Moksha dependencies from bullseye repository
# sudo su first, or use sudo as needed, or run as a script with: sudo bash scriptname $USER
apt install -y lightdm meson wget git python3-pip libeet-bin debhelper dbus-x11 pavucontrol network-manager-gnome xclip
apt install -y libasound2-dev libxext-dev libpam0g-dev libxcb-shape0-dev libxcb-keysyms1-dev liblvm2-dev libefl-all-dev
#2. Download, Modify, and Install packages from Bodhi 5 Legacy repository
#These packages are not currently available in bullseye or bodhi 6 repositories for i386.
cd /tmp # use temp folder as these files are not need after installation
wget http://packages.bodhilinux.com/bodhi/pool/b5main/e/edbus/libedbus1_1.7.10-4bodhi1_i386.deb
dpkg-deb -x libedbus1_1.7.10-4bodhi1_i386.deb edbus
dpkg-deb -e libedbus1_1.7.10-4bodhi1_i386.deb edbus/DEBIAN
sed -i 's/libefl/libefl-all-dev/g' edbus/DEBIAN/control # libefl--> libefl-all-dev
fakeroot dpkg-deb -b edbus bullseye-edbus.deb
wget http://packages.bodhilinux.com/bodhi/pool/b5main/e/edbus/libedbus-dev_1.7.10-4bodhi1_i386.deb
dpkg-deb -x libedbus-dev_1.7.10-4bodhi1_i386.deb edbus-dev
dpkg-deb -e libedbus-dev_1.7.10-4bodhi1_i386.deb edbus-dev/DEBIAN
sed -i 's/libefl-dev/libefl-all-dev/g' edbus-dev/DEBIAN/control # libefl-dev --> libefl-all-dev
fakeroot dpkg-deb -b edbus-dev bullseye-edbus-dev.deb
wget http://packages.bodhilinux.com/bodhi/pool/b5main/u/udisks/udisks_1.0.5-1_i386.deb
dpkg-deb -x udisks_1.0.5-1_i386.deb udisks
dpkg-deb -e udisks_1.0.5-1_i386.deb udisks/DEBIAN
sed -i 's/liblvm2app2.2/liblvm2-dev/g' udisks/DEBIAN/control # liblvm2app2.2--> liblvm2-dev
fakeroot dpkg-deb -b udisks bullseye-udisks.deb
apt install -y ./bullseye-*.deb
#3. Download, Build and Install Moksha
git clone https://github.com/JeffHoogland/moksha
cd moksha
./autogen.sh --prefix=/usr
make
make install
# Technically Moksha is installed and you could boot into it, but you wouldn't have a terminal or applications menu, and the network manager likely would not work.#4. Prepare Moksha Desktop Basic Functionality
apt install -y terminology # install any x-terminal
sed -i 's/aged=false/aged=true/g' /etc/NetworkManager/NetworkManager.conf # allow network manager to manage network
sed -i 's/Exec=vim/Exec=vi/g' /usr/share/applications/vim.desktop # fix vim menu shortcut
wget http://packages.bodhilinux.com/bodhi/pool/b6main/b/bodhilinux-keyring/bodhilinux-keyring_2020.12.17_all.deb
apt install -y ./bodhilinux-keyring_2020.12.17_all.deb # install key to bodhi 6 repository
echo "deb http://packages.bodhilinux.com/bodhi focal b6main" > /etc/apt/sources.list.d/bodhi-b6main.list # add to list
echo "Package: *
Pin: release n=b6main
Pin-Priority: 50" > /etc/apt/preferences.d/bodhi-b6main-pin # make Bodhi repositories low priority
apt update # update software database
apt install -y arandr moksha-menu pm-utils # install Moksha menu, display GUI, and suspend/hibernate
# Moksha is ready! If going step-by-step you can now reboot with "sudo systemctl reboot". At the lightdm greeting screen select Moksha from the drop down menu then login. 
# Open a terminal and continue with any of the following optional commands to setup software for your new desktop; dont forget to sudo su first.
#5. Make more user friendly (optional)
#5. Make more user friendly (optional)
sed -i 's/TIMEOUT=5/TIMEOUT=2\nGRUB_TIMEOUT_STYLE=hidden/g' /etc/default/grub # dont show grub menu (two seconds to hit Esc)
sed -i 's/UX_DEFAULT="quiet"/UX_DEFAULT="quiet splash mitigations=off"/g' /etc/default/grub # show splash & disable spectre/meltdown mitigation
update-grub # disabled mitigation is speed vs security tradeoff
sed -i "s/#autologin-user=/autologin-user=$1/g" /etc/lightdm/lightdm.conf # if not scripted replace $1 with your username
sed -i 's/#autologin-session=/autologin-session=enlightenment/g' /etc/lightdm/lightdm.conf # automatic login to moksha for first boot
apt install -y psmisc bash-completion # install killall and make stuff autocomplete
apt install -y software-properties-common # install tools for managing repos
apt-add-repository non-free # allow "non-free" closed source no cost software
apt-add-repository contrib # allow free software that depends on "non-free"
apt update && apt upgrade -y # update package database and upgrade all software
apt install -y command-not-found # install tool to suggest packages
apt-file update && update-command-not-found # prepare and update command-not-found database
apt install -y thunar-archive-plugin mousepad evince gdebi mpv synaptic lxtask # install some basic useful gui applications
apt install -y gtk2-engines # prevent gtk warnings about missing clearlooks
apt install -y neofetch imagemagick # install neofetch & create neo alias w/debian logo
echo 'alias neo="pushd /usr/share/icons/vendor/256x256/emblems>/dev/null;neofetch --tycat ./emblem-vendor.png;popd>/dev/null"' >>/etc/bash.bashrc
sed -i 's/(color depth=q16)//g' /usr/share/applications/display-im6.q16.desktop # cleanup imagemagick menu entry
echo 'alias reboot="systemctl reboot"' >>/etc/bash.bashrc # simplify reboot command
echo 'alias vim=vi' >>/etc/bash.bashrc # the vi included with debian is vim so alias it
echo "set linenumbers" >>/etc/nanorc # display line numbers by default in nano
#6. Install some Bodhi themes (optional)
# Note radiance and kl4k themes packaged for bodhi will not install on debian without modification due to additional ubuntu specific dependencies, but all others work, these are just my favorites.apt install -y equivs # install tool to create dummy packages
mkdir /tmp/themez;cd /tmp/themez
echo "Package: moksha
Version: 0.3.2-git
Architecture: any
Provides: enlightenment, x-window-manager
Description: DUMMY X11 Window manager based on E17" >>bullseye-moksha
equivs-build bullseye-moksha # create dummy moksha package
echo "Package: libefl
Version: 1.25
Architecture: all
Depends: libefl-all-dev
Description: DUMMY Enlightenment Foundation Libraries" > bullseye-libefl
equivs-build bullseye-libefl # create dummy libefl package
apt install -y ./*.deb bodhi-theme-moksha-arc-green bodhi-theme-moksha-detour bodhi-theme-moksha-green bodhi-theme-moksha-passion bodhi-theme-moksha-viceversa
#7. Install Web Browsers (optional)
# Alternatively, bullseye repositories contain firefox-esr (extended service release version 78), epiphany-browser (gnome web), and current chromium packages.
# Firefox (current Mozila stable version from debian "unstable" repository)
echo "deb http://deb.debian.org/debian/ unstable main contrib non-free" | tee -a /etc/apt/sources.list
echo "Package: *
Pin: release a=stable
Pin-Priority: 100
Package: *
Pin: release a=unstable
Pin-Priority: 10"|sudo tee /etc/apt|sudo tee /etc/apt/preferences.d/debian-unstable-pin # prevent automatic install from unstable repo
apt update
apt install -y -t unstable firefox
apt install -y webext-ublock-origin-firefox # optional add blocker
# Palemoon (less resource usage than Firefox & supports ublock origin, current stable from developer recommended repository)
apt install -y curl
echo 'deb http://download.opensuse.org/repositories/home:/stevenpusser:/palemoon-GTK3/Debian_11/ /' | sudo tee /etc/apt/sources.list.d/home:stevenpusser.list
curl -fsSL https://download.opensuse.org/repositories/home:/stevenpusser:/palemoon-GTK3/Debian_11//Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_stevenpusser.gpg > /dev/null
apt update
apt install -y palemoon
sed -i 's/="pale moon"/=Pale moon/g' /usr/share/applications/palemoon.desktop # makes icon work correctly in plank dock etc
#8. Build & Install latest Minitube (optional but good for youtube on older machines - but current bug requires opengl2 support)
apt install -y minitube qttools5-dev-tools qt5-qmake qtdeclarative5-dev libqt5sql5-sqlite libqt5x11extras5-dev qt5-image-formats-plugins libmpv-dev
git clone --recursive https://github.com/flaviotordini/minitube.git
cd minitube
qmake
make
make install # overwrite installed version (will still update from debian repo)
# 9. Install Games (optional)
apt install -y supertux extremetuxracer frozen-bubble pingus # Tux Games may not all perform well w/o acceleration
apt install -y aisleriot # no OS install is complete without solitaire
#10. Reboot and Profit
systemctl reboot
# Script Ends Here
# Explore your new desktop!
# Set resolution if needed with arandr. Save to moksha from drop down menu.
# Unmute sound and set volume
# Set terminology scale factor (1.3), font size (11), and background (texture).
# Set moksha scale factor in settings panel/look (1.5-1.7)
# Set a theme - vice-versa is really nice - or mix and match, for example...
# Sample Custom Dark Green Theme w/Hi-Color Icons:
# Base Theme: MokshaGreen
# Theme Advanced - modules: MokshaArcGreen
# Theme Advanced - modules/tasks: MokshaGreen
# Application Theme: Adwaita-Dark
# Application Theme Icons: Adwaita
# Elementary Theme: MokshaGreen
# Elementary Icons: MokshaArcGreen
# Always set elementary theme and icons after every time you change Moksha base theme!
# Always restart Moksha after setting terminology/elementary scale factor, theme, or icons!



