News for hackers. Stuff that matters.
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @07:43PM (#16183100)
this is excellent, i've been thinking about this as well recently. my goal has been to create a small device/appliance using raspberry pi. i tried out lots of operating systems: raspbian, ubuntu-mate, ubuntu core, windows iot, fedora, etc. i needed a lightweight x windows environment, a decent package manager, and modern linux kernel, overall none of these really seemed to match my needs. basically raspbian was too heavyweight, it was a desktop environment with way too many applications like libre office, etc that i just didn't need. ubuntu core required the use of snaps which are based on docker, i'm hosting an electron app so that's just overkill, i'm thinking in terms of preserving memory, too since there's only 1g on the rpi 3 model b so everything has to be optimized. windows iot requires a windows license, a definite non-starter for me. i even looked at chromium and android, but those didn't seem to be a good match because i want to host a golang service and i don't have a touchscreen. i even looked at fuchsia, but that seems too experimental.

i even considered doing my own os, but ultimately my goal is to build an appliance so that would be a major distraction. dietpi seems good, i will probably pursue that, but thanks for writing the article.

Re:Building an Operating System for the Raspberry Pi by thezilch on Thursday January 18, 2018 @11:19PM (#16184123)
Wait... you're worried your OS will be so overkill you would create your own, but you're perfectly fine using Electron?
Re:Building an Operating System for the Raspberry Pi by epynonymous on Friday January 19, 2018 @01:51AM (#16184567)
my requirement is to start up a browser, preferably chrome, and open up a certain page, this page is essentially like a digital scoreboard that is shown on a tv. electron embeds chromium and can start up an application super quickly, of course it requires nodejs and a bunch of nodejs libraries, but seems around 79M for the binary, my electron app requires a few nodejs libraries, but this is all text so nominal.

i explored using some scripts to autostart firefox and open up a certain page, but the fact that i needed kiosk plugins from third-parties just ended that for me, i don't want the browser frame to show up. electron is a bit overkill, but thus far it gets exactly what i want done. that piece will be optimized once i find the time.

Re:Building an Operating System for the Raspberry Pi by lovelearning on Friday January 19, 2018 @02:08AM (#16184615)
I don't know if you have already tried this, but if not, try 'google-chrome --kiosk <page>'.
Re:Building an Operating System for the Raspberry Pi by eltoozero on Thursday January 18, 2018 @10:43PM (#16183983)
I did a bare-bones buildroot[0] for Raspberry Pi to run tcpser[1], was a bit of hassle but not too unmanageable!

[0]: https://github.com/buildroot/buildroot/tree/master/board/ras...

[1]: https://github.com/FozzTexx/tcpser

Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @11:19PM (#16184126)
wow, cool stuff, will check it out!
Re:Building an Operating System for the Raspberry Pi by jeztek on Thursday January 18, 2018 @09:49PM (#16183783)
I've had good luck with Alpine Linux:

https://wiki.alpinelinux.org/wiki/Raspberry_Pi

Re:Building an Operating System for the Raspberry Pi by gadgetoid on Thursday January 18, 2018 @08:35PM (#16183373)
I used this tooling: https://github.com/ali1234/rpi-ramdisk

To build a tiny fine-tuned Raspbian for "embedded" Python 3 (a project I dub PiratePython). It uses multistrap/qemu and worked well for me. YMMV.

Re:Building an Operating System for the Raspberry Pi by epynonymous on Friday January 19, 2018 @01:54AM (#16184576)
i suppose this is a one-off project for you or are you creating a device for distribution? if you are creating the latter, how did you clone this to other devices, i'm assuming dd?
Re:Building an Operating System for the Raspberry Pi by gadgetoid on Friday January 19, 2018 @02:44AM (#16184729)
I'll probably prep the "gold master" SD card and then leave it to our SD duplicator.

I'm aiming to distribute SD cards that make some of our Pi Zero kits - Radio, Mood Light, etc - near frictionless to get up and running.

I found the use of Qemu + multistrap in this tooling easy to get my head around and I additionally wanted a stateless RAM disk so customers couldn't fubar it.

I didn't have much luck with Buildroot.

I evaluated TinyCore/PiCors too and I love the concept, but it's just a little contrived to ship to beginners. The way it mounts whole packages of overlays/dependencies is clever though- I am doing something similar (inspired by Open Pandora's pnd format) to add a custom build of VLC to PiratePython for our radio kit. Package the whole app + dependencies into a container image, drop it onto the SD card, mount and simlink everything into place.

Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @11:37PM (#16184173)
i also found that there are high level services that are needed to control the device, simple things like restart, changing ip's, upgrading, backing up, etc. i started to create a higher level library for these things using golang, basically a restful service, in this way it could be controlled via an application instead of having to use ssh, this is good for consumer like devices, but obviously opens up a can of security issues.

i will share the code (make it public via github) and write up my experiences developing for this device.

Re:Building an Operating System for the Raspberry Pi by WoodenChair on Thursday January 18, 2018 @07:49PM (#16183132)
Why can't you start with Raspbian and uninstall most of the apps?
Re:Building an Operating System for the Raspberry Pi by untog on Thursday January 18, 2018 @07:59PM (#16183181)
There's Raspian Lite, which is pretty much exactly that. You can just add a window manager onto it.
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @08:18PM (#16183270)
will give it a try, i think raspbian is sort of targeted at the education market for students that need a full blown desktop computer for various things. the fact that it's running debian as a base is great. how does this differ from dietpi?
Re:Building an Operating System for the Raspberry Pi by khedoros1 on Friday January 19, 2018 @12:19AM (#16184301)
DietPi is smaller, but I'm not sure exactly what it's missing that Raspbian Lite has. I've looked into it before, but I don't remember the answer. They're both Debian-based.

This has a list of DietPi's pre-installed applications and the packages that it has available for installation: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5#p5

Re:Building an Operating System for the Raspberry Pi by epynonymous on Friday January 19, 2018 @01:56AM (#16184587)
i noticed dietpi has a great list about the various hardware sbc's and their performance ratings for things like file system storage, etc. time to also check out the asus tinker board or odroid c2.
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @07:58PM (#16183176)
that's something i considered, but i also wanted to take the opportunity to learn more about creating a tight knit distribution. i could see a lot of appliances coming out of these rpi like devices, there definitely needs to be a tight distribution purpose built for people who want to build appliances similar to mine. i've also always had this task burning in my list of things to do to do an lfs type project.

my device connects to any hdmi enabled tv and provides a digital scoreboard for sports, basically i'm running a chromium browser (via electron) and autostarting that when the device starts. the device is then controlled by an ios app. i ended up using ubuntu-mate, but i don't think i even need gnome, maybe something along the lines of windowmaker, flux, or lightdm would do. i need to save microsd space so that i can have users upload media like images and video, and ubuntu mate really hogs up 4G and above which forces me to have to supply a larger microsd card which ups the total cost.

Re:Building an Operating System for the Raspberry Pi by kelnos on Thursday January 18, 2018 @08:13PM (#16183243)
An in-between option might be to use https://github.com/drtyhlpr/rpi23-gen-image -- it generates a Debian distribution for you with (more or less) only the packages you specify.

The most recent image I built ended up being around 700MB, but I included some stuff you may not need, so you might be able to get that smaller.

Re:Building an Operating System for the Raspberry Pi by tbrock on Thursday January 18, 2018 @10:59PM (#16184052)
Why not use Arch Linux? The arm version is called ALarm (for obvious reasons).

https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-...

Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @11:17PM (#16184119)
i was once a fan of arch linux, loved having the control of compiling everything. how well is this supported for raspberry pi? it's always nice to know that vendors have tested the exact hardware that i'm using extensively, even if it's just another arm device that looks and smells like the others. also, what package manager is used by arch? it's been like 10 years since i last used it.
Re:Building an Operating System for the Raspberry Pi by tbrock on Friday January 19, 2018 @08:15AM (#16185947)
Maybe you are thinking of Gentoo? Arch’s core and community software are distributed as binaries that have been compiled for you.

The AUR provides additional software you can compile yourself but most of what makes the system run already built.

Re:Building an Operating System for the Raspberry Pi by nerflad on Friday January 19, 2018 @01:30AM (#16184522)
It still uses pacman.

I can't confirm this, but it feels like Arch linux has surged in popularity over the last ~3-4 years. I ditched Debian for Arch in 2016 and haven't looked back.

Re:Building an Operating System for the Raspberry Pi by caro_douglos on Thursday January 18, 2018 @11:29PM (#16184156)
pacman iirc
Re:Building an Operating System for the Raspberry Pi by UncleSlacky on Friday January 19, 2018 @06:45AM (#16185510)
Void Linux might suit you: https://wiki.voidlinux.eu/Raspberry_Pi
Re:Building an Operating System for the Raspberry Pi by snvzz on Saturday January 20, 2018 @10:51AM (#16193746)
I can't help but notice you've not tried standard Debian (raspbian isn't it), archlinuxarm nor, god forbid, any BSD.
Re:Building an Operating System for the Raspberry Pi by jlewallen on Thursday January 18, 2018 @08:02PM (#16183197)
You might want to check into Tiny Core Linux.
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @08:28PM (#16183334)
what is the package manager used by tiny core? i think this is what's used by boot2docker
Re:Building an Operating System for the Raspberry Pi by jlewallen on Friday January 19, 2018 @12:24AM (#16184312)
If I remember correctly, TCL uses a very simple overlay system based on squashfs. Most (all?) of the tooling and package management stuff is also written in bash.
Re:Building an Operating System for the Raspberry Pi by nicky0 on Friday January 19, 2018 @01:26AM (#16184515)
Did you look at Raspbian Lite? You could then install your choice of windowing system on top.
Re:Building an Operating System for the Raspberry Pi by epynonymous on Friday January 19, 2018 @01:53AM (#16184569)
any suggestions for windowing system?
Re:Building an Operating System for the Raspberry Pi by ciupicri on Thursday January 18, 2018 @10:37PM (#16183956)
What about FreeBSD?
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @11:20PM (#16184132)
good support for raspberry pi or general arm support?
Re:Building an Operating System for the Raspberry Pi by epynonymous on Thursday January 18, 2018 @11:32PM (#16184160)
i found this, seems it's been supported for a long time. i'm not ecstatic about the wrappers in ruby/python for gpio, but then again i don't need it at this point in time.

https://wiki.freebsd.org/FreeBSD/arm/Raspberry%20Pi

Re:Building an Operating System for the Raspberry Pi by bringtheaction on Friday January 19, 2018 @06:20AM (#16185425)
I am a great fan of FreeBSD and I run it as my main OS on one of my two laptops that I use daily.

That being said, last time I tried to run FreeBSD on a Radpberry Pi was not a pleasant experience. That was several years ago though so things may have improved.

Re:Building an Operating System for the Raspberry Pi by floatboth on Friday January 19, 2018 @08:26AM (#16185998)
FreeBSD/arm64 now has official binary packages for 12-CURRENT. RPi3 runs in 64-bit mode with all 4 cores. For the most part, everything is good. But the vc4 KMS driver is not ported yet, so no GPU accelerated desktop for now.