diff --git a/config/packer/debian-11.yaml b/config/packer/debian-11.yaml new file mode 100644 index 00000000..d08d4c23 --- /dev/null +++ b/config/packer/debian-11.yaml @@ -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 diff --git a/config/packer/debian-docker.yaml b/config/packer/debian-docker.yaml index 575a233e..e7f6e540 100644 --- a/config/packer/debian-docker.yaml +++ b/config/packer/debian-docker.yaml @@ -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 \ No newline at end of file +repology_repo: debian_stable diff --git a/templates/qcow/debian-10-docker.json b/templates/qcow/debian-11-docker.json similarity index 81% rename from templates/qcow/debian-10-docker.json rename to templates/qcow/debian-11-docker.json index bc57060b..fa46699a 100644 --- a/templates/qcow/debian-10-docker.json +++ b/templates/qcow/debian-11-docker.json @@ -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", @@ -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" - ] } ] -} \ No newline at end of file +} diff --git a/templates/qcow/debian-11.json b/templates/qcow/debian-11.json new file mode 100644 index 00000000..dd19c867 --- /dev/null +++ b/templates/qcow/debian-11.json @@ -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`}}" + ] + } + ] +}