Skip to content

Commit

Permalink
Merge branch 'master' of github.com:void-linux/void-mklive into new-m…
Browse files Browse the repository at this point in the history
…klive
  • Loading branch information
pandom79 committed May 19, 2021
2 parents ded5b97 + e060405 commit b4fb193
Show file tree
Hide file tree
Showing 23 changed files with 235 additions and 163 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ SCRIPTS += $(SHIN:.sh.in=.sh)
DATECODE=$(shell date "+%Y%m%d")
SHELL=/bin/bash

T_PLATFORMS=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} GCP{,-musl} pinebookpro{,-musl}
T_PLATFORMS=rpi{,2,3,4}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} GCP{,-musl} pinebookpro{,-musl}
T_ARCHS=i686 x86_64{,-musl} armv{6,7}l{,-musl} aarch64{,-musl}

T_SBC_IMGS=rpi{,2,3}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} pinebookpro{,-musl}
T_SBC_IMGS=rpi{,2,3,4}{,-musl} beaglebone{,-musl} cubieboard2{,-musl} odroid-c2{,-musl} pinebookpro{,-musl}
T_CLOUD_IMGS=GCP{,-musl}

T_PXE_ARCHS=x86_64{,-musl}
Expand Down
1 change: 1 addition & 0 deletions lib.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ set_target_arch_from_platform() {
cubieboard2*|cubietruck*) XBPS_TARGET_ARCH="armv7l";;
odroid-u2*) XBPS_TARGET_ARCH="armv7l";;
odroid-c2*) XBPS_TARGET_ARCH="aarch64";;
rpi4*) XBPS_TARGET_ARCH="aarch64";;
rpi3*) XBPS_TARGET_ARCH="aarch64";;
rpi2*) XBPS_TARGET_ARCH="armv7l";;
rpi*) XBPS_TARGET_ARCH="armv6l";;
Expand Down
29 changes: 18 additions & 11 deletions mkimage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ elif [ ! -r "$ROOTFS_TARBALL" ]; then
die "Cannot read rootfs tarball: $ROOTFS_TARBALL"
fi

# Setup the platform variable. Here we want just the name and
# optionally -musl if this is the musl variant.
PLATFORM="${ROOTFS_TARBALL#void-}"
PLATFORM="${PLATFORM%-PLATFORMFS*}"

# Be absolutely certain the platform is supported before continuing
case "$PLATFORM" in
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|*-musl);;
*) die "The $PLATFORM is not supported, exiting..."
esac

# Default for bigger boot partion on pinebookpro since it needs to fit
# at least 2 Kernels + initramfs
case "$PLATFORM" in
pinebookpro*)
: "${BOOT_FSSIZE:=256MiB}"
;;
esac
# By default we build all platform images with a 64MiB boot partition
# formated FAT16, and an approximately 1.9GiB root partition formated
# ext4. More exotic combinations are of course possible, but this
Expand All @@ -123,11 +141,6 @@ fi
readonly REQTOOLS="sfdisk partx losetup mount truncate mkfs.${BOOT_FSTYPE} mkfs.${ROOT_FSTYPE}"
check_tools

# Setup the platform variable. Here we want just the name and
# optionally -musl if this is the musl variant.
PLATFORM="${ROOTFS_TARBALL#void-}"
PLATFORM="${PLATFORM%-PLATFORMFS*}"

# This is an awful hack since the script isn't using privesc
# mechanisms selectively. This is a TODO item.
if [ "$(id -u)" -ne 0 ]; then
Expand All @@ -141,12 +154,6 @@ if [ -z "$FILENAME" ]; then
FILENAME="void-${PLATFORM}-$(date +%Y%m%d).img"
fi

# Be absolutely certain the platform is supported before continuing
case "$PLATFORM" in
bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|GCP|pinebookpro|pinephone|*-musl);;
*) die "The $PLATFORM is not supported, exiting..."
esac

# Create the base image. This was previously accomplished with dd,
# but truncate is markedly faster.
info_msg "Creating disk image ($IMGSIZE) ..."
Expand Down
9 changes: 5 additions & 4 deletions mkplatformfs.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Usage: $PROGNAME [options] <platform> <base-tarball>
Supported platforms: i686, x86_64, GCP, bananapi, beaglebone,
cubieboard2, cubietruck, odroid-c2, odroid-u2,
rpi, rpi2 (armv7), rpi3 (aarch64), ci20,
rpi, rpi2 (armv7), rpi3 (aarch64), rpi4 (aarch64), ci20,
pinebookpro, pinephone
Options
Expand Down Expand Up @@ -117,9 +117,10 @@ case "$PLATFORM" in
cubieboard2*|cubietruck*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
odroid-u2*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
odroid-c2*) PKGS="$BASEPKG ${PLATFORM%-musl}-base" ;;
rpi3*) PKGS="$BASEPKG rpi-base" ;;
rpi2*) PKGS="$BASEPKG rpi-base" ;;
rpi*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
rpi4*) PKGS="$BASEPKG rpi4-base" ;;
rpi3*) PKGS="$BASEPKG rpi3-base" ;;
rpi2*) PKGS="$BASEPKG rpi2-base" ;;
rpi*) PKGS="$BASEPKG rpi-base" ;;
ci20*) PKGS="$BASEPKG ${PLATFORM%-*}-base" ;;
i686*) PKGS="$BASEPKG" ;;
x86_64*) PKGS="$BASEPKG" ;;
Expand Down
1 change: 1 addition & 0 deletions packer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ packer_cache
crash.log
*.box
templates/
cloud-generic
12 changes: 0 additions & 12 deletions packer/Makefile

This file was deleted.

26 changes: 0 additions & 26 deletions packer/fragments/base-qemu-glibc64.json

This file was deleted.

31 changes: 0 additions & 31 deletions packer/fragments/base-vbox-glibc64.json

This file was deleted.

22 changes: 0 additions & 22 deletions packer/fragments/platform-digitalocean.json

This file was deleted.

24 changes: 0 additions & 24 deletions packer/fragments/platform-vagrant.json

This file was deleted.

9 changes: 0 additions & 9 deletions packer/fragments/provisioner-cloud.json

This file was deleted.

37 changes: 37 additions & 0 deletions packer/hcl2/build-cloud-generic.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
build {
name = "cloud-generic-x86_64"

source "source.qemu.x86_64" {
boot_command = [
"<tab><wait>",
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64.cfg",
"<enter>"
]
vm_name = "voidlinux-x86_64"
output_directory = "cloud-generic-x86_64"
}

provisioner "shell" {
script = "scripts/cloud.sh"
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
}
}

build {
name = "cloud-generic-x86_64-musl"

source "source.qemu.x86_64" {
boot_command = [
"<tab><wait>",
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64-musl.cfg",
"<enter>"
]
vm_name = "voidlinux-x86_64-musl"
output_directory = "cloud-generic-x86_64-musl"
}

provisioner "shell" {
script = "scripts/cloud.sh"
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
}
}
45 changes: 45 additions & 0 deletions packer/hcl2/build-vagrant.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
build {
name = "vagrant-virtualbox-x86_64"

source "source.virtualbox-iso.x86_64" {
boot_command = [
"<tab><wait>",
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64.cfg",
"<enter>"
]
vm_name = "voidlinux-x86_64"
output_directory = "vagrant-virtualbox-x86_64"
}

provisioner "shell" {
script = "scripts/vagrant.sh"
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
}

post-processor "vagrant" {
output = "vagrant-virtualbox-x86_64.box"
}
}

build {
name = "vagrant-virtualbox-x86_64-musl"

source "source.virtualbox-iso.x86_64" {
boot_command = [
"<tab><wait>",
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64-musl.cfg",
"<enter>"
]
vm_name = "voidlinux-x86_64-musl"
output_directory = "vagrant-virtualbox-x86_64-musl"
}

provisioner "shell" {
script = "scripts/vagrant.sh"
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
}

post-processor "vagrant" {
output = "vagrant-virtualbox-x86_64-musl.box"
}
}
13 changes: 13 additions & 0 deletions packer/hcl2/source-qemu.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
source "qemu" "x86_64" {
accelerator = "kvm"
boot_wait = "5s"
disk_interface = "virtio"
disk_size = "2000M"
format = "qcow2"
http_directory = "http"
iso_checksum = "sha256:d95d40e1eb13a7776b5319a05660792fddd762662eaecee5df6b8feb3aa9b391"
iso_url = "https://alpha.de.repo.voidlinux.org/live/20200722/void-live-x86_64-5.7.10_1-20200722.iso"
ssh_password = "void"
ssh_timeout = "20m"
ssh_username = "void"
}
16 changes: 16 additions & 0 deletions packer/hcl2/source-virtualbox-ose.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
source "virtualbox-iso" "x86_64" {
guest_os_type = "Linux_64"
iso_url = "https://alpha.de.repo.voidlinux.org/live/20200722/void-live-x86_64-5.7.10_1-20200722.iso"
iso_checksum = "sha256:d95d40e1eb13a7776b5319a05660792fddd762662eaecee5df6b8feb3aa9b391"
ssh_username = "void"
ssh_password = "void"
http_directory = "http"
ssh_timeout = "20m"
guest_additions_mode = "disable"

vboxmanage = [
["modifyvm", "{{.Name}}", "--nictype1", "virtio"],
]

boot_wait = "5s"
}
1 change: 1 addition & 0 deletions packer/hcl2/vagrant/build-vagrant.pkr.hcl
1 change: 1 addition & 0 deletions packer/hcl2/vagrant/source-virtualbox-ose.pkr.hcl
20 changes: 0 additions & 20 deletions packer/http/vagrant.cfg

This file was deleted.

Loading

0 comments on commit b4fb193

Please sign in to comment.