Skip to content

Commit

Permalink
feat: add debian 12
Browse files Browse the repository at this point in the history
Adds Debian 12 (Bookworm) to the project.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
Ryan Johnson committed Jun 15, 2023
1 parent dc39723 commit dcb67ea
Show file tree
Hide file tree
Showing 7 changed files with 851 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:boom: **Enhancement**:

- Adds VMware Photon OS 5.0 to the project. [GH-582](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/582)
- Adds Debian 12 to the project. [GH-584](https://github.com/vmware-samples/packer-examples-for-vsphere/pull/584)

:sweat_drops: **Chore**:

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The following builds are available:

- VMware Photon OS 5
- VMware Photon OS 4
- Debian 12
- Debian 11
- Ubuntu Server 22.04 LTS (cloud-init)
- Ubuntu Server 20.04 LTS (cloud-init)
Expand Down Expand Up @@ -812,6 +813,8 @@ The project supports using a datastore to store your guest operating system [`.i
- [Download][download-linux-photon-5] the latest release of the **FULL** `.iso` image. (_e.g.,_ `photon-5.0-xxxxxxxxx.x86_64.iso`)
- VMware Photon OS 4
- [Download][download-linux-photon-4] the latest release of the **FULL** `.iso` image. (_e.g.,_ `photon-4.0-xxxxxxxxx.iso`)
- Debian 12
- [Download][download-linux-debian-12] the latest **netinst** release `.iso` image. (_e.g.,_ `debian-12.x.x-amd64-netinst.iso`)
- Debian 11
- [Download][download-linux-debian-11] the latest **netinst** release `.iso` image. (_e.g.,_ `debian-11.x.x-amd64-netinst.iso`)
- Ubuntu Server 22.04 LTS
Expand Down Expand Up @@ -1015,7 +1018,8 @@ Happy building!!!
[download-linux-centos-7]: http://isoredirect.centos.org/centos/7/isos/x86_64/
[download-linux-centos-stream-8]: http://isoredirect.centos.org/centos/8-stream/isos/x86_64/
[download-linux-centos-stream-9]: http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/
[download-linux-debian-11]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
[download-linux-debian-12]: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/
[download-linux-debian-11]: https://cdimage.debian.org/cdimage/archive/11.7.0/amd64/iso-cd/
[download-linux-photon-5]: https://packages.vmware.com/photon/5.0/GA/iso/
[download-linux-photon-4]: https://packages.vmware.com/photon/4.0/Rev2/iso/
[download-linux-rhel-7]: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.9/x86_64/product-software
Expand Down
3 changes: 3 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ menu:
- entry: "VMware Photon OS 4"
build:
path: "builds/linux/photon/4/"
- entry: "Debian 12"
build:
path: "builds/linux/debian/12/"
- entry: "Debian 11"
build:
path: "builds/linux/debian/11/"
Expand Down
185 changes: 185 additions & 0 deletions builds/linux/debian/12/data/ks.pkrtpl.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# Debian 12 (Bookworm) Preseed File
# https://www.debian.org/releases/bookworm/amd64/

# Locale and Keyboard
d-i debian-installer/locale string ${vm_guest_os_language}
d-i keyboard-configuration/xkb-keymap select ${vm_guest_os_keyboard}

# Clock and Timezone
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i time/zone string ${vm_guest_os_timezone}

# Grub and Reboot Message
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true

# Partitioning
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-auto-lvm/new_vg_name string sysvg
d-i partman-efi/non_efi_system boolean true

d-i partman-auto/expert_recipe string \
custom :: \
1024 1024 1024 fat32 \
$primary{ } \
mountpoint{ /boot/efi } \
method{ efi } \
format{ } \
use_filesystem{ } \
filesystem{ vfat } \
label { EFIFS } \
. \
1024 1024 1024 xfs \
$bootable{ } \
$primary{ } \
mountpoint{ /boot } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { BOOTFS } \
. \
1024 1024 1024 linux-swap \
$lvmok{ } \
lv_name{ lv_swap } \
in_vg { sysvg } \
method{ swap } \
format{ } \
label { SWAPFS } \
. \
12288 12288 -1 xfs \
$lvmok{ } \
mountpoint{ / } \
lv_name{ lv_root } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { ROOTFS } \
. \
4096 4096 4096 xfs \
$lvmok{ } \
mountpoint{ /home } \
lv_name{ lv_home } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { HOMEFS } \
options/nodev{ nodev } \
options/nosuid{ nosuid } \
. \
2048 2048 2048 xfs \
$lvmok{ } \
mountpoint{ /opt } \
lv_name{ lv_opt } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { OPTFS } \
options/nodev{ nodev } \
. \
3072 3072 3072 xfs \
$lvmok{ } \
mountpoint{ /tmp } \
lv_name{ lv_tmp } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { TMPFS } \
options/nodev{ nodev } \
options/noexec{ noexec } \
options/nosuid{ nosuid } \
. \
4096 4096 4096 xfs \
$lvmok{ } \
mountpoint{ /var } \
lv_name{ lv_var } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { VARFS } \
options/nodev{ nodev } \
. \
4096 4096 4096 xfs \
$lvmok{ } \
mountpoint{ /var/log } \
lv_name{ lv_log } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { LOGFS } \
options/nodev{ nodev } \
options/noexec{ noexec } \
options/nosuid{ nosuid } \
. \
4096 4096 4096 xfs \
$lvmok{ } \
mountpoint{ /var/log/audit } \
lv_name{ lv_audit } \
in_vg { sysvg } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ xfs } \
label { AUDITFS } \
options/nodev{ nodev } \
options/noexec{ noexec } \
options/nosuid{ nosuid } \
. \

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string cdn-fastly.deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

# User Configuration
d-i passwd/root-login boolean false
d-i passwd/user-fullname string ${build_username}
d-i passwd/username string ${build_username}
d-i passwd/user-password-crypted password ${build_password_encrypted}

# Package Configuration
d-i pkgsel/run_tasksel boolean false
d-i pkgsel/include string openssh-server open-vm-tools python3-apt perl

# Add User to Sudoers
d-i preseed/late_command string \
echo '${build_username} ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/${build_username} ; \
in-target chmod 440 /etc/sudoers.d/${build_username} ;

%{ if common_data_source == "disk" ~}
# Umount preseed media early
d-i preseed/early_command string \
umount /media && echo 1 > /sys/block/sr1/device/delete ;
%{ endif ~}
42 changes: 42 additions & 0 deletions builds/linux/debian/12/linux-debian.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
DESCRIPTION:
Debian 12 (Bookworm) build variables.
*/

// Guest Operating System Metadata
vm_guest_os_language = "en_US"
vm_guest_os_keyboard = "us"
vm_guest_os_timezone = "UTC"
vm_guest_os_family = "linux"
vm_guest_os_name = "debian"
vm_guest_os_version = "12.0"

// Virtual Machine Guest Operating System Setting
vm_guest_os_type = "other5xLinux64Guest"

// Virtual Machine Hardware Settings
vm_firmware = "efi-secure"
vm_cdrom_type = "sata"
vm_cpu_count = 2
vm_cpu_cores = 1
vm_cpu_hot_add = false
vm_mem_size = 2048
vm_mem_hot_add = false
vm_disk_size = 40960
vm_disk_controller_type = ["pvscsi"]
vm_disk_thin_provisioned = true
vm_network_card = "vmxnet3"

// Removable Media Settings
iso_path = "iso/linux/debian"
iso_file = "debian-12.0.0-amd64-netinst.iso"
iso_checksum_type = "sha512"
iso_checksum_value = "b462643a7a1b51222cd4a569dad6051f897e815d10aa7e42b68adc8d340932d861744b5ea14794daa5cc0ccfa48c51d248eda63f150f8845e8055d0a5d7e58e6"

// Boot Settings
vm_boot_order = "disk,cdrom"
vm_boot_wait = "5s"

// Communicator Settings
communicator_port = 22
communicator_timeout = "30m"
Loading

0 comments on commit dcb67ea

Please sign in to comment.