Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debian 11 #82

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions config/packer/debian-11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: debian-11-bullseye
codename: bullseye
pname: Debian GNU/Linux 11 (bullseye)
distro: debian
edition: server
arch: x64
version: '11'
download_url: >-
https://cdimage.debian.org/images/cloud/bullseye/20210928-779/debian-11-genericcloud-amd64-20210928-779.qcow2
disk_size: '5'
qcow_part: /dev/sda1
cloud_init_install: false
custom_scripts:
- ./scripts/resolv.sh
- ./scripts/fstab.sh
- ./scripts/debian/debian-10-buster.sh
# - ./scripts/debian/cli.sh
- ./scripts/apt_clean.sh
- ./scripts/check_df.sh
uefi_support: true
cli_support: true
format: qcow
repology_repo: debian_stable
11 changes: 5 additions & 6 deletions config/packer/debian-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ pname: Debian GNU/Linux (with Docker)
distro: debian
edition: docker
arch: x64
version: '10'
version: '11'
download_url: >-
http://cdimage.debian.org/images/cloud/OpenStack/current-10/debian-10-openstack-amd64.qcow2
https://cdimage.debian.org/images/cloud/bullseye/20210928-779/debian-11-genericcloud-amd64-20210928-779.qcow2
disk_size: '5'
qcow_part: /dev/sda1
cloud_init_ds_src: ./resources/cloud-init/ds_v2/DataSourceRbxCloud.py
cloud_init_install: true
cloud_init_install: false
custom_scripts:
- ./scripts/resolv.sh
- ./scripts/fstab.sh
- ./scripts/debian/debian-10-buster.sh
- ./scripts/debian/cli.sh
# - ./scripts/debian/cli.sh
- ./scripts/debian/docker.sh
- ./scripts/apt_clean.sh
- ./scripts/check_df.sh
uefi_support: true
cli_support: true
format: qcow
repology_repo: debian_stable
repology_repo: debian_stable
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
"source_image": "fedora:32",
"download_path": "/home/guru/image-{{timestamp}}.qcow",
"mount_qcow_path": "/home/guru/qcow-{{timestamp}}",
"download_url": "http://cdimage.debian.org/images/cloud/OpenStack/current-10/debian-10-openstack-amd64.qcow2",
"download_url": "https://cdimage.debian.org/images/cloud/bullseye/20210928-779/debian-11-genericcloud-amd64-20210928-779.qcow2",
"qcow_part": "/dev/sda1",
"root_fs": "ext4",
"root_fs_opts": "-E lazy_itable_init=1",
"scripts": "./scripts/resolv.sh,./scripts/fstab.sh,./scripts/debian/debian-10-buster.sh,./scripts/debian/cli.sh,./scripts/debian/docker.sh,./scripts/apt_clean.sh,./scripts/check_df.sh",
"cloud_init_tmp_path": "/tmp/cloud_init.py",
"cloud_init_ds_src": "./resources/cloud-init/ds_v2/DataSourceRbxCloud.py",
"scripts": "./scripts/resolv.sh,./scripts/fstab.sh,./scripts/debian/debian-10-buster.sh,./scripts/debian/docker.sh,./scripts/apt_clean.sh,./scripts/check_df.sh",
"disk_size": "5",
"image_name": "Debian GNU/Linux (with Docker)",
"ssh_name": "my-ssh",
"image_description": "{\"arch\":\"x64\",\"distro\":\"debian\",\"release\":\"10\",\"edition\":\"docker\",\"codename\":\"docker\",\"recommended\":{\"disk\":{\"size\":20}}}",
"image_description": "{\"arch\":\"x64\",\"distro\":\"debian\",\"release\":\"11\",\"edition\":\"docker\",\"codename\":\"docker\",\"recommended\":{\"disk\":{\"size\":20}}}",
"public_netadp_service": "public",
"vm_type": "a1.small",
"repository": "https://packages.hyperone.cloud",
Expand Down Expand Up @@ -99,19 +97,6 @@
"REPOSITORY={{user `repository`}}",
"CLI_PACKAGE={{user `cli_package`}}"
]
},
{
"type": "file",
"source": "{{user `cloud_init_ds_src`}}",
"destination": "{{user `cloud_init_tmp_path`}}"
},
{
"type": "shell",
"inline": [
"CLOUD_INIT_DS_DIR=$(find /usr -name cloudinit -type d)",
"echo Found cloud-init in path: ${CLOUD_INIT_DS_DIR}",
"mv {{user `cloud_init_tmp_path`}} ${CLOUD_INIT_DS_DIR}/sources/DataSourceRbxCloud.py"
]
}
]
}
}
102 changes: 102 additions & 0 deletions templates/qcow/debian-11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"variables": {
"source_image": "fedora:32",
"download_path": "/home/guru/image-{{timestamp}}.qcow",
"mount_qcow_path": "/home/guru/qcow-{{timestamp}}",
"download_url": "https://cdimage.debian.org/images/cloud/bullseye/20210928-779/debian-11-genericcloud-amd64-20210928-779.qcow2",
"qcow_part": "/dev/sda1",
"root_fs": "ext4",
"root_fs_opts": "-E lazy_itable_init=1",
"scripts": "./scripts/resolv.sh,./scripts/fstab.sh,./scripts/debian/debian-10-buster.sh,./scripts/apt_clean.sh,./scripts/check_df.sh",
"disk_size": "5",
"image_name": "Debian GNU/Linux 11 (bullseye)",
"ssh_name": "my-ssh",
"image_description": "{\"arch\":\"x64\",\"distro\":\"debian\",\"release\":\"11\",\"edition\":\"server\",\"codename\":\"bullseye\",\"recommended\":{\"disk\":{\"size\":20}}}",
"public_netadp_service": "public",
"vm_type": "a1.small",
"repository": "https://packages.hyperone.cloud",
"cli_package": "h1-cli",
"scope_name": "HyperOne",
"state_timeout": "10m"
},
"builders": [
{
"type": "hyperone",
"disk_size": 10,
"chroot_disk": true,
"mount_partition": 4,
"vm_name": "packer-debian-11-bullseye",
"source_image": "{{user `source_image`}}",
"vm_type": "{{user `vm_type`}}",
"ssh_keys": "{{user `ssh_name`}}",
"chroot_command_wrapper": "sudo {{.Command}}",
"chroot_disk_size": "{{user `disk_size`}}",
"image_name": "{{user `image_name`}}",
"image_description": "{{user `image_description`}}",
"public_netadp_service": "{{user `public_netadp_service`}}",
"state_timeout": "{{user `state_timeout`}}",
"pre_mount_commands": [
"[ ! -e '/etc/rpm/macros.dist' ] || sudo yum install -y \"https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(awk '/rhel/ {print $2}' /etc/rpm/macros.dist).noarch.rpm\"",
"yum install -y --setopt=skip_missing_names_on_install=False mtools libgcrypt libguestfs-tools dosfstools libguestfs-xfs wget pv",
"modprobe kvm",
"sgdisk -Z {{.Device}}",
"sgdisk -n 1:0:+50MB -t 1:EF01 -c 1:EFI {{.Device}}",
"sgdisk -n 2:0:+50MB -t 2:0700 -c 2:CLOUDMD {{.Device}}",
"sgdisk -n 3:0:+1MB -t 3:EF02 -c 3:BIOS {{.Device}}",
"sgdisk -n 4:0:-0 -t 4:8300 -c 4:ROOT {{.Device}} -A 4:set:2",
"gdisk -l {{.Device}}",
"sleep 2",
"mkfs.fat {{.Device}}1 -n EFI",
"mkfs.fat {{.Device}}2 -n CLOUDMD",
"mkfs.{{user `root_fs`}} {{user `root_fs_opts`}} {{.Device}}4"
],
"chroot_mounts": [
[
"proc",
"proc",
"/proc"
],
[
"sysfs",
"sysfs",
"/sys"
],
[
"bind",
"/dev",
"/dev"
],
[
"devpts",
"devpts",
"/dev/pts"
],
[
"binfmt_misc",
"binfmt_misc",
"/proc/sys/fs/binfmt_misc"
]
],
"post_mount_commands": [
"mkdir -p {{.MountPath}}/boot/efi",
"mount -t vfat {{.Device}}1 {{.MountPath}}/boot/efi",
"wget -nv {{user `download_url`}} -O {{user `download_path`}}",
"mkdir {{user `mount_qcow_path`}}",
"LIBGUESTFS_BACKEND=direct guestmount -a {{user `download_path`}} -m {{user `qcow_part`}} --ro {{user `mount_qcow_path`}}",
"setenforce 0",
"rsync -aH --inplace -W --numeric-ids -A -v {{user `mount_qcow_path`}}/ {{.MountPath}}/ | pv -l -c -n >/dev/null"
]
}
],
"provisioners": [
{
"type": "shell",
"scripts": "{{user `scripts`}}",
"environment_vars": [
"SCOPE_NAME={{user `scope_name`}}",
"REPOSITORY={{user `repository`}}",
"CLI_PACKAGE={{user `cli_package`}}"
]
}
]
}