forked from mkaczanowski/packer-builder-arm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
archlinuxarm.pkr.hcl
58 lines (52 loc) · 1.6 KB
/
archlinuxarm.pkr.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
source "cross" "archlinux" {
file_checksum_type = "md5"
file_checksum_url = "http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz.md5"
file_target_extension = "tar.gz"
file_unarchive_cmd = ["bsdtar", "-xpf", "$ARCHIVE_PATH", "-C", "$MOUNTPOINT"]
file_urls = ["http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz"]
image_build_method = "new"
image_partitions {
filesystem = "vfat"
mountpoint = "/boot-tmp"
name = "boot"
size = "256M"
start_sector = "8192"
type = "c"
}
image_partitions {
filesystem = "ext4"
mountpoint = "/"
name = "root"
size = "0"
start_sector = "532480"
type = "83"
}
image_path = "raspberry-pi.img"
image_size = "2G"
image_type = "dos"
qemu_binary_destination_path = "/usr/bin/qemu-arm-static"
qemu_binary_source_path = "/usr/bin/qemu-arm-static"
}
build {
sources = ["source.cross.archlinux"]
provisioner "shell" {
inline = [
"mv boot/* boot-tmp/",
"mount --bind boot-tmp boot",
"pacman-key --init",
"pacman-key --populate archlinuxarm",
"mv /etc/resolv.conf /etc/resolv.conf.bk",
"echo 'nameserver 8.8.8.8' > /etc/resolv.conf",
"pacman -Sy --noconfirm --needed",
"pacman -S parted --noconfirm --needed",
"umount boot"
]
}
provisioner "file" {
destination = "/tmp"
source = "scripts/resizerootfs"
}
provisioner "shell" {
script = "scripts/bootstrap_resizerootfs.sh"
}
}