Skip to content

Commit

Permalink
Merge pull request #520 from superna9999/qbootctl
Browse files Browse the repository at this point in the history
Add qbootctl package
  • Loading branch information
lumag authored Sep 2, 2023
2 parents e3831f0 + 2237a08 commit d5b4c59
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 26d488b38a0357468b8657f283ad24a433e30beb Mon Sep 17 00:00:00 2001
From: alefnode <[email protected]>
Date: Thu, 4 May 2023 09:15:29 +0200
Subject: [PATCH] Fix to << uint32_t has not been declared >>

Link: https://gitlab.com/sdm845-mainline/qbootctl/-/commit/df63d7c21c19a3e3afb41d029b97b9d068880484
Signed-off-by: Neil Armstrong <[email protected]>
---
bootctrl_impl.cpp | 1 +
gpt-utils.h | 1 +
qbootctl.cpp | 1 +
3 files changed, 3 insertions(+)

diff --git a/bootctrl_impl.cpp b/bootctrl_impl.cpp
index 7c1a082..59fcc7d 100644
--- a/bootctrl_impl.cpp
+++ b/bootctrl_impl.cpp
@@ -30,6 +30,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <limits.h>
+#include <stdint.h>

#include "utils.h"
#include "gpt-utils.h"
diff --git a/gpt-utils.h b/gpt-utils.h
index 319f3fe..f153012 100644
--- a/gpt-utils.h
+++ b/gpt-utils.h
@@ -37,6 +37,7 @@ extern "C" {
#endif
#include <unistd.h>
#include <stdlib.h>
+#include <stdint.h>

#define GPT_SIGNATURE "EFI PART"
#define HEADER_SIZE_OFFSET 12
diff --git a/qbootctl.cpp b/qbootctl.cpp
index 0225f0f..3559e29 100644
--- a/qbootctl.cpp
+++ b/qbootctl.cpp
@@ -25,6 +25,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <cstdint>

#include "bootctrl.h"

23 changes: 23 additions & 0 deletions recipes-support/qbootctl/files/qbootclt-bless-boot.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-License-Identifier: LGPL-2.1+
#
# This file was copied from systemd at [1]
#
# https://github.com/systemd/systemd/blob/main/units/systemd-bless-boot.service.in
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
Description=Mark the Current Boot slot as Good
DefaultDependencies=no
Requires=boot-complete.target
After=local-fs.target boot-complete.target
Conflicts=shutdown.target
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@bindir@/qbootctl -m
25 changes: 25 additions & 0 deletions recipes-support/qbootctl/qbootctl_0.1.2.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SUMMARY = "A port of the Qualcomm Android bootctrl HAL for musl/glibc userspace"
HOMEPAGE = "https://gitlab.com/sdm845-mainline/qbootctl"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1ebbd3e34237af26da5dc08a4e440464"

SRCREV = "77b48f092a3690d587e2d3b1e30cf8bc2abf87e7"
SRC_URI = "git://gitlab.com/sdm845-mainline/qbootctl.git;protocol=https;branch=main \
file://qbootclt-bless-boot.service.in \
file://0001-Fix-to-uint32_t-has-not-been-declared.patch \
"

DEPENDS = "zlib"

S = "${WORKDIR}/git"

PV = "0.1.2"

inherit meson systemd

do_install:append () {
install -d ${D}${systemd_system_unitdir}
sed 's:@bindir@:${bindir}:' < ${WORKDIR}/qbootclt-bless-boot.service.in > ${D}${systemd_system_unitdir}/qbootclt-bless-boot.service
}

SYSTEMD_SERVICE:${PN} = "qbootclt-bless-boot.service"

0 comments on commit d5b4c59

Please sign in to comment.