[gnome-build-meta/valentindavid/eos-installer: 6/13] Add eos-installer



commit 620f92e52455d5f870fa5f8cc1640a2e58c77c0c
Author: Valentin David <valentin david codethink co uk>
Date:   Wed Feb 26 12:53:15 2020 +0100

    Add eos-installer

 elements/iso/eos-installer.bst                | 38 ++++++++++++
 files/eos-installer/remove-gnome-common.patch | 85 +++++++++++++++++++++++++++
 files/eos-installer/two-partitions.patch      | 63 ++++++++++++++++++++
 files/eos-installer/vfat-eosimages.patch      | 15 +++++
 4 files changed, 201 insertions(+)
---
diff --git a/elements/iso/eos-installer.bst b/elements/iso/eos-installer.bst
new file mode 100644
index 00000000..ec7502d5
--- /dev/null
+++ b/elements/iso/eos-installer.bst
@@ -0,0 +1,38 @@
+kind: autotools
+
+sources:
+# The tarball does not build. We need to build from git.
+# The tarball is just a snapshot of the git repository and is missing
+# submodules.
+# There is no tarball release of libglnx.
+- kind: git_tag
+  url: github_com:endlessm/eos-installer.git
+  track-tags: true
+  track: Release_3.8.0
+  submodules:
+    ext/libglnx:
+      url: gitlab_gnome_org:GNOME/libglnx.git
+      checkout: true
+- kind: patch
+  path: files/eos-installer/vfat-eosimages.patch
+- kind: patch
+  path: files/eos-installer/two-partitions.patch
+- kind: patch
+  path: files/eos-installer/remove-gnome-common.patch
+
+depends:
+- freedesktop-sdk.bst:bootstrap-import.bst
+- freedesktop-sdk.bst:components/gnupg.bst
+- core-deps/udisks2.bst
+- core/gnome-desktop.bst
+- sdk/glib-networking.bst
+- sdk/glib.bst
+- sdk/gtk+-3.bst
+
+build-depends:
+- freedesktop-sdk.bst:public-stacks/buildsystem-autotools.bst
+- freedesktop-sdk.bst:components/git-minimal.bst
+- core-deps/intltool.bst
+
+runtime-depends:
+- core/gnome-session.bst
diff --git a/files/eos-installer/remove-gnome-common.patch b/files/eos-installer/remove-gnome-common.patch
new file mode 100644
index 00000000..5b6d22e5
--- /dev/null
+++ b/files/eos-installer/remove-gnome-common.patch
@@ -0,0 +1,85 @@
+commit 75eee3bd706e57eacaa4965126472d37eb4752c3
+Author: Javier Jardón <jjardon gnome org>
+Date:   Tue Apr 7 16:25:41 2020 +0100
+
+    Use upstream autoreconf instead deprecated gnome-common
+
+diff --git a/autogen.sh b/autogen.sh
+index 5d1b0a0..db45a05 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -1,28 +1,46 @@
+ #!/bin/sh
+ # Run this to generate all the initial makefiles, etc.
+-set -ex
++test -n "$srcdir" || srcdir=$(dirname "$0")
++test -n "$srcdir" || srcdir=.
+ 
+-srcdir=`dirname $0`
+-test -z "$srcdir" && srcdir=.
++olddir=$(pwd)
+ 
+-(test -f $srcdir/configure.ac \
+-  && test -f $srcdir/eos-installer.doap) || {
+-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+-    echo " top-level eos-installer directory"
+-    exit 1
+-}
++cd $srcdir
+ 
+-which gnome-autogen.sh >/dev/null || {
+-    echo "You need to install gnome-common"
+-    exit 1
++(test -f configure.ac) || {
++        echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
++        exit 1
+ }
+ 
++# shellcheck disable=SC2016
++PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
++
++if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
++        echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
++        echo "*** If you wish to pass any to it, please specify them on the" >&2
++        echo "*** '$0' command line." >&2
++        echo "" >&2
++fi
++
+ git submodule update --init --recursive
+ 
+ # Workaround automake bug with subdir-objects and computed paths; if
+ # changing this, please also change ext/Makefile.am.
+ sed -e 's,$(libglnx_srcpath),libglnx,g' < ext/libglnx/Makefile-libglnx.am 
ext/libglnx/Makefile-libglnx.am.inc
+ 
+-REQUIRED_AUTOMAKE_VERSION=1.13
+-set +x
+-. gnome-autogen.sh
++aclocal --install || exit 1
++intltoolize --force --copy --automake || exit 1
++autoreconf --verbose --force --install || exit 1
++
++cd "$olddir"
++if [ "$NOCONFIGURE" = "" ]; then
++        $srcdir/configure "$@" || exit 1
++
++        if [ "$1" = "--help" ]; then
++                exit 0
++        else
++                echo "Now type 'make' to compile $PKG_NAME" || exit 1
++        fi
++else
++        echo "Skipping configure process."
++fi
+diff --git a/configure.ac b/configure.ac
+index 154a178..3f6f277 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,8 +76,6 @@ AC_SUBST(INITIAL_SETUP_LIBS)
+ AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [], [],
+                   [-Wno-declaration-after-statement -Wno-packed])
+ 
+-GNOME_MAINTAINER_MODE_DEFINES
+-
+ AC_SUBST(CFLAGS)
+ AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
+ 
diff --git a/files/eos-installer/two-partitions.patch b/files/eos-installer/two-partitions.patch
new file mode 100644
index 00000000..c41181ec
--- /dev/null
+++ b/files/eos-installer/two-partitions.patch
@@ -0,0 +1,63 @@
+diff --git a/gnome-image-installer/util/gpt.c b/gnome-image-installer/util/gpt.c
+index c056769..8d23cf6 100644
+--- a/gnome-image-installer/util/gpt.c
++++ b/gnome-image-installer/util/gpt.c
+@@ -190,7 +190,7 @@ int is_eos_gpt_valid(struct ptable *pt, uint64_t *size)
+         //  invalid partition size
+         return 0;
+     }
+-    if(pt->header.ptable_count < 3 ) {
++    if(pt->header.ptable_count < 2 ) {
+         //  need at least 3 partitions
+         return 0;
+     }
+@@ -200,12 +200,6 @@ int is_eos_gpt_valid(struct ptable *pt, uint64_t *size)
+             return 0;
+         }
+     }
+-    uint64_t flags = 0;
+-    memcpy(&flags, pt->partitions[2].attributes, 8);
+-    if(!is_nth_flag_set(flags, 55)) {
+-        //  55th flag must be 1 for EOS images
+-        return 0;
+-    }
+     //  crc32 of header, with 'crc' field zero'ed
+     struct gpt_header testcrc_header;
+     memset(&testcrc_header, 0, GPT_HEADER_SIZE);
+@@ -234,17 +228,26 @@ int is_eos_gpt_valid(struct ptable *pt, uint64_t *size)
+         // invalid first partition GUID
+         return 0;
+     }
+-    if(memcmp(&pt->partitions[1].type_guid, GPT_GUID_BOOT, 16)!=0) {
+-        // invalid second partition GUID
+-        return 0;
+-    }
+-    if(memcmp(&pt->partitions[2].type_guid, GPT_GUID_LINUX_DATA, 16)!=0
+-    && memcmp(&pt->partitions[2].type_guid, GPT_GUID_LINUX_ROOTFS1, 16)!=0
+-    && memcmp(&pt->partitions[2].type_guid, GPT_GUID_LINUX_ROOTFS2, 16)!=0
+-    && memcmp(&pt->partitions[2].type_guid, GPT_GUID_LINUX_ROOTFS3, 16)!=0
+-    && memcmp(&pt->partitions[2].type_guid, GPT_GUID_LINUX_ROOTFS4, 16)!=0) {
++    int has_root = 0;
++    for (i = 1; i < pt->header.ptable_count; ++i) {
++      if (memcmp(&pt->partitions[i].type_guid, GPT_GUID_LINUX_DATA, 16)==0
++          || memcmp(&pt->partitions[i].type_guid, GPT_GUID_LINUX_ROOTFS1, 16)==0
++          || memcmp(&pt->partitions[i].type_guid, GPT_GUID_LINUX_ROOTFS2, 16)==0
++          || memcmp(&pt->partitions[i].type_guid, GPT_GUID_LINUX_ROOTFS3, 16)==0
++          || memcmp(&pt->partitions[i].type_guid, GPT_GUID_LINUX_ROOTFS4, 16)==0) {
+         // invalid third partition GUID
+-        return 0;
++        uint64_t flags = 0;
++        memcpy(&flags, pt->partitions[i].attributes, 8);
++        if(!is_nth_flag_set(flags, 55)) {
++          //  55th flag must be 1 for EOS images
++          continue ;
++        }
++        has_root=1;
++        break ;
++      }
++    }
++    if (!has_root) {
++      return 0;
+     }
+ 
+     if (size != NULL) {
diff --git a/files/eos-installer/vfat-eosimages.patch b/files/eos-installer/vfat-eosimages.patch
new file mode 100644
index 00000000..c0255e05
--- /dev/null
+++ b/files/eos-installer/vfat-eosimages.patch
@@ -0,0 +1,15 @@
+diff --git a/eos-installer-data/run-mount-eosimages.mount b/eos-installer-data/run-mount-eosimages.mount
+index 108656b..12106de 100644
+--- a/eos-installer-data/run-mount-eosimages.mount
++++ b/eos-installer-data/run-mount-eosimages.mount
+@@ -4,8 +4,8 @@ Description=Endless OS reformatter images partition
+ [Mount]
+ What=LABEL=eosimages
+ Where=/run/mount/eosimages
+-Type=exfat
+-Options=rw,noatime,nodev,nosuid,noexec,nofail,allow_other
++Type=vfat
++Options=ro,noatime,nodev,nosuid,noexec,nofail
+ DirectoryMode=0755
+ 
+ [Install]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]