~postmarketos/pmbootstrap-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH pmbootstrap v3] install: run alpine-appstream-downloader if available

Pablo Correa Gómez <ablocorrea@hotmail.com>
Details
Message ID
<PAXP192MB12938C6B570CA56AA162E8A6C7AE9@PAXP192MB1293.EURP192.PROD.OUTLOOK.COM>
DKIM signature
pass
Download raw message
Patch: +22 -0
This makes sure that the AppStream data is available on the built
image. To avoid unnecessary downloads on multiple invocations of
install, create a new cache chroot.

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
---
 pmb/config/__init__.py  |  1 +
 pmb/install/_install.py | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py
index 98a7e462..38cc5bbe 100644
--- a/pmb/config/__init__.py
+++ b/pmb/config/__init__.py
@@ -216,6 +216,7 @@ chroot_host_path = os.environ["PATH"] + ":/usr/sbin/"
chroot_mount_bind = {
    "/proc": "/proc",
    "$WORK/cache_apk_$ARCH": "/var/cache/apk",
    "$WORK/cache_appstream/$ARCH/$CHANNEL": "/mnt/appstream-data",
    "$WORK/cache_ccache_$ARCH": "/mnt/pmbootstrap-ccache",
    "$WORK/cache_distfiles": "/var/cache/distfiles",
    "$WORK/cache_git": "/mnt/pmbootstrap-git",
diff --git a/pmb/install/_install.py b/pmb/install/_install.py
index 5a3f2bfe..768fa86d 100644
--- a/pmb/install/_install.py
+++ b/pmb/install/_install.py
@@ -370,6 +370,25 @@ def setup_hostname(args):
    pmb.chroot.root(args, ["sed", "-i", "-e", regex, "/etc/hosts"], suffix)


def setup_appstream(args):
    """
    If alpine-appstream-downloader has been downloaded, execute it to have
    update AppStream data on new installs
    """
    suffix = "rootfs_" + args.device
    installed_pkgs = pmb.chroot.apk.installed(args, suffix)

    if "alpine-appstream-downloader" not in installed_pkgs or args.offline:
        return

    pmb.chroot.root(args, ["alpine-appstream-downloader",
                           "/mnt/appstream-data"], suffix)
    pmb.chroot.root(args, ["mkdir", "-p", "/var/lib/swcatalog"], suffix)
    pmb.chroot.root(args, ["cp", "-r", "/mnt/appstream-data/icons",
                           "/mnt/appstream-data/xml",
                           "-t", "/var/lib/swcatalog"], suffix)


def disable_sshd(args):
    if not args.no_sshd:
        return
@@ -1013,6 +1032,8 @@ def create_device_rootfs(args, step, steps):
    # Set the hostname as the device name
    setup_hostname(args)

    setup_appstream(args)

    disable_sshd(args)
    disable_firewall(args)

-- 
2.39.2

[pmbootstrap/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CQSTBAAM3ZXS.HE2KVIQ5UEMU@cirno2>
In-Reply-To
<PAXP192MB12938C6B570CA56AA162E8A6C7AE9@PAXP192MB1293.EURP192.PROD.OUTLOOK.COM> (view parent)
DKIM signature
missing
Download raw message
pmbootstrap/patches/.build.yml: SUCCESS in 19m55s

[install: run alpine-appstream-downloader if available][0] v3 from [Pablo Correa Gómez][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/39351
[1]: ablocorrea@hotmail.com

✓ #948349 SUCCESS pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/948349
Reply to thread Export thread (mbox)