WEBVTT

00:00.000 --> 00:10.880
Hello everyone, my name is Anjan. I'm a foster enthusiast post-market OS trust your contributor

00:10.880 --> 00:17.520
and SXMO co-mintainer. I've been contributing to the post-market OS ecosystem since 2020

00:17.520 --> 00:21.920
and it's my favorite thing to hat on. You can find links for all the stuff I mentioned in

00:21.920 --> 00:26.320
a blog post on my website, mommi.ca.

00:26.320 --> 00:31.600
So the beginning of post-market OS, post-market OS is a standard Linux distribution. It's based

00:31.600 --> 00:36.880
on alpine Linux. The project originally started with wanting to install an environment that's

00:36.880 --> 00:42.480
very similar to what you would have on Fedora or Ubuntu on your desktop or laptop onto

00:42.480 --> 00:48.320
your Android phone. So it's a standard Linux distribution on a phone form factor with USB

00:48.320 --> 00:54.960
modem for calls, text and mobile data. You can install desktop game, desktop Firefox, have a regular

00:54.960 --> 01:02.960
unix-like file hierarchy. Use our arcing to copy files over SSH and you can basically do anything

01:02.960 --> 01:09.200
on your phone that you would do on your Linux desktop or server. Provided you use a Linux laptop

01:09.200 --> 01:16.400
or desktop. There's no need to learn a new apps. Anything you know carries over to all your devices

01:16.400 --> 01:21.840
and there are similar projects to post-market OS for mobile phones like Mobian and Arch Linux Arm.

01:22.720 --> 01:28.560
In fact, today we have a lot of device insecure devices such as smart TVs, smart watches,

01:28.560 --> 01:32.880
and post-market OS can be used to improve user freedom on these devices.

01:34.880 --> 01:40.560
So very quickly we support a variety of user interfaces, everything from gnome to plasma mobile

01:40.560 --> 01:49.360
to telling window managers are supported, like SXMO. In fact, you can install post-market OS on

01:49.440 --> 01:55.920
wearables like watches and for that we support asteroid UI, which is a free software UI for

01:55.920 --> 02:01.760
watches. Since we also support devices that have the form factor of a TV box, we support

02:01.760 --> 02:09.600
entertainment UI called Cody. To get Linux distribution on all these devices, we have developed

02:09.600 --> 02:17.040
a tool called PMBootstrap. We say post-market OS boots on over 500 devices. Boots means

02:17.040 --> 02:24.320
it boots up and loads the Linux kernel and that's pretty much it to everything from Wi-Fi to

02:24.320 --> 02:28.880
the display doesn't work. But then there's something like the OnePlus 6 where almost everything works

02:29.680 --> 02:35.840
except for the camera. Now back to the install process. On these smart devices, TVs, phones,

02:35.840 --> 02:42.080
et cetera, each device requires its own special workflow. Moreover, this workflow changes depending

02:42.080 --> 02:48.160
on the host Linux distribution and requires a lot of manual steps and any guides we write would

02:48.160 --> 02:53.200
quickly go out of date. So we used to have a bunch of shell scripts and the shell scripts that

02:53.200 --> 02:59.760
post-market OS started with evolved into PMBootstrap written in Python. So post-market OS based on

02:59.760 --> 03:07.920
alpine Linux and the alpine Linux mini rootFS is 9.1 megabytes. Because alpine is so small,

03:07.920 --> 03:14.960
PMBootstrap will build images for your device in alpine change routes. PMBootstrap will allow you to

03:14.960 --> 03:20.800
easily include in your image any custom patches, kernels or packages you may be developing.

03:20.800 --> 03:26.480
PMBootstrap can set up different change routes for any experiment a developer may be working on.

03:27.280 --> 03:33.440
C-cash and compilation tool chain is all set up and automated and managed by PMBootstrap.

03:34.160 --> 03:39.200
The different flashing methods for all these different devices is abstracted away into

03:39.200 --> 03:45.760
universal commands and common code paths. All this makes it easy for users and developers to

03:45.760 --> 03:52.240
reproduce the issues and successes other users and developers have had on these over 500 devices.

03:55.680 --> 04:01.520
Cool. So post-market OS uses a very simple APK build format for packaging which is shown

04:02.480 --> 04:07.840
on your left. The beginning of this file is just some metadata version where to get the source

04:07.840 --> 04:13.760
table and dependencies. The metadata is followed by shell commands that build, check and

04:13.760 --> 04:20.080
package the program files. To package the build artifacts you installed the build artifact into

04:20.080 --> 04:26.080
the package directory and it able to make the package archive. This process is very similar to

04:26.320 --> 04:32.640
arch Linux. Furthermore files, device kernels, device specific configuration and actual applications

04:32.640 --> 04:40.080
like Firefox, mobile configuration are built using these APK build files. The APK build files and

04:40.080 --> 04:46.000
a few patches needed to build the images in post-market OS is available in a single get repo

04:46.000 --> 04:53.360
called PMA ports. Patching is temporary and we try to upstream everything we can to standard Linux.

04:54.320 --> 04:59.120
When initializing an image you will be asked a series of questions on how you would like your image to

04:59.120 --> 05:04.880
be built. Whether you want stable or rolling release, what device you have so PMBootstrap can

05:04.880 --> 05:11.840
load the device specific configuration firmware and components for Wi-Fi management and audio

05:11.840 --> 05:19.200
are easily swappable in post-market OS via PMBootstrap. The SSH settings are set up so that SSH is

05:19.200 --> 05:25.280
available and works out of the box. Additionally, PMBootstrap can enable full disk encryption on

05:25.280 --> 05:32.000
your install medium and you can choose between extended for F2FS and ButterFS file systems.

05:34.240 --> 05:42.720
You can generate a post-market OS image to run in a QMU virtual machine. This allows you to test

05:42.720 --> 05:49.120
your work during development or automate testing using something like Open QA. We also

05:49.120 --> 05:58.480
support generated images for ARM64 bit, X8664, PowerPC64 and risk V64, QMU emulators.

05:59.440 --> 06:05.760
It's super easy, it's just two commands. One of the advantages of the Linux distribution model

06:05.760 --> 06:10.560
over Android is that you don't need to build a massive image for every change you want to make.

06:11.280 --> 06:16.160
Moreover, if you want to change one package in the image, you only have to rebuild the package

06:16.160 --> 06:22.880
that you've changed. Once a package has been built locally using cross compilation, which is also

06:22.880 --> 06:30.720
very easy, you can remotely side load that package onto your device via SSH. PMBootstrap will put

06:30.720 --> 06:36.160
cross compiled packages in a local directory. If you want to run a build server with PMBootstrap

06:36.160 --> 06:41.280
handling the cross compilation, all you need to do is point a web server to serve the files from

06:41.280 --> 06:49.040
that local directory. PMBootstrap is so useful that when developing the Linux kernel, some

06:49.040 --> 06:54.000
developers consider it a core part of their kernel development workflow, even when they're not

06:54.000 --> 07:00.560
working on post-market OS directly. Since the tool chain with cross compilation is automatically

07:00.560 --> 07:06.880
installed with same defaults in a reproducible Alpine change route, it's easy to side load,

07:06.880 --> 07:12.960
it's easier to get up and running with kernel development quickly using PMBootstrap.

07:13.680 --> 07:19.840
Each Android device has a boot image, and PMBootstrap can analyze this using PMBootstrap boot

07:19.840 --> 07:25.120
image analytics. This command will read the boot image and help you when you're

07:25.120 --> 07:30.800
porting your new Android device over. Moreover, this command can provide you with information on

07:30.800 --> 07:38.640
how the Android device actually works. The K-Config PMBootstrap sub command will easily allow

07:38.640 --> 07:45.280
you to migrate older K-Configs to newer versions, newer kernel versions. Moreover, the project

07:45.280 --> 07:52.160
keeps a YAML file, that maps kernel options to features that users would want. So you can use

07:52.160 --> 07:58.640
K-Config check, and the K-Config check PMBootstrap sub command, and check that your kernel

07:58.880 --> 08:09.680
config has not regressed because of an unset option. So in conclusion, PMBootstrap is a great

08:09.680 --> 08:15.680
way to simplify your tool chain and create reproducibility in your development and ship new

08:15.680 --> 08:20.880
images to your customers. Again, the sources are on my blog post, and yeah, we have a table,

08:20.880 --> 08:30.880
so if you want to come and ask questions, that's cool too. Thank you.

