Commit 74de309b authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge branch 'basic-image' into 'master'

Add basic image

See merge request !158
parents 7f49675b 9920bd2c
Pipeline #5007 passed with stages
in 40 minutes and 54 seconds
......@@ -39,6 +39,7 @@ shfmt:
- export $(< build.env)
- ./build-host.sh
after_script:
- echo "image_size_megabytes{image=\"basic\"} $(du -m output/*basic*qcow2)" > metrics.txt
- echo "image_size_megabytes{image=\"cloudimg\"} $(du -m output/*cloudimg*qcow2)" > metrics.txt
- echo "image_size_megabytes{image=\"libvirt\"} $(du -m output/*libvirt*box)" >> metrics.txt
- echo "image_size_megabytes{image=\"virtualbox\"} $(du -m output/*virtualbox*box)" >> metrics.txt
......@@ -77,6 +78,16 @@ test-vagrant-boxes-format:
- vagrant box add output/Arch-Linux-x86_64-virtualbox-*.box --name archlinux-vbox
- vagrant box add output/Arch-Linux-x86_64-libvirt-*.box --name archlinux-libvirt
test-basic-qemu:
stage: test
variables:
SSHPASS: arch
before_script:
- pacman -Syu --needed --noconfirm qemu-headless sshpass
script:
- qemu-system-x86_64 -m 512 -net nic -net user,hostfwd=tcp::2222-:22 -drive file=$(ls output/Arch-Linux-x86_64-basic-*.qcow2),if=virtio -nographic &
- timeout 15m sh -c "while ! sshpass -e ssh -o ConnectTimeout=2 -o StrictHostKeyChecking=no arch@localhost -p 2222 sudo true; do sleep 1; done"
test-cloudimg-qemu:
stage: test
variables:
......
......@@ -11,6 +11,9 @@ Arch-boxes provides automated builds of the Arch Linux releases for different pr
### Vagrant
If you're a vagrant user, you can just go to [**our Vagrant Cloud page**](https://app.vagrantup.com/archlinux/boxes/archlinux) and follow the instructions there.
### Basic image
If you want to run Arch Linux locally in a VM (ex: for quick ad hoc testing), you can use our basic image, which comes preconfigured with a `arch` user (password: `arch`). It is built daily and can be downloaded [here](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/browse/output?job=build:secure) (`Arch-Linux-x86_64-basic-xxxxxxxx.xxxx.qcow2`).
### Cloud image
If you want to run Arch Linux in the cloud, you can use our cloud-image, which is preconfigured to work in most cloud environments. It is built daily and can be downloaded [here](https://gitlab.archlinux.org/archlinux/arch-boxes/-/jobs/artifacts/master/browse/output?job=build:secure) (`Arch-Linux-x86_64-cloudimg-xxxxxxxx.xxxx.qcow2`).
......
......@@ -138,7 +138,7 @@ function main() {
## Start build and copy output to local disk
send "bash -x ./build-inside-vm.sh ${BUILD_VERSION:-}\n"
expect "# " 240 # qemu-img convert can take a long time
send "cp -r --preserve=mode,timestamps output /mnt/arch-boxes/tmp/$(basename "${TMPDIR}")/\n"
send "cp -vr --preserve=mode,timestamps output /mnt/arch-boxes/tmp/$(basename "${TMPDIR}")/\n"
expect "# " 60
mv output/* "${OUTPUT}/"
......
#!/bin/bash
# shellcheck disable=SC2034,SC2154
IMAGE_NAME="Arch-Linux-x86_64-basic-${build_version}.qcow2"
PACKAGES=()
SERVICES=()
function pre() {
local NEWUSER="arch"
arch-chroot "${MOUNT}" /usr/bin/useradd -m -U "${NEWUSER}"
echo -e "${NEWUSER}\n${NEWUSER}" | arch-chroot "${MOUNT}" /usr/bin/passwd "${NEWUSER}"
echo "${NEWUSER} ALL=(ALL) NOPASSWD: ALL" >"${MOUNT}/etc/sudoers.d/${NEWUSER}"
cat <<EOF >"${MOUNT}/etc/systemd/network/80-dhcp.network"
[Match]
Name=eth0
[Network]
DHCP=ipv4
EOF
}
function post() {
qemu-img convert -c -f raw -O qcow2 "${1}" "${2}"
rm "${1}"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment