summaryrefslogtreecommitdiff
path: root/grid5000/steps/export/export_g5k.yaml
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-29 14:11:21 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-29 14:11:21 +0200
commit4234a2882f0812be37721b6b7a58156260d52379 (patch)
tree9394eba47021a7050c7764b7fed0689d5a15b6fa /grid5000/steps/export/export_g5k.yaml
downloadgrid5k-4234a2882f0812be37721b6b7a58156260d52379.tar.gz
grid5k-4234a2882f0812be37721b6b7a58156260d52379.tar.bz2
grid5k-4234a2882f0812be37721b6b7a58156260d52379.zip
initial import
Diffstat (limited to 'grid5000/steps/export/export_g5k.yaml')
-rw-r--r--grid5000/steps/export/export_g5k.yaml84
1 files changed, 84 insertions, 0 deletions
diff --git a/grid5000/steps/export/export_g5k.yaml b/grid5000/steps/export/export_g5k.yaml
new file mode 100644
index 0000000..04b1358
--- /dev/null
+++ b/grid5000/steps/export/export_g5k.yaml
@@ -0,0 +1,84 @@
+# Generate a dsc file as used on grid'5000 by kaenv
+
+- dashes: "---" # kameleon eats my dash if I don't use this dirty hack :-(
+- g5k_version: "unknown"
+- g5k_kernel_path: "/vmlinuz"
+- g5k_initrd_path: "/initrd.img"
+- g5k_filesystem: "ext4"
+- g5k_author: "support-staff@lists.grid5000.fr"
+- g5k_visibility: "public"
+- g5k_destructive: "false"
+- g5k_tar_compression: "gzip"
+- g5k_postinst_compression: "gzip"
+
+# - save_as_tgz:
+# - check_cmd_local: guestfish
+# - check_cmd_local: gzip
+# - exec_local: echo "Exporting appliance to $${output}.tgz"
+# - exec_local: mkdir -p $${kameleon_cwd}/.mnt
+# - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} guestmount --ro -i -a $${input} $${kameleon_cwd}/.mnt
+# - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} tar -cf $${output}.tgz --gzip --numeric-owner --selinux --acls --xattrs -C $${kameleon_cwd}/.mnt .
+# - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} guestunmount $${kameleon_cwd}/.mnt
+# - exec_local: rmdir $${kameleon_cwd}/.mnt
+
+- generate_dsc:
+ - exec_local: echo "Creating description file for kaenv in $${output}.dsc"
+ - exec_local: |
+ if [[ "x$${g5k_variant}" != "xxen" ]]; then
+ cat << EOF > $${output}.dsc
+ $${dashes}
+ name: $${kameleon_recipe_name}
+ version: $${g5k_version}
+ description: $${distrib} $${release_number} ($${release}) for $${g5k_image_arch} - $${g5k_variant}
+ author: $${g5k_author}
+ visibility: $${g5k_visibility}
+ destructive: $${g5k_destructive}
+ os: linux
+ image:
+ file: $${g5k_tar_path}
+ kind: tar
+ compression: $${g5k_tar_compression}
+ postinstalls:
+ - archive: $${g5k_postinst_path}
+ compression: $${g5k_postinst_compression}
+ script: $${g5k_postinst_script}
+ boot:
+ kernel_params: "$${g5k_kernel_params}"
+ kernel: $${g5k_kernel_path}
+ initrd: $${g5k_initrd_path}
+ filesystem: $${g5k_filesystem}
+ partition_type: 131
+ multipart: false
+ EOF
+ else
+ cat << EOF > $${output}.dsc
+ $${dashes}
+ name: $${kameleon_recipe_name}
+ version: $${g5k_version}
+ description: $${distrib} $${release_number} ($${release}) for $${g5k_image_arch} - $${g5k_variant}
+ author: $${g5k_author}
+ visibility: $${g5k_visibility}
+ destructive: $${g5k_destructive}
+ os: xen
+ image:
+ file: $${g5k_tar_path}
+ kind: tar
+ compression: $${g5k_tar_compression}
+ postinstalls:
+ - archive: $${g5k_postinst_path}
+ compression: $${g5k_postinst_compression}
+ script: $${g5k_postinst_script}
+ boot:
+ kernel_params: "$${g5k_kernel_params}"
+ kernel: $${g5k_kernel_path}
+ initrd: $${g5k_initrd_path}
+ hypervisor: /hypervisor
+ hypervisor_params: "dom0_mem=4096M no-bootscrub"
+ filesystem: $${g5k_filesystem}
+ partition_type: 131
+ multipart: false
+ EOF
+ fi
+
+- generate_md5:
+ - exec_local: md5sum $${kameleon_recipe_name}.* > $${kameleon_recipe_name}.md5