deviceinfo: add and require _codename (!1732)

deviceinfo_codneame holds the device's code name, so we can easily look
it up in the finished postmarketOS installation by reading
/etc/deviceinfo.

Related: postmarketOS/pmaports#157
This commit is contained in:
Luca Weiss 2018-12-25 17:59:18 +01:00 committed by Oliver Smith
parent 23df933db4
commit 747ccfdd75
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 9 additions and 0 deletions

View file

@ -127,6 +127,7 @@ def generate_deviceinfo_fastboot_content(args, bootimg=None):
def generate_deviceinfo(args, pkgname, name, manufacturer, arch, has_keyboard,
has_external_storage, flash_method, bootimg=None):
codename = "-".join(pkgname.split("-")[1:])
# Note: New variables must be added to pmb/config/__init__.py as well
content = """\
# Reference: <https://postmarketos.org/deviceinfo>
@ -135,6 +136,7 @@ def generate_deviceinfo(args, pkgname, name, manufacturer, arch, has_keyboard,
deviceinfo_format_version="0"
deviceinfo_name=\"""" + name + """\"
deviceinfo_manufacturer=\"""" + manufacturer + """\"
deviceinfo_codename=\"""" + codename + """\"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""