Saturday, May 22, 2021

Make a multiple purpose system from PINN and Raspberry Pi OS 32 bits lite

🕐🕐 Duration: 2 to 3 hours
🔧🔧 Difficulty: Medium
🌟🌟🌟 Interest: Interesting

Here I am going to suggest you an idea of a multiple purpose OS running on a single partition of your Raspberry Pi.

The approach of this post is to install one single partition from PINN, install what is needed, and ensure that only what is needed to run runs.

This installation will support:

  • Basic RPD
  • Kodi from command line
  • RetroArch from command line
  • a UI selector bash script

This installation will be made on a 64gb SD card. It is important to mention it when checking the results in conclusion.

Note that using Berryboot can help you get similar results. There will be a post to compare Berryboot and PINN.

Prerequisite

Make a backup of your important data (tar /home/pi/ and either set it on external hard drive or upload it to a cloud service).

Getting started

Boot in PINN, untick all the systems on the first screen, all tabs, choose "Raspberry Pi OS 32 bits lite" in "minimal" tab and click install.

DietPi?

DietPi is another option in comparison of Raspberry Pi OS 32 bits lite. What I like the most in DietPi is that the CPU frequency latency change is 4x lower than in Raspberry Pi OS 32 bits lite. However I was having much trouble with DietPi running Wine-x86 apps. Until I get my hands on a perfectly working DietPi installation, I will go on with a Raspberry Pi OS 32 bits lite basis.

Getting comfortable

After installation:
  • Launch raspi-config

sudo raspi-config 
  • Edit keyboard and locale settings
  • Set GL driver to Fake-KMS in Advanced>GL driver
  • Set boot starting mode to console autologin 
  • Don't reboot yet, first edit config.txt:
sudo nano /boot/config.txt
  • Make sure that disable_overscan is set to 1 and uncommented
  • Then reboot:
sudo reboot

After reboot:
Install Raspberry Pi Desktop(RPD), Kodi and dialog (will be of use later):

sudo apt-get update

sudo apt-get install -y raspberrypi-ui-mods kodi dialog

Kodi and RPD should now work if you type in:

kodi

kodi raspberry pi os 32 bits lite
Kodi installation is pretty straightforward
RPD
/etc/init.d/lightdm start
RPD Raspberry Pi OS 32 bits lite
RPD installation is pretty straightforward as well



Installing RetroArch

For this, you'll have to git clone and install the needed deps. If you are purely lazy, you can use my script as it does a safe install. Get it here.

If you want to do it yourself, here are the pointers. You will get something more beautiful if you enable x11 and ttf but RetroArch compiling sometimes gives trouble and it's not always easy to figure out which option made everything fail:

sudo apt-get update

sudo apt-get install -y git cmake make build-essential libasound2-dev libegl-dev libdrm-dev libgbm-dev libgles-dev libudev-dev

rm -rf RetroArch/

git clone https://github.com/libretro/RetroArch/

cd RetroArch 

./configure --disable-videocore --disable-opengl1 --enable-opengles --enable-opengles3 --enable-opengl_core --enable-kms --enable-floathard --disable-ffmpeg --enable-udev --enable-alsa --disable-pulse --disable-oss --disable-freetype --disable-7zip --disable-x11

make -j3

sudo make install

And you can then start RetroArch quite easily:

retroarch
RetroArch is a bit trickier to install.
Be careful choosing the right options in ./configure

Optional: if you want to get back "beautiful" Lakka interface, go to Settings menu > User Interface and choose xmb. You will get back that neat blue screen.

Setting up multiple boot

We are here going to use the dialog package: our philosophy on this post is to make everything start from console. Dialog has a good interface which you can browse with arrow keys. You can download my dialog script here and place it in /home/pi/

If you want to write it down yourself, here is the code:

case $(dialog --menu "Select UI" 15 40 4 1 "Raspberry Pi Desktop" 2 Kodi 3 RetroArch 4 "Console Mode" 2>&1 >/dev/tty1) in
        1)
          /etc/init.d/lightdm start
          ;;
        2)
          kodi
          ;;
        3)
          retroarch
          ;;
        4)
          clear
  ;;
        *) echo "invalid option $CHOICE";;
esac

Name this script "selector.sh" and place it in /home/pi/
 
Make sure to:
 
chmod 755 /home/pi/selector.sh
 
Then lastly, update /home/pi/.profile and add at the very end of it:

/home/pi/selector.sh

then:

sudo reboot

Reboot should now end in dialog menu.
Raspberry Pi OS multiboot
Handmade multiboot on a single partition. Ta-da!

You can test every menu entry and then go 4 - Console Mode and type in "df":
Raspberry Pi multiboot DF
The system has multiboot and has access to your entire SD card

Conclusion

This method will allow you to get all your runnables and no need to divide your SD card in small partitions. It will be the best way to get a multipurpose Raspberry Pi on 4GB to 32GB cards keeping room for data if your SD card is above 8GB. As you can see above, only 3GB are used for this basic install. It means that you have a very sober basic multi purposed system with not too much bloatware. 
 
If you want to complete this basic install, you should check my other guides as well:

Don't forget to restore your /home/pi/ and have fun with your newfound SD card space!


The pi gamer

No comments:

Post a Comment

Play ET: Legacy on Raspberry Pi [FPS]

🕐🕐 Duration: A few hours 🔧 Difficulty: Easy 🌟🌟🌟🌟 Interest: Hours of fun