Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

How would I only boot into one program and not a full blown OS

Wed Jun 12, 2019 8:54 pm

Hi,

I'm doing this project and I'd like my raspberry pi to have all its features/drivers working, just not have a full blown UI as an OS. Like a bare minimum OS. I've searched everywhere for solutions like I just want this one program to run on my pi with access to the hardware and terminal. I wouldn't necessarily need a GUI or any of the programs on the Raspian OS.

Where would I start? Thanks

Nathan

User avatar
rpdom
Posts: 14155
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How would I only boot into one program and not a full blown OS

Thu Jun 13, 2019 5:36 am

Raspbian Lite is a full OS without the GUI. Much smaller than the full desktop version. There are also smaller, less well supported, OSen for the Pi like TinyCore Linux.
Signature is on holiday.

Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

Re: How would I only boot into one program and not a full blown OS

Thu Jun 13, 2019 1:58 pm

Okay, thank you. I'd just like to have Bluetooth and Wifi functionality and for one single program to be run when it's booted up?

jahboater
Posts: 4197
Joined: Wed Feb 04, 2015 6:38 pm

Re: How would I only boot into one program and not a full blown OS

Thu Jun 13, 2019 2:30 pm

You can boot a single program by putting its name on the kernel command line.
In:

/boot/cmdline.txt

add (on the same line):

init=path_to_program

For example:

init=/bin/bash

would drop you into a shell without starting systemd, the gui, or any of the services.
Try that, and from there you can see whats running.

User avatar
rpdom
Posts: 14155
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How would I only boot into one program and not a full blown OS

Thu Jun 13, 2019 3:41 pm

jahboater wrote:
Thu Jun 13, 2019 2:30 pm
You can boot a single program by putting its name on the kernel command line.
The problem with that is you wouldn't have Wifi or Bluetooth, which the OP needs.

I would suggest putting an entry in rc.local, but I see one of the other requirements is "access to the hardware and terminal", which I presume would mean keyboard access.

This sort of thing used to be easy, but now systemd is cluttering up the system and makes it harder.
Signature is on holiday.

Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 3:36 pm

rpdom wrote:
Thu Jun 13, 2019 3:41 pm
jahboater wrote:
Thu Jun 13, 2019 2:30 pm
You can boot a single program by putting its name on the kernel command line.
The problem with that is you wouldn't have Wifi or Bluetooth, which the OP needs.

I would suggest putting an entry in rc.local, but I see one of the other requirements is "access to the hardware and terminal", which I presume would mean keyboard access.

This sort of thing used to be easy, but now systemd is cluttering up the system and makes it harder.

I didn’t mean external hardware, sorry. I just meant I’d like to have all of the functionality minus the GUI. I don’t need a keyboard or mouse since I’m inputting data from my app through MQTT protocol, which is why I need internet. I just want to make it solely for that purpose and nothing else. Thanks

k-pi
Posts: 820
Joined: Sun Feb 12, 2017 1:46 pm
Location: Upper Hale, Surrey, UK.

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 3:45 pm

Tiny Core Linux is maybe your best bet, but it isn't an easy system to set up for a beginner.

Otherwise, Raspbian Lite, & remove what you don't need.

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 4:00 pm

Nathan1258 wrote:
Wed Jun 12, 2019 8:54 pm
Hi,

I'm doing this project and I'd like my raspberry pi to have all its features/drivers working, just not have a full blown UI as an OS. Like a bare minimum OS. I've searched everywhere for solutions like I just want this one program to run on my pi with access to the hardware and terminal. I wouldn't necessarily need a GUI or any of the programs on the Raspian OS.

Where would I start? Thanks

Nathan

"Where would I start?

Another vote for starting with Raspbian Lite.

It has full support for all the hardware features of the RPi board itself. It does not have a Desktop GUI interface. It can easily be configured to run your required script/program/application at each reboot without user intervention.

In short, if you just want a 'black box' that you don't have to interact with after initial setup. Raspbian Lite is a reasonable solution.

If experience shows that this was not the correct choice it will have given you your own set of criteria on which to base an informed alternative decision.

ghans
Posts: 7856
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 4:02 pm

The startup manager on Raspbian is called systemd. You probably want to write a "systemd unit" file to start your program in a fast yet controlled manner (after network is up etc.)

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 4:09 pm

B.Goode wrote:
Fri Jun 14, 2019 4:00 pm
Nathan1258 wrote:
Wed Jun 12, 2019 8:54 pm
Hi,

I'm doing this project and I'd like my raspberry pi to have all its features/drivers working, just not have a full blown UI as an OS. Like a bare minimum OS. I've searched everywhere for solutions like I just want this one program to run on my pi with access to the hardware and terminal. I wouldn't necessarily need a GUI or any of the programs on the Raspian OS.

Where would I start? Thanks

Nathan

"Where would I start?

Another vote for starting with Raspbian Lite.

It has full support for all the hardware features of the RPi board itself. It does not have a Desktop GUI interface. It can easily be configured to run your required script/program/application at each reboot without user intervention.

In short, if you just want a 'black box' that you don't have to interact with after initial setup. Raspbian Lite is a reasonable solution.

If experience shows that this was not the correct choice it will have given you your own set of criteria on which to base an informed alternative decision.

Really, my end goal would be to just always have this one graphical program (that I’m yet to make) to always be shown, and nothing else. I’d like to hide terminals any python scripts have ran and only show this one graphical program but have WiFi/Bluetooth functionality maintained. I don’t need a keyboard or mouse. Would it still work, is what I’m asking possible?

B.Goode
Posts: 7754
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 4:58 pm

Previously you wrote:
I’d like to have all of the functionality minus the GUI. I don’t need a keyboard or mouse since I’m inputting data from my app through MQTT protocol, which is why I need internet. I just want to make it solely for that purpose and nothing else.

But now you specify:
my end goal would be to just always have this one graphical program (that I’m yet to make) to always be shown,


Given your knowledge and experience I'd say those are incompatible.

You are unlikely to be able to display the output from a graphical program on an Operating System that does not have the components to generate graphical output.

Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 7:24 pm

B.Goode wrote:
Fri Jun 14, 2019 4:58 pm
Previously you wrote:
I’d like to have all of the functionality minus the GUI. I don’t need a keyboard or mouse since I’m inputting data from my app through MQTT protocol, which is why I need internet. I just want to make it solely for that purpose and nothing else.

But now you specify:
my end goal would be to just always have this one graphical program (that I’m yet to make) to always be shown,


Given your knowledge and experience I'd say those are incompatible.

You are unlikely to be able to display the output from a graphical program on an Operating System that does not have the components to generate graphical output.

No, I don’t want the default desktop UI, I just want to boot into one graphical program and nothing else. No desktop

Roken
Posts: 267
Joined: Sun Dec 31, 2017 4:35 pm

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 7:47 pm

The xserver is what provides for a graphical interface, and gives you the desktop. You can't have one without the other.

However, you can have a minimal xserver which will load a single graphical program.
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

Nathan1258
Posts: 8
Joined: Wed Jun 12, 2019 8:49 pm

Re: How would I only boot into one program and not a full blown OS

Fri Jun 14, 2019 10:05 pm

Roken wrote:
Fri Jun 14, 2019 7:47 pm
The xserver is what provides for a graphical interface, and gives you the desktop. You can't have one without the other.

However, you can have a minimal xserver which will load a single graphical program.
Ah, okay, How would I go about to install a minimal Xserver?

Return to “Beginners”