Browse Source

alpine

alpine
3moon 6 years ago
parent
commit
aedce51487
3 changed files with 51 additions and 93 deletions
  1. +32
    -31
      build.json
  2. +19
    -0
      http/answers
  3. +0
    -62
      http/preseed.cfg

+ 32
- 31
build.json View File

@ -1,33 +1,24 @@
{
"variables": {
"memory": "4G",
"cpus": "2",
"iso_url": "http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/alpine-standard-3.9.3-x86_64.iso",
"iso_checksum": "6e28c5c902ccb6db24596dfb6a1c255c7989d0b9be4e92e87a8eff523201a459",
"iso_checksum_type": "sha256",
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.8.0-amd64-netinst.iso",
"iso_checksum": "cc4a6bd50925c1c4af98049060e304494bc9da61eb5eb272c556d67608de14d4e6a4b8bc1c9412a0f810083912e228569f3771ffffa7174538f3e26f45a05245",
"iso_checksum_type": "sha512",
"boot_wait": "3s",
"boot_wait": "10s",
"boot_key_interval": "10ms",
"ssh_username": "unifi",
"ssh_password": "uuunifi",
"root_password": "uuunifi",
"ssh_timeout": "60m",
"machine_hostname": "unifi-controller",
"machine_domain": "lab.uncomfortably.online",
"machine_hostname": "unifi",
"http_directory": "http/",
"preseed_file": "preseed.cfg"
"http_directory": "http/"
},
"builders": [
{
"type": "qemu",
"accelerator": "kvm",
"qemuargs": [
[ "-m", "{{ user `memory` }}" ],
[ "-smp", "cpus={{ user `cpus`}}"]
],
"disk_interface": "virtio",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
@ -38,26 +29,36 @@
"boot_wait": "{{user `boot_wait`}}",
"boot_key_interval": "{{user `boot_key_interval`}}",
"boot_command": [
"<esc><wait>",
"install ",
"auto=true ",
"url=http://{{.HTTPIP}}:{{.HTTPPort}}/{{user `preseed_file`}} ",
"root<enter><wait>",
"ifconfig eth0 up && ",
"udhcpc -i eth0<enter>",
"<wait5>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>",
"sed -i ",
"-e \"s/:hostname:/{{user `machine_hostname`}}/g\" ",
"answers<enter>",
"sed -i \"s/rc-service \\$svc start/#&/\" /sbin/setup-sshd<enter>",
"hostname={{user `machine_hostname`}} ",
"domain={{user `machine_domain`}} ",
"interface=auto ",
"setup-alpine -f answers && ",
"mount /dev/vda3 /mnt && ",
"echo 'PermitRootLogin yes' >> /mnt/etc/ssh/sshd_config && ",
"umount /mnt && ",
"reboot",
"<enter>",
"<wait5>",
"passwd/user-fullname={{user `ssh_username`}} ",
"passwd/username={{user `ssh_username`}} ",
"passwd/user-password={{user `ssh_password`}} ",
"passwd/user-password-again={{user `ssh_password`}} ",
"{{user `root_password`}}<enter><wait>",
"{{user `root_password`}}<enter><wait20>",
"<enter>"
"y<enter>"
],
"communicator": "ssh",
"ssh_username": "{{user `ssh_username`}}",
"ssh_password": "{{user `ssh_password`}}",
"ssh_username": "root",
"ssh_password": "{{user `root_password`}}",
"ssh_timeout": "{{user `ssh_timeout`}}"
}
]

+ 19
- 0
http/answers View File

@ -0,0 +1,19 @@
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n :hostname:"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname :hostname:"
DNSOPTS="-d 8.8.8.8"
TIMEZONEOPTS="-z UTC"
PROXYOPTS="none"
APKREPOSOPTS="-1"
SSHDOPTS="-c openssh"
NTPOPTS="-c chrony"
DISKOPTS="-m sys /dev/vda"

+ 0
- 62
http/preseed.cfg View File

@ -1,62 +0,0 @@
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us
### Network configuration
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
d-i netcfg/choose_interface select auto
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
### Account setup
# Skip creation of a root account (normal user account will be able to
# use sudo).
d-i passwd/root-login boolean false
## Package setup
d-i hw-detect/load_firmware boolean false
d-i hw-detect/load_media boolean false
apt-cdrom-setup apt-setup/cdrom/set-first boolean false
tasksel tasksel/first multiselect print-server, ssh-server, standard
d-i pkgsel/include string sudo, unattended-upgrades
popularity-contest popularity-contest/participate boolean false
### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true
### Partitioning
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
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
# This makes partman automatically partition without confirmation.
d-i partman-md/confirm boolean true
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
### Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note

Loading…
Cancel
Save