README.md 3.12 KB
Newer Older
Arnaud Ferraris's avatar
Arnaud Ferraris committed
1 2 3 4 5 6 7
# mobian-recipes

A set of [debos](https://github.com/go-debos/debos) recipes for building a
debian-based image for mobile phones, initially targetting Pine64's PinePhone.

Prebuilt images are available [here](http://images.mobian-project.org/).

8
The default user is `mobian` with password `1234`.
Arnaud Ferraris's avatar
Arnaud Ferraris committed
9 10 11 12 13 14 15

## Build

To build the image, you need to have `debos` and `bmaptool`. On a debian-based
system, install these dependencies by typing the following command in a terminal:

```
Eric LS's avatar
Eric LS committed
16
sudo apt install debos bmap-tools f2fs-tools
Arnaud Ferraris's avatar
Arnaud Ferraris committed
17 18
```

19 20 21
Do note that the debos provided in Debian 10 (Buster) is not new enough
(it will error out with "Unknown action: recipe"), the one in Debian
Bullseye/testing works.
Eric LS's avatar
Eric LS committed
22
If you want to build with EXT4 filesystem f2fs-tools is not required.
23

24 25 26
The build system will cache and re-use it's output files. To create a fresh build
remove `*.tar.gz`, `*.sqfs` and `*.img` before starting the build.

Arnaud Ferraris's avatar
Arnaud Ferraris committed
27 28 29 30 31 32 33
If your system isn't debian-based (or if you choose to install `debos` without
using `apt`, which is a terrible idea), please make sure you also install the
following required packages:
- `debootstrap`
- `qemu-system-x86`
- `qemu-user-static`
- `binfmt-support`
34
- `squashfs-tools-ng` (only required for generating installer images)
Arnaud Ferraris's avatar
Arnaud Ferraris committed
35 36 37 38 39

Then simply browse to the `mobian-recipes` folder and execute `./build.sh`.

You can use `./build.sh -d` to use the docker version of `debos`.

40 41
### Building QEMU image

42
You can build a QEMU x86_64 image by adding the `-t amd64` (UEFI) or
43 44 45 46 47 48 49 50
`-t amd64-legacy` (BIOS) flags to `build.sh`

The resulting files are raw images. You can start qemu like so:

```
qemu-system-x86_64 -drive format=raw,file=<imagefile.img> -enable-kvm -cpu host -vga virtio -m 2048 -smp cores=4 -bios <uefi-firmware>
```
If you have built the BIOS image you can drop the `-bios <uefi-firmware>` flag.
51
On a gentoo system f.e. the uefi firmware can be found under
52 53
`/usr/share/edk2-ovmf/OVMF_CODE.fd`

54
You may also want to convert the raw image to qcow2 format
55 56 57 58 59 60 61
and resize it like this:

```
qemu-img convert -f raw -O qcow2 <raw_image.img> <qcow_image.qcow2>
qemu-img resize -f qcow2 <qcow_image.qcow2> +20G
```

Arnaud Ferraris's avatar
Arnaud Ferraris committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
## Install

Insert a MicroSD card into your computer, and type the following command:

```
sudo bmaptool copy <image> /dev/<sdcard>
```

or:

```
sudo dd if=<image> of=/dev/<sdcard> bs=1M
```

*Note: Make sure to use your actual SD card device, such as `mmcblk0` instead of
`<sdcard>`.*

**CAUTION: This will format the SD card and erase all its contents!!!**

## Third-party software

The project's Wiki provides
[a list](https://gitlab.com/mobian1/wiki/-/wikis/Software) of software
packages modified or created to work on mobile devices.

## Contributing

If you want to help with this project, please have a look at the
[roadmap](https://gitlab.com/mobian1/wiki/-/wikis/Development-Roadmap) and
[open issues](https://gitlab.com/mobian1/issues).

In case you need more information, feel free to get in touch with the developers
on the Pine64 [forum](https://forum.pine64.org/showthread.php?tid=9016) and/or
[#mobian:matrix.org](https://matrix.to/#/#mobian:matrix.org).

# License

This software is licensed under the terms of the GNU General Public License,
version 3.