[gnome-build-meta/valentindavid/ostree-devel-ref] Add an OSTree ref for development



commit 2c598a791cad95bec13f7cc54f21d9c3b639e225
Author: Valentin David <valentin david codethink co uk>
Date:   Tue Jul 7 13:07:24 2020 +0200

    Add an OSTree ref for development

 .gitlab-ci.yml                        | 24 ++++++++++++++++++--
 elements/core-devel.bst               |  7 ++++++
 elements/core.bst                     |  1 -
 elements/vm-devel/deps.bst            | 10 +++++++++
 elements/vm-devel/filesystem.bst      | 14 ++++++++++++
 elements/vm-devel/initial-scripts.bst |  7 ++++++
 elements/vm-devel/repo.bst            | 41 +++++++++++++++++++++++++++++++++++
 elements/vm/common-deps.bst           |  3 ---
 files/vm/enable-developer-repository  |  2 +-
 project.conf                          |  3 ++-
 utils/update-local-repo.sh            |  4 ++--
 11 files changed, 106 insertions(+), 10 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a9ece8f6..167921dd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -80,7 +80,7 @@ default:
   dependencies: [track]
   interruptible: true
   script:
-  - ${BST} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build core.bst flatpak-runtimes.bst 
flatpak-platform-extensions.bst platform-manifest.bst sdk-manifest.bst
+  - ${BST} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build core.bst core-devel.bst 
flatpak-runtimes.bst flatpak-platform-extensions.bst platform-manifest.bst sdk-manifest.bst
   - |
     # Only run this build for x86_64, instead of building it somewhere else
     if [ "${ARCH}" == "x86_64" ]; then
@@ -200,7 +200,7 @@ track:
   interruptible: true
   script:
   - 'sed -i "s/track-tags: False/track-tags: ${BST_TRACK_TAGS}/" project.conf'
-  - ${BST} track --deps all core.bst flatpak-runtimes.bst vm/image.bst boards/pinebook-pro/image.bst 
boards/rock64/image.bst boards/raspberrypi-4/image.bst
+  - ${BST} track --deps all core.bst flatpak-runtimes.bst vm/image.bst boards/pinebook-pro/image.bst 
boards/rock64/image.bst boards/raspberrypi-4/image.bst vm-devel/repo.bst
   retry: 2
   # only run on branches targeting master
   rules:
@@ -227,6 +227,26 @@ build-gnome-core-arm:
   extends: .build-template
   <<: *arm
 
+vm-devel-repo-x86_64:
+  stage: image
+  script:
+    - ${BST_NO_PUSH} --max-jobs $(( $(nproc) / 4 )) -o arch "${ARCH}" build vm-devel/repo.bst
+  rules:
+  - if: $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^gnome-\d-\d\d$/
+    when: on_success
+  - if: $CI_MERGE_REQUEST_ID == null
+    when: manual
+    allow_failure: true
+  cache: *bst-cache
+  artifacts:
+    when: always
+    paths:
+    - logs
+    expire_in: '2 days'
+  needs:
+  - track
+  - job: build-gnome-core-x86_64
+    artifacts: false
 
 vm-image-x86_64:
   extends: .vm-image-template
diff --git a/elements/core-devel.bst b/elements/core-devel.bst
new file mode 100644
index 00000000..2ff3858c
--- /dev/null
+++ b/elements/core-devel.bst
@@ -0,0 +1,7 @@
+# The core set is not expected to change as frequently as core-deps or
+# world. Adding or removing elements from here should be approved by
+# release team. Current contacts: Michael Catanzaro or Javier Jardon.
+kind: stack
+depends:
+- core.bst
+- core/meta-gnome-core-developer-tools.bst
diff --git a/elements/core.bst b/elements/core.bst
index 123c2205..b32b8e78 100644
--- a/elements/core.bst
+++ b/elements/core.bst
@@ -6,4 +6,3 @@ depends:
 - core/meta-gnome-core-os-services.bst
 - core/meta-gnome-core-shell.bst
 - core/meta-gnome-core-utilities.bst
-- core/meta-gnome-core-developer-tools.bst
diff --git a/elements/vm-devel/deps.bst b/elements/vm-devel/deps.bst
new file mode 100644
index 00000000..75c1f7de
--- /dev/null
+++ b/elements/vm-devel/deps.bst
@@ -0,0 +1,10 @@
+kind: stack
+
+runtime-depends:
+- core-devel.bst
+- vm/common-deps.bst
+- vm/initramfs.bst
+- freedesktop-sdk.bst:components/git.bst
+- freedesktop-sdk.bst:components/man-db.bst
+- freedesktop-sdk.bst:components/man-pages-posix.bst
+- freedesktop-sdk.bst:components/man-pages.bst
diff --git a/elements/vm-devel/filesystem.bst b/elements/vm-devel/filesystem.bst
new file mode 100644
index 00000000..ed1e549b
--- /dev/null
+++ b/elements/vm-devel/filesystem.bst
@@ -0,0 +1,14 @@
+kind: compose
+
+build-depends:
+- vm-devel/deps.bst
+- vm/initramfs.bst
+
+# Currently we just take everything and remove the
+# devel stuff (headers and static libraries), and debugging
+# symbols which take a huge amount of space, we could
+# refine this and make it much more selective, though.
+config:
+  exclude:
+  - devel
+  - debug
diff --git a/elements/vm-devel/initial-scripts.bst b/elements/vm-devel/initial-scripts.bst
new file mode 100644
index 00000000..f4c16011
--- /dev/null
+++ b/elements/vm-devel/initial-scripts.bst
@@ -0,0 +1,7 @@
+kind: collect_initial_scripts
+
+build-depends:
+- vm-devel/deps.bst
+
+config:
+  path: /etc/fdsdk/initial_scripts
diff --git a/elements/vm-devel/repo.bst b/elements/vm-devel/repo.bst
new file mode 100644
index 00000000..d66ded09
--- /dev/null
+++ b/elements/vm-devel/repo.bst
@@ -0,0 +1,41 @@
+kind: script
+
+build-depends:
+- core-deps/libostree.bst
+- vm-devel/filesystem.bst
+- vm-devel/initial-scripts.bst
+- freedesktop-sdk.bst:vm/prepare-image.bst
+
+variables:
+  uuidnamespace: aea54278-2587-4075-ae67-8688ace4ce3d
+  ostree-layer: devel
+
+environment:
+  OSTREE_REPO: "%{install-root}"
+
+config:
+  layout:
+  - element: ''
+    destination: /tmp
+  - element: core-deps/libostree.bst
+    destination: /
+  - element: vm-devel/filesystem.bst
+    destination: /sysroot
+  - element: vm-devel/initial-scripts.bst
+    destination: /
+  - element: vm/prepare-image.bst
+    destination: /
+
+  commands:
+  - |
+    prepare-image.sh \
+       --sysroot /sysroot \
+       --seed "%{uuidnamespace}" \
+       --rootsource /dev/gpt-auto-root \
+       --efisource LABEL=EFI \
+       --efipath /boot >/dev/null
+
+  - mkdir -p "${OSTREE_REPO}"
+  - ostree init --repo="${OSTREE_REPO}" --mode=archive
+  - mv /sysroot/etc /sysroot/usr/etc
+  - ostree commit --fsync=false --branch=%{ostree-branch} --timestamp="$(date --date="@${SOURCE_DATE_EPOCH}" 
--rfc-3339=seconds)" /sysroot
diff --git a/elements/vm/common-deps.bst b/elements/vm/common-deps.bst
index 4bd4f6e0..ded261b9 100644
--- a/elements/vm/common-deps.bst
+++ b/elements/vm/common-deps.bst
@@ -20,8 +20,5 @@ runtime-depends:
 - freedesktop-sdk.bst:vm/mesa-default.bst
 - freedesktop-sdk.bst:components/gamemode.bst
 - freedesktop-sdk.bst:components/linux-firmware.bst
-- freedesktop-sdk.bst:components/man-db.bst
-- freedesktop-sdk.bst:components/man-pages-posix.bst
-- freedesktop-sdk.bst:components/man-pages.bst
 - freedesktop-sdk.bst:components/openssh-systemd.bst
 - freedesktop-sdk.bst:components/wireless-regdb-bin.bst
diff --git a/files/vm/enable-developer-repository b/files/vm/enable-developer-repository
index 9bb04fe8..bf704609 100644
--- a/files/vm/enable-developer-repository
+++ b/files/vm/enable-developer-repository
@@ -2,7 +2,7 @@
 
 set -eu
 
-DEFAULT_REF="gnome-os/@@ARCH@@/devel"
+DEFAULT_REF="gnome-os/devel/@@ARCH@@/git"
 DEFAULT_NAME="local"
 DEFAULT_URL="http://10.0.2.2:8000/";
 DEFAULT_GPG="http://10.0.2.2:8000/key.gpg";
diff --git a/project.conf b/project.conf
index e0cf6ab4..7ca4e839 100644
--- a/project.conf
+++ b/project.conf
@@ -206,7 +206,8 @@ shell:
 
 variables:
   branch: master
-  ostree-branch: "gnome-os/%{arch}/%{branch}"
+  ostree-layer: user
+  ostree-branch: "gnome-os/%{ostree-layer}/%{arch}/%{branch}"
   ostree-remote-url: "https://nightly.gnome.org/gnomeos/repo";
   gcc_arch: "%{arch}"
   abi: "gnu"
diff --git a/utils/update-local-repo.sh b/utils/update-local-repo.sh
index 2f8cd591..70083f41 100755
--- a/utils/update-local-repo.sh
+++ b/utils/update-local-repo.sh
@@ -5,7 +5,7 @@ set -eu
 : ${BST:=bst}
 export BST
 
-: ${REPO_ELEMENT:=vm/repo.bst}
+: ${REPO_ELEMENT:=vm-devel/repo.bst}
 
 ref="$(${BST} show --format "%{vars}" --deps none "${REPO_ELEMENT}" | sed '/ostree-branch: /{;s///;q;};d')"
 
@@ -33,7 +33,7 @@ utils/update-repo.sh \
     --gpg-homedir=ostree-gpg \
     --gpg-sign="$(cat ostree-gpg/default-id)" \
     --collection-id=org.gnome.GnomeOS \
-    --target-ref="${ref%/*}/devel" \
+    --target-ref="${ref%/*}/git" \
     ostree-repo "${REPO_ELEMENT}" \
     "${ref}"
 


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