EndeavourOS Anywhere

I have been setting out to replicate some past work with Manjaro and to re-implement it on EndeavourOS.

In short, I have installed EndeavourOS Xfce onto a solid state USB drive (actually a Samsung T7) in such a way that it will boot on all of the systems I have at home. This means:

  • Systems with UEFI or Legacy BIOS boot
  • Systems with Intel graphics
  • Systems with Nvidia graphics
  • Systems with AMD graphics

It’s a real system with persistence and all of my favorite tools installed, up-to-date and working.

It includes an automatic but crude re-scaling of the desktop so that the system is usable on a 13 inch laptop or a 65 inch 4k TV.

Over the next few days I will tidy things up a little and post some detailed instructions for others who may be interested. It’s not terribly complex or difficult.

2 Likes

That’s kind cool. I did much simpler (UEFI only, AMD & Intel only) last year, but didn’t use it enough to keep it going.

Looks interesting. :+1:t2:

It’s a cool idea, but if you aren’t going to use it everyday it will go out of date FAST. That’s the one time I’d recommend a point release distribution like openSUSE Leap.

1 Like

Minor issue, at least for me. I work primarily with a desktop. But I have laptop on my desk too. I just boot up my “everywhere” disk on the laptop and update it once a week or so. It normally takes less than 5 minutes.

On the plus side, it’s set up like my other Linux system with all my favorite tools and customizations.

Objective

Install EndeavourOS with Xfce onto a USB disk drive that is bootable on almost every PC.

STAGE 1

Get ready:

  • Download the latest EndeavourOS ISO
  • Burn to a thumb drive using BalenaEtcher
  • Boot the thumb drive IN BIOS/LEGACY MODE

STAGE 2

Prepare the target disk:

Boot from the EndeavourOS installation media IN BIOS/LEGACY MODE

Install and run gparted
Select target device
Use Device menu to create new partition table of type GPT.

Create the following partitions:

  8MB type unformatted
  1000MB type FAT32
  xxxxGB type ext4

Right click the 8MB partition, select Manage flags , and select bios_grub.
Right click the 1000MB partition, select Manage flags , and select boot/esp.

STAGE 3

Perform the installation.

Run the EndeavourOS installer but select Manual Partitioning.

Select the ext4 partition created above as the root (mount point for ‘/’).

STAGE 4

Install the UEFI Boot Loader

Reboot installation media but this time IN UEFI MODE.

Execute the following two commands:

sudo su
fdisk -l

Carefully note the identify of the target device (e.g. /dev/sdc).

Execute the following commands, substituting “X” with the appropriate drive letter

umount /dev/sdX3
umount /dev/sdX2
mount /dev/sdX3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sdX2 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount -t proc proc /mnt/proc
mount -t sysfs sysfs /mnt/sys
mount -t tmpfs tmpfs /mnt/run
chroot /mnt
grub-install --efi-directory=/boot/efi --target=x86_64-efi --removable
update-grub
blkid | grep /dev/sdX2 # Note UUID, which is in format XXXX-XXXX.
echo “UUID=XXXX-XXXX /boot/efi vfat umask=0077 0 1” >> /etc/fstab
sync
exit
sync
poweroff

STAGE 5

Now reboot the system from the newly created (target) disk.

At this point the system should be bootable in Legacy BIOS or UEFI
modes and you may wish to verify that.

Then continue…

In this section replace ‘xxxxxx’ with YOUR username.

sudo pacman -S amd-ucode
sudo pacman -S intel-ucode

Grab the mhwd-gpu script from:

Install with execute permissions e.g. in /usr/bin

Create the folder: /etc/X11/mhwd.d/

Create the file: /etc/X11/mhwd.d/amd.conf

Section “Device”
Identifier “AMD”
Driver “amdgpu”
EndSection

Create the file: /etc/X11/mhwd.d/intel.conf

Section “Device”
Identifier “Intel Graphics”
Driver “intel”
EndSection

Create the file: /etc/X11/mhwd.d/nvidia.conf

Section “Device”
Identifier “Device0”
Driver “nouveau”
VendorName “NVIDIA Corporation”
Option “NoLogo” “1”
EndSection

Create the file: /usr/lib/systemd/system/myvideoselect.service

[Unit]
Description=LiveMedia Config Script
Before=systemd-user-sessions.service

[Service]
Type=oneshot
ExecStart=/home/xxxxxx/set-video-driver

[Install]
WantedBy=multi-user.target

Enable the newly created service:
sudo systemctl enable myvideoselect

Create and 755 the file: /home/xxxxxx/set-video-driver

#!/bin/sh
NOW=$(date +“%F”)
NOWT=$(date +“%T”)
# We can pick up mmmintel/mmmnvidia/mmmamd switches added to the boot
if cat /proc/cmdline | grep -i ‘mmmamd’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/amd.conf
exit 0
fi
if cat /proc/cmdline | grep -i ‘mmmintel’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/intel.conf
exit 0
fi
if cat /proc/cmdline | grep -i ‘mmmnvidia’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/nvidia.conf
exit 0
fi

if lspci -nn | grep -i ‘[0300].*amd’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/amd.conf
echo “Boot AMD $NOW $NOWT” >> /home/xxxxxx/boot.log
exit 0
fi
if lspci -nn | grep -i ‘[0300].*intel’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/intel.conf
echo “Boot Intel $NOW $NOWT” >> /home/xxxxxx/boot.log
exit 0
fi
if lspci -nn | grep -i ‘[0300].*nvidia’; then
mhwd-gpu --setxorg /etc/X11/mhwd.d/nvidia.conf
echo “Boot Nvidia $NOW $NOWT” >> /home/xxxxxx/boot.log
exit 0
fi
mhwd-gpu --setxorg /etc/X11/mhwd.d/intel.conf

Optionally you may wish to create a script that will automatically
change the Window Manager Style and display scaling according to
the screen resolution of the target device. The following rather
crude approach works for me.

Create and 755: /home/xxxxxx/set-display

#!/bin/sh
if xrandr | grep * | grep ‘[2-9][0-9][0-9][0-9]x’ ; then
xfconf-query -c xsettings -p /Gdk/WindowScalingFactor -s 2
xfconf-query -c xsettings -p /Gtk/CursorThemeSize -t int -s 64
xfconf-query -c xfwm4 -p /general/theme -t string -s “Numix HiDPI”
export QT_SCALE_FACTOR=2
else
xfconf-query -c xsettings -p /Gdk/WindowScalingFactor -s 1
xfconf-query -c xsettings -p /Gtk/CursorThemeSize -t int -s 32
xfconf-query -c xfwm4 -p /general/theme -t string -s “Piranha”
export QT_SCALE_FACTOR=1
fi
xfce4-panel -r

And run it at login

STAGE 6

The system should now be bootable on most systems.

You can verify satisfactory operation and then install any other
packages you require and adjust the various system settings
according to personal preferences.

3 Likes

Really cool idea. Interested to see where it goes.