forked from mkaczanowski/packer-builder-arm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu.hcl
90 lines (67 loc) · 1.95 KB
/
ubuntu.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## Ubuntu Example
#
# Demonstrates:
#
# - Build comments
# - Image resizing
# - Network access
#
# Usage:
#
# sudo podman run --rm \
# --privileged \
# --volume /dev:/dev \
# --volume ${PWD}:/build \
# --env POLICY_NAME=bbb \
# connerwill/packer-builder-arm:latest \
# build ubuntu.hcl
#
"builders" = {
"file_checksum" = "4c41976f1f574a4786002482167fe6443d8c9f1bced86a174459ffeba1f5b780"
"file_checksum_type" = "sha256"
"file_target_extension" = "xz"
"file_unarchive_cmd" = ["xz", "-d", "$ARCHIVE_PATH"]
"file_urls" = ["https://rcn-ee.com/rootfs/2020-03-12/microsd/bone-ubuntu-18.04.4-console-armhf-2020-03-12-2gb.img.xz"]
## Image Resizing
#
# Required.
# Alternative values:
#
# - reuse: fetch the image (.img) file, mount it and that's all. The size setting (below) is ignored in reuse mode.
# - new: populate a rootfs (tarball with root file system).
#
"image_build_method" = "resize"
"image_chroot_env" = ["PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/sbin"]
"image_partitions" = {
"filesystem" = "ext4"
"mountpoint" = "/"
"name" = "root"
## Image Resizing
#
# Required.
#
"size" = "0"
"start_sector" = "8192"
"type" = "83"
}
"image_path" = "bbb-sdcard-ubuntu-18.04.4-console.img"
"image_setup_extra" = []
"image_size" = "4G"
"image_type" = "dos"
"qemu_binary_destination_path" = "/usr/bin/qemu-arm-static"
"qemu_binary_source_path" = "/usr/bin/qemu-arm-static"
"type" = "arm"
}
"provisioners" = {
"inline" = [
"rm -f /etc/resolv.conf",
"echo 'nameserver 1.1.1.1' > /etc/resolv.conf",
"echo 'nameserver 8.8.8.8' >> /etc/resolv.conf",
"apt-get update",
"apt upgrade --yes --option=Dpkg::Options::=--force-confdef",
"apt-get --yes autoremove",
"apt-get --yes clean"
]
"type" = "shell"
}
"variables" = {}