GithubHelp home page GithubHelp logo

joshiemoore / snakeware Goto Github PK

View Code? Open in Web Editor NEW
1.7K 1.7K 100.0 86.97 MB

A free Linux distro with a Python-based userspace

License: MIT License

Shell 1.87% Python 98.13%
linux operating-system python rpi4 x86-64

snakeware's People

Contributors

abdur-rahmaanj avatar adityaj7 avatar admicos avatar alexandruavadanii avatar cclauss avatar chaoskid42 avatar dargonforce avatar donno2048 avatar garbagehamburger avatar jamesalbert avatar joshiemoore avatar karx1 avatar koxinga314 avatar lmagoncalo avatar mdoege avatar mochidaz avatar pryelluw avatar zaanposni avatar zachpmanson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snakeware's Issues

Modify running app

It would be interesting if you could press a button in the menubar of an app, and it opens a text editor that you can use to edit that app.
As Python is an interpreted language this can be quite useful.

Build fails

Whenever I try to build an image, it fails during compilation of host-cdrkit.

Entire output is here.

Data Persistence

Currently snakeware boots as a "Live USB" and user data does not persist between boots. We need a good way to store user data persistently.

I really like the idea of having a "ROM partition" of a few hundred MB where the snakeware distro is installed (this would allow different snakeware versions to be swapped easily just by overwriting the partition), and a separate "user partition" which fills the rest of the medium and can be used to store scripts, data, etc. This partition would be mounted and changedir'd to on boot.

I'm going to be the one that works on this, but ideas are welcome if anyone has any

System API and SQLite as default DB

It would be nice to have a system api to expose to app devs.

Lets say someone makes an app to tune volume. Instead of he writing his method, he just uses the system way of changing sound. We don't need everything but at least some system things

Also for storage, was thinking of having sqlite to store system info, using sqlalchemy

add file manager

I'd like to try myself at this (unless someone has already started).

For the start, I thought to keep it simple:

  • display stuff
  • navigate folders
    • click on folder
    • back, forward, up buttons
  • address bar

Things/Ideas for later (in no special order):

  • Tabs
  • file operations (copy, paste, move, rename, delete)
  • context menu (for file operations)
  • open other (future) apps, like text editor for appropriate files (maybe add some other independent kind of filetype registration service/component)

Release artifacts could be smaller

Not an issue per-se, but an idea about the release artifacts, specifically the raw disk image file:

  • archiving the fixed-size disk image (currently 400MB as hardcoded in the source code) using only gzip does reduce its size a bit (103MB with the default compression settings);
  • using a sparse disk image format (e.g. qcow2) helps too (222MB with uncompressed qcow2, 111MB with compressed qcow2), but is only useful if people are using the disk image with a virtualization platform or are able to convert the image back to a raw format if they intend to dd it to a physical drive;

New Logo Proposals 🍧

Refering #47

Refers to commodore64 logo and theme. The double slits of c64 coincidentally represents a snake's tongue. The lines are a reference to slackware meaning a Linux distro
logo_slackware

Py + open to the theme of c64
logo_open

reference c64
commodore64

Boot on virtualbox

Hello, I was going to try your new OS on VirtualBox, but it wasn't clear how to do so with a .img file. Any suggestions?

Build fails

Hey, I was trying to build the image so I could test my changes in a qemu to see if it worked reliably with snakeware, but every time the build fails when trying to install GRUB.
image
Looks like it's failing to mount the EFI partition correctly. Could ths be because I already had some folders there for my NAS?

[feature request] - snaketerm improvements

Awesome project. I'm running it right now 😎 Just a couple things I noticed while rummaging around:

  • If the current output exceeds the height of the output panel, it automatically scrolls all the way up. Keeping the latest output focused is probably the intent.
  • No way to clear output
  • autocomplete and history (up and down arrow functionality) would be cool, too.

Definitely interested in taking a wack at it this weekend, but wanted to check if there's any work being done on this before I get started.

Buildroot dependency missing

Hi,
To get the build working on Ubuntu 18-04, I had to add:
sudo apt-get install libelf-dev

Then it finished but with one error: create: command not found, but I guess just a missing comment

 0+0 records in
0+0 records out
0 bytes copied, 0.0003471 s, 0.0 kB/s
./build.sh: line 47: create: command not found

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x6f584148.

Command (m for help): Created a new DOS disklabel with disk identifier 0x9431d0e0.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-819199, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-819199, default 819199): 
Created a new partition 1 of type 'Linux' and of size 399 MiB.

Command (m for help): Selected partition 1
The bootable flag on partition 1 is enabled now.

Command (m for help): The partition table has been altered.
Syncing disks.


A virtual block device has been created for snakeware.img.
Use lsblk to find the number of this device and run ./img_final.sh <num>
Example: ./img_final.sh 0 for loop0

Build_all.sh fails

Using Ubuntu 18.04, it downloaded a lot of things then crashes with:

...
usr/share/man/man1/python3.1 -> python3.8.1
usr/share/man/man1/python3.8.1

sent 326.07M bytes  received 170.24K bytes  217.49M bytes/sec
total size is 325.30M  speedup is 1.00
Installing for i386-pc platform.
grub-install: error: hostdisk//dev/loop0 appears to contain a squash4 filesystem which isn't known to reserve space for DOS-style boot.  Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
umount: /mnt: not mounted.
loop deleted : /dev/loop25

build: Allow building the disk image without root access

The current build implementation leverages kpartx and loop devices to copy the rootfs contents to the final disk image, together with a manual step of determining the loop device index.
Instead, we could use FUSE and/or libguestfstools and have the build process work strictly in userspace.
This would add another build dependency.
Also, I'm not sure how this would work with grub-install (I hope it will just work), since I previously had issues with grub-install on loop device partitions and had to add another level of abstraction using nbd.
I'll try to investigate this myself and report here anything useful that I find.

Interprocess communication

It's my understanding that this is currently a single-process application? I think that rpyc would be a pretty good way to handle IPC, it lets you expose python objects transparently over network connections, basically importing python objects from other processes and having everything more or less just work.

I'm imagining that all your apps export not only their user interface, but also an API.

Of course this is still early in the project, and it would complicate the implementation immensely. Still, maybe something to think about.

Need keyamp support for worldwide contributions

Currently snakeware only uses US qwerty keymap.
We should be able to set the keymap easily either once booted, or at boot time via grub, or at build.
Without different keymaps, it will be hard to get contributors from outside US (I'm French, I'm a python developer, but once in the snakeware python shell, it is unusable without brain torture to remap mentally...).

Create a better build system

In your current build scripts, you seem to be just copying system libraries & hoping for the best, which can fail if the host system is subtly different from what you're using.

To make this better, I suggest using something small like Buildroot or KISS Linux.

Buildroot is the most mature of the two, and is specifically designed for building embedded Linux systems, which seems like a close goal to what you're doing here. It also has a lot of configuration options and build scripts for a lot of packages, including Python, which can make it feel complicated.

KISS is newer and less mature, but is very simple to understand, as most of the system is good old shell scripts & Busybox. However, it's not designed for a specific purpose like Buildroot, so it would probably only be used as a consistent base system (in a chroot or something similar) for the actual hand crafted build scripts.

So, if you want a robust build system, I'd recommend you go with Buildroot or something similar to it, but if you want your build system to be small, you can try messing around with something like KISS.

Running wm.py on macOS

I am trying to run wm.py on macOS. I ran pip3 install pygame but I still receive the error "ImportError: No module named pygame"

Is there anything else I need to do to get this running?

I want to contribute a game

I have written a game with python and pygame.
Do take a look.

It’s a fairly medium sized project. If you like the project a lot, you could integrate it within your Snakeware Project. And you had mentioned that some changes will be needed to make it work in your project. If you like my project, we can work together to to integrate it in yours.

Add a package manager

As the distribution grows, it may stop making sense to package all apps into it. What kinds of package management solutions make sense for this project?

My preliminary thoughts are:

Packages are maintained in their own repo by their respective maintainers. There is one central repository that hosts package metadata (maybe JSON?) of 'approved' packages. The package manager syncs to the master list (with the option of using other package lists?) and uses the metadata to resolve dependencies, clone and install applications, etc.

Logo

Related to #46 and more broad, i think a logo might be nice ^^_

official forum/subreddit/discord channel ?

I am very very much excited about this project and want to know a place to discuss / communicate/ get involved into snakeware, other than sending issues or pull requests.
Is there an official (beginner friendly) forum / place in the internet ?

RPi SnakeWM Performance Issues

We have released a Raspberry Pi 4 image in v0.0.5, and everything runs and works. However, the performance in SnakeWM is noticeably sluggish. I have been testing snakeware on a 2004 ThinkPad that has similar specs to the RPi 4 (and half the RAM) and it runs fine, but the performance on the Pi is significantly worse. On desktop SnakeWM runs at a pretty consistent 60FPS at idle, but on the Pi the FPS drops to ~45 idle.

This is the most significant setback we have yet faced, as I believe snakeware would excel on these SBCs if we could work out the performance issues. The basic apps like snakecalc run fine, but any graphic-intensive apps like dazzler or the dynamic backgrounds really bring the system to a crawl.

I am now running a very aggressive overclock on my Pi locally, here are the relevant performance options I have set in config.txt:

gpu_mem=512

over_voltage=6
arm_freq=2140
gpu_freq=750

This overclock helps quite a bit, and brings the idle FPS up to ~55, but it is still noticeably sluggish when running apps.

snakeware is very snappy and fun on desktop, and I think that it will be really special if we can bring this experience to the Pi as well. Please share any ideas on this issue, or open a PR if you find a good performance tweak. It's clear that "overclock the crap out of it" is not going to solve all of our problems, and that additional underlying changes will be required to achieve performance that comes close to desktop.

'default apps' / register filetypes

a way to connect any "consumer"(editors, like #17 ?) and any "producer" (file managers, like #11).

my thoughts thus far:

either: a (singleton / static) class as middleware

  • should register on app side (no edit in register service) at boot => how?
  • class may provide a overview in the gui of what is currently mapped
  • producers just call e.g. an Middleware.open method
    • maybe return if it was successful (or NoApplicationFoundError or something)
    • or let middleware show an error message directly
  • middleware saves / loads a file for the mapping
    • more useful when more apps can work on the same type

or as custom event (like pygame_gui extends pygames user events). But there must be a clever way, to avoid having an instance of all apps

That said, I have no idea how others have done this.
Any ideas are welcome.

Snakeware users' chat

Greetings,

I'd be grateful if i can be assigned to build the live chat app for
snakeware users, thanks!

Shutdown/Reboot not working

I have tested the shutdown and reboot dialogs on my host Arch install, while running snakeware in a VM, and running snakeware on real hardware, and they don't seem to work in any of these configurations.

However, if I run os.system("/sbin/reboot -f") (or shutdown) from the interpreter, this operation works as expected.

Add Documentation

It will be helpful if you added Documentation to all modules. I would recommend using sphnix to generate documenation from code.

wiki / docs / user guide

I think it would be helpful to start a wiki. Arch linux is well documented due to ArchWiki. I think that would be a good model.

Embedded code editor

While the C64 Basic interpreter was also a code editor, it would be great to add to snakeware a code editor to load/write/save programs. Not sure what is easier... use nano or write a pygame editor ?

Wheel installation support (vanilla python / local)

Hi,
Snakeware is really a great idea!

I guess having a full network support will be a pain but at least to support local wheel installation would be great. I also expect some wheels won't work but I guess it will be ok for vanilla python libraries ?

snaketerm help() freezes snakewm

I'm running snakeware0-0-3.img on Debian buster (stable) using QEMU version 3.1.0. I started up snakewm using

from snakewm.wm import SnakeWM
SnakeWM().run()

and ran snaketerm from the menu. When I entered help() into the input box and pressed Enter, the system seemed to freeze: nothing showed up in the console output, keyboard or mouse inptu had no effect, and pressing Alt+Esc did not exit snakewm. I have to reset the machine in QEMU to get it to restart. I've repeated these steps to make sure this is a reproducible bug.

Add minimal network stack for network applications

Hello @joshiemoore

first of all, I enjoy the work with snakeware. For having even more fun having network / Internet applications in snakeware would boost for the creativity of developers and give a huge improvement to the OS. To get this, I suggest the integration of a minimal network stack consisting of following parts:

  1. Enable NIC drivers in the Linux-Kernel for...
    1.1. ... the standard QEMU NIC
    1.3 .... the Raspberry pi
    1.2 ... the standard VirtualBox NICs (AMD PCNet PCI II (Am79C970A), AMD PCNet FAST III (Am79C973), Intel PRO/1000 MT Desktop (82540EM), Intel PRO/1000 T Server (82543GC), Intel PRO/1000 MT Server (82545EM)
  2. Integrate automatic IP-address configuration with DHCP (for VM NAT) and support of home routers
  3. Ifdownup-script support for manual IP-setup
  4. Some standard Python packages, e.g. requests, bottle

With this setup, the web browser (#134) would run on snakeware and a Python IRC-client could by integrated to visit the snakeware IRC room directly from the OS.

Regards,
Oliver

pip module installation

Currently the only part of the build process that happens outside of buildroot is the installation of pip modules in post-build.sh. This script executes the compiled python3 binary and has it install the pip modules specified in config/pip_modules.txt. This works fine when building for x86_64, but will not work when trying to cross-build for Raspberry Pi or other systems.

I have scoured the net and not found a good, modular, and extensible way to install external pip modules in buildroot. I found some tools online that seemed like they would do what we're looking for, but I wasn't able to make any of them work. If anyone has any ideas for this, please share them or submit a PR.

I don't want anyone to have to manually write a bunch of configs to add another pip module to the build. They should basically be able to just add the desired module to the list, and it gets installed in the build (like the behavior now).

Once we have networking all set, we could have it automatically install a list of external pip modules on first boot or something like that (this would keep distro images small), but I think I would prefer to just install them at build-time.

python based init system

In the readme's todo list there is currently an entry for replacing busybox's init with a python based solution.

Although there are quite a few init systems out there, not many of them are written in python.
I looked around a bit and found some OSS projects that fit the description, although not all of them would work as a drop-in replacement for the current init:

  1. supervisord [1] - mature, active, but it is not intended to be run as PID 1 though;
  2. murdur [2] - seems to be calling a lot of binaries in /bin or /sbin, so although it's written in python, it's not free of external binary dependencies;

I'm just writing this down in case someone else looks at init and wonders what pure python implementations are already out there.

[1] https://github.com/Supervisor/supervisor
[2] https://github.com/pisilinux/mudur

environment assertions at beginning of build.sh

Just a few issues I ran across when building an image from scratch. It would be best to check for them at the beginning of build.sh before a git-clone is issued or any other work is done

  • check for required programs like hg
  • check that you are running from the snakeware build system directory
    • consider maybe changing to the correct directory rather than just failing

Common file space and registry

Suggest adding a single folder to hold all files. Easier to gitignore than to let people have their own filespace. We then associate files to apps. Apps refer to files via the API.

For global settings also we provide an API. #27

VMWare Player support [works]

In case somebody is interested, the image works perfectly with VMWare Player (tested on Linux/Ubuntu 18.04):

sudo apt-get install qemu-utils
qemu-img convert -O vmdk snakeware.img snakeware.vmdk

Then create a VM without any OS, remove the default disk and add this VMDK image.

You won't be able to resize the window but good for testing!

Mac OS build fails due to clang and `sed` usage

Hi! My name is Denis, and I tried to build snakeware on my MacBook. But I have had some issues:

  • sed utility which is obviously in Makefile in snakeware/snakeware/buildroot may not be used on macOS with option -r. The issue show itself like this:
    (base) user@omelched-MacBook snakeware % sudo ./build.sh x86-64
    sed: illegal option -- r
    usage: sed script [-Ealn] [-i extension] [file ...]
    sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
    For some reason in macOS this option is renamed to -E and replacing that Makefile line 349: sed -n -r... with sed - n -E... solved that problem for my case.
    Maybe it will be a good idea to do this action in build.sh before make based on which OS you are building on.
  • the second problem is that, for quite obvious reasons, macOS specifies Clang as main compiler and this causes issues because buildroot had to be made with GCC (I presume). Therefore, the issue happens:
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -j1 O=/Users/user/git_repo/snakeware/snakeware/buildroot/output HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    You must install 'gcc' on your build machine
    So if we try ti call /usr/bin/gcc that would be Clang:
    (base) user@omelched-MacBook snakeware % /usr/bin/gcc
    clang: error: no input files
    I'm still stuck on that issue but i think that some manipulation with HOSTCC and HOSTCXX in Makefile to define them as separately installed gcc-9 and g++-9 will help. At least I will try it tomorrow.
    And as that solution will be confirmed I suggest to add some tweaks to support native macOS build too.

Anyway, I'll do my best to help you with this interesting project!

Cannot shutdown system

Hey, how would I shutdown the snakeware system? Running os.system("/sbin/shutdown") in the Python console does not work, and there is currently no way to shutdown the system from snakewm (though I am going to make one), so I am currently relying on force shutdowns, which I would rather not use. So if you could please tell me how to shutdown the system, so I could then build a button for it in snakewm.

Ability to easily update Pygame and Pygame Gui and make snakewm 'debuggable' within snakeware

As I am developing an app for snakeware I realised that my app was not compatible with the version of pygame gui that snakware uses. (My bad!) The app is several thousand lines of code already. If there was a way to update pygame and pygamegui in sankeware that would get this app into snakeware.

I have successfully built a snakeware ISO with the required pygame gui version (0.5.7) but snakewm won't load when I boot into the iso.

I am a noob when it comes to build root but if there is a way to debug snakewm within snakeware that would be a good first step.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.