f6176009b1
Stages TWRP's GUI engine and standalone tooling as PawletOS-owned modules instead of a bootable/recovery fork, per the plugin-architecture finding in NOTES-ota-recovery-ab.md: stock recovery_main.cpp already dlopen()s librecovery_ui_ext.so and dlsym()s make_device() from it at runtime, so the UI layer doesn't require touching stock bootable/recovery at all. Confirmed via source grep that recovery.cpp/install.cpp have zero references into the partition manager/backup engine/GUI code and vice versa. recovery_ui/: TWRP's gui/, minuitwrp/, libpixelflinger/ (copied verbatim, GPL-3.0), plus a new device/ providing PawletTwrpUI (a ScreenRecoveryUI subclass) and make_device() — written from scratch against stock's RecoveryUI/ScreenRecoveryUI virtual-method contract, since TWRP's own fork never ships a make_device() (every real TWRP device provides its own, and no reference device tree was available to copy from). Top-level Android.bp defines librecovery_ui_pawlet_twrp, the module TARGET_RECOVERY_UI_LIB should point at. gui/Android.bp and minuitwrp/Android.bp had their include_dirs rewritten for the new paths. recovery_toolkit/: partition manager, backup engine (tar/digest/adbbu/apex), filesystem/format support (exfat/dosfstools/gpt/fuse/mtp/crypto), scripting (openrecoveryscript/orscmd/twrpinstall), shared helpers. Source only, no Android.bp yet for any of it. Known gap blocking recovery_ui from actually linking: gui/'s libguitwrp depends on libaosprecovery, built from recovery_toolkit/helpers/twrp.cpp via a Go Soong plugin (libaosprecovery_defaults.go) not yet ported. Neither repo has been build-tested — no local AOSP build environment available in this workspace. See each directory's README.md for a precise done/not-done breakdown.
68 lines
1.5 KiB
C
68 lines
1.5 KiB
C
/*
|
|
* Copyright (C) 2009 Karel Zak <kzak@redhat.com>
|
|
*
|
|
* This file may be redistributed under the terms of the
|
|
* GNU Lesser General Public License.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <errno.h>
|
|
|
|
#include <blkid.h>
|
|
|
|
#include "c.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int rc;
|
|
char *devname;
|
|
blkid_probe pr;
|
|
|
|
if (argc < 2) {
|
|
fprintf(stderr, "usage: %s <device> "
|
|
"-- prints superblocks details about the device\n",
|
|
program_invocation_short_name);
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
devname = argv[1];
|
|
pr = blkid_new_probe_from_filename(devname);
|
|
if (!pr)
|
|
err(EXIT_FAILURE, "%s: faild to create a new libblkid probe",
|
|
devname);
|
|
|
|
/* enable topology probing */
|
|
blkid_probe_enable_superblocks(pr, TRUE);
|
|
|
|
/* set all flags */
|
|
blkid_probe_set_superblocks_flags(pr,
|
|
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_LABELRAW |
|
|
BLKID_SUBLKS_UUID | BLKID_SUBLKS_UUIDRAW |
|
|
BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE |
|
|
BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION |
|
|
BLKID_SUBLKS_MAGIC);
|
|
|
|
rc = blkid_do_safeprobe(pr);
|
|
if (rc == -1)
|
|
errx(EXIT_FAILURE, "%s: blkid_do_safeprobe() failed", devname);
|
|
else if (rc == 1)
|
|
warnx("%s: cannot gather information about superblocks", devname);
|
|
else {
|
|
int i, nvals = blkid_probe_numof_values(pr);
|
|
|
|
for (i = 0; i < nvals; i++) {
|
|
const char *name, *data;
|
|
|
|
blkid_probe_get_value(pr, i, &name, &data, NULL);
|
|
printf("\t%s = %s\n", name, data);
|
|
}
|
|
}
|
|
|
|
blkid_free_probe(pr);
|
|
return EXIT_SUCCESS;
|
|
}
|