...
 
Commits (5)
......@@ -13,6 +13,7 @@ from os import listdir
app = Flask(__name__)
BLOG_CONTENT_DIR = 'content/blog'
PAGE_CONTENT_DIR = 'content/page'
REGEX_SPLIT_FRONTMATTER = re.compile(r'^---$', re.MULTILINE)
......@@ -99,6 +100,20 @@ def blog_post(y, m, d, slug):
blog = parse_post('-'.join([y, m, d, slug]) + '.md')
return render_template('blog-post.html', **blog)
@app.route('/<page>.html')
def static_page(page):
with open(os.path.join(PAGE_CONTENT_DIR, page + '.md')) as handle:
raw = handle.read()
frontmatter, content = REGEX_SPLIT_FRONTMATTER.split(raw, 2)
data = yaml.load(frontmatter)
data['html'] = markdown.markdown(content, extensions=[
'markdown.extensions.extra',
'markdown.extensions.codehilite',
'markdown.extensions.toc'
])
return render_template('page.html', **data)
@app.route('/<slug>/')
def wiki_redirect(slug):
""" WARNING: This must be the last route! """
......
title: "Frequently Asked Questions"
---
### Why is postmarketOS based on Alpine Linux?
The biggest upside is, that Alpine is small. The base installation is about **5 MB**! Only because of that, our development/installation tool <code>pmbootstrap</code> is able to abstract everything in chroots and therefore keep the development environment the same, no matter which Linux distribution your host runs on.
And if you messed up (or we have a bug), you can simply run <code>pmbootstrap zap</code> and the chroot will be set up again in seconds. Imagine how long it would take to do the same with Debian (which is a fine distributions for plenty of other use cases).
Another angle on the tininess of Alpine - many older devices don't have much space to spare, so hilariously tiny system images can be quite useful or even required.
### Will Android apps be supported?
Currently, our best bet seems to be getting [Anbox](https://wiki.postmarketos.org/wiki/Anbox) running on postmarketOS. It's highly recommended to use native Linux applications though, as there are some downsides to Android apps:
* Freedom issues (most are proprietary, or only work together with a proprietary network, some even track you), see [F-Droid](https://f-droid.org/) for FLOSS programs, that respect your freedom.
* Heavy resource usage: With all resources, we will most likely need to run a Android environment next to your regular Linux. So it will use up more RAM and CPU compared to native Linux applications.
So at least try to find a native-Linux alternative for your favorite application or ask yourself if you really need it. For app developers, consider using [Kirigami UI](https://dot.kde.org/2017/01/02/kde-releases-beta-kirigami-ui-20) or similar to develop apps for both mainstream mobile OSes (Android/iOS) as well as natively for Linux distributions.
### Can project Treble help postmarketOS?
Google proposed [Treble](https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html) to improve the update situation for Android by having a "vendor implementation" with a stable API, that Android builds upon. The idea is, that you can swap out the Android version easily, because of that API. As postmarketOS developers see it, that is a step in the right direction, but it does not resolve the updates problem completely.
You will still have the "vendor implementation", which is different for every device. It will contain at least the kernel and drivers (kernel/userspace), for which you, as a user, depend on the manufacturer to keep it updated, and which will probably not be mainlined. This means, that after two years or so, when the support runs out, you will still have a device, that does not get updates anymore. Only for a smaller component of the operating system.
Also keep in mind, that this will work for newer Android O phones only. We already have an alarmingly high number of phones, which will never get that improvement. They can be saved from being electronic waste with projects like postmarketOS.
from flask_frozen import Freezer
from app import app, BLOG_CONTENT_DIR, WIKI_REDIRECTS
from app import app, BLOG_CONTENT_DIR, PAGE_CONTENT_DIR, WIKI_REDIRECTS
from os import listdir
......@@ -15,6 +15,11 @@ def blog_post():
slug = '-'.join(title)
yield { 'y': y, 'm': m, 'd': d, 'slug': slug }
@freezer.register_generator
def static_page():
for f in listdir(PAGE_CONTENT_DIR):
page = f[:-3]
yield { 'page': page }
@freezer.register_generator
def wiki_redirect():
......
......@@ -12,6 +12,7 @@
<ul class="tc tr-ns f4 f3-ns pl0">
<li class="dib"><a class="link dim pr3" href="{{ url_for('home') }}">Home</a></li>
<li class="dib"><a class="link dim pr3" href="{{ url_for('blog') }}">Blog</a></li>
<li class="dib"><a class="link dim pr3" href="{{ url_for('static_page', page='faq') }}">FAQ</a></li>
<li class="dib"><a class="link dim pr3" href="https://wiki.postmarketos.org">Wiki</a></li>
<li class="dib"><a class="link dim pr3" href="https://github.com/postmarketOS">GitHub</a></li>
</ul>
......
{% extends 'base.html' %}
{% block body %}
<h2 class="tc">A real Linux distribution on the phone</h2>
<section class="fl w-100 pv4-ns flex items-center justify-center">
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/flo-plasma.png') }}">
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/s5-weston.png') }}">
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/honami-htop.png') }}">
</section>
<section class="fl w-100 pv4-ns flex items-center justify-center">
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/banner.jpg') }}">
<div class="ph4 nt3">
<h2>A real Linux distribution on the phone</h2>
<p class="f4">postmarketOS (<i>pmOS</i>), is a touch-optimized, pre-configured <a
href="https://alpinelinux.org">Alpine Linux</a> that can be installed on
<a href="https://wiki.postmarketos.org/wiki/Supported_devices">smartphones and other mobile devices</a>.
......@@ -27,7 +33,7 @@
features</b> (such as full disk encryption) to newer devices either. We want to be able to use our devices <b>until they break!</b>
</p>
</div>
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/phonepile.jpg') }}">
<img class="ph4 dn di-l" src="{{ url_for('static', filename='img/n9-tty.jpg') }}">
</section>
<section class="fl w-100 pv4 flex items-center justify-center">
......
{% extends 'base.html' %}
{% block title %}{{ title }}{% endblock %}
{% block body %}
<article class="pa3 lh-copy">
<h1 class="f2 f2-ns">{{ title }}</h1>
{{ html|safe }}
</article>
{% endblock %}