Here is an almost-minimal example of a systemd service file, that I use to run the Mastodon bot of my generative art playground Graft.
I made a dedicated user just to run this service, and installed Graft into /home/graft/apps/graft under that username. Now, as root, I edited a file called /etc/systemd/service/graft.service and made it look like this:
I am setting up a forum for sharing levels for my game Rabbit Escape, and I have decided to try and use Flarum, because it looks really usable and responsive, has features we need like liking posts and following authors, and I think it will be reasonably OK to write the custom features we want.
So, I want a dev environment on my local Ubuntu 18.04 machine, and the first step to that is a standard install.
Warning: at the time of writing the Flarum docs say it does not work with PHP 7.2, which is what is included with Ubuntu 18.04, so this may not work. (So far it looks OK for me.)
Here’s how I got it working (as far as the web installer stage, anyway):
sudo apt install \
apache2 \
libapache2-mod-php \
mariadb-server \
php-mysql \
php-json \
php-gd \
php-tokenizer \
php-mbstring \
php-curl
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# Get the neat line from https://getcomposer.org/download/
# Don't copy it exactly!
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
mkdir ~/bin
php composer-setup.php --install-dir=~/bin/ --filename=composer
rm composer-setup.php
cd /var/www/html
sudo mkdir flarum
sudo chown $(whoami) flarum
# Log out and in again here to get composer to be in your PATH
cd flarum
composer create-project flarum/flarum . --stability=beta
sudo chgrp -R www-data .
sudo chmod -R 775 .
sudo systemctl restart apache2
Go to http://localhost/flarum in your browser, and follow the instructions there to get set up.
If I get further, I will update this post, including on how to set up the MySQL database.
I recently bought a gorgeous pink Nintendo DSLite with the sole purpose of running DSLinux on it. When I posted about my success on Mastodon , someone helpfully asked “Has it have any use tho?â€. Lets answer that right away: Running Linux on a Nintendo DSLite is at best a few hours entertainment for the masochistic technologist, and at worst a waste of your time.
Running Linux on a Nintendo DSLite is at best a few hours entertainment for the masochistic technologist, and at worst a waste of your time.
But, I do rather enjoy running Linux on things that should not be running Linux, or at least attempting to do so. So heres what IÂ did!
R4 Card (Knockoff, says R4 SDHC Revolution for DS on the card)
DSLinux runs on a bunch of devices, luckily we had some R4 cards and an M3DS Real around the place which are both supported by DSLinux. I purchased a SuperCard SD from Ebay to provide some extra RAM, which apparently is quite useful, since the DSLite has only 2mB of it on it’s own.The SuperCard SD I bought had 32mB extra RAM bringing the total up to some 34mB, wowee.
R4 Cards
The first cards I tried were the R4 cards we had. They’re popular and supported by DSLinux. Unfortunately, it seems the ones we’ve got are knockoffs and therefore proved challenging to find firmware for. I spent a long while searching around the internet and trying various firmwares for R4 cards — None of them I tried did anything except show the Menu? screen on boot.
Finally, finding this post on GBATemp.net from a user with a card that looks exactly the same as mine lead me to give up on the R4 card and move on to the M3DS Real. Although the post did prove useful later.
It should be noted that the R4 card I had had never been tested anyway, so it might never have worked.
M3DS Real
Another card listed as supported on the DSLinux site, so seemed a good one to try. We had a Micro-SD Card in the M3Real anyway, with the M3 Sakura firmware on it so it seemed reasonable to just jump in there.
I copied the firmware onto another SD Card (because we didn’t want to loose the data on the original card). It was only 3 folders, SYSTEM, NDS and SKINS in the root of the card. The NDS file containing ‘games’.
In this case, I put the DSLinux files (dslinux.nds, dslinuxm.nds and ‘linux’, a folder) into the NDS folder and stuck it in my DSLITE.
After selecting DSLinux from the menu, I got the joy of….a blank screen.
Starting DSLinux from M3 Sakura results in a white screen
Some forumposts which are the first results when searching the issue on DuckDuckGo suggest that something called DLDI is the issue.
The DSLinux ‘Running DSLinux’ does mention patching the ‘dslinux.nds’ file with DLDI if the device one is using doesnt support auto-dldi. At the time this was all meaningless jargon to me, since I’ve never done any Nintendo DS homebrew before.
I patched the dslinux.nds file using the linux command line tool and saw no change to the behaviour of the DSLite, still white screens.
Upon reading the DSLinux wiki page for devices a little closer, I noticed that the listing for the M3DS Real notes that one should ‘Use loader V2.7d or V2.8’.
What is a loader?? It means the card’s firmware/menu.
Under the listing on the above site for ‘M3/G6 DS Real and M3i Zero’ one can find a link to firmware versions V2.7d and V2.8 listed as ‘M3G6_DS_Real_v2.8_E15_EuropeUSAMulti.zip’.
Upon installing this firmware to the SD Card (by copying ‘SYSTEM’ folder to the root of a FAT32 formatted card, I extracted the DSLinux files again (thus, without the DLDI patching I’d done earlier) and placed the files ‘dslinux.nds, ‘dslinuxm.nds’ and the folder ‘linux’ to an ‘NDS’ folder, also in the root of the drive. This is INCORRECT. Upon loading the dslinux.nds file through the M3DS Real menu it did indeed boot Linux, but dropped me into a single-user mode, with essentially no binaries in the PATH. This is conducive to the Linux kernel having booted successfully, but not being able to find any userland. Hence the single-user and lack of programs.
Upon moving the DSLinux files to the root of the directory and starting ‘dslinux.nds’ from the M3DS Real menu I had a working Linux system!!
I type `uname -a` on DSLinux. Its running Kernel 2.6.
Notice the ‘DLDI compatible’ that pops up when starting DSLinux — That means that the M3DS Real auto-patches binaries when it runs them. Nice.
What Next?
Probably trying to compile a newer kernel and userspace to start with. Kernel 2.6, at time of writing, is 2 major versions out of date.
After that, I’d like to understand how DSLinux is handling the multiple screens and multiple processors. The DS has an ARM7 and an ARM9 processor and two screens, which I think are not connected to the same processor, the buttons are split between the chips too.
Lastly, I’d like to write something for linux on the DS. Probably something silly, but I’d like to give it a try!
Don’t ask me questions about DSLinux, I don’t really know anything more than what I’ve mentioned here. I just read some Wiki’s, solved some problems and did some searching.
Thanks to the developers of DSLinux and DLDI for making this silliness possible.