-
choose a release https://alpinelinux.org/releases/ -> 3.23.3
-
download iso and checksum from https://alpinelinux.org/downloads/
wget https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-standard-3.23.3-x86_64.iso wget https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-standard-3.23.3-x86_64.iso.sha256 -
verify checksum (or do the gpg thing)
sha256sum alpine-standard-3.23.3-x86_64.iso # 966d6bf4d4c79958d43abde84a3e5bbeb4f8c757c164a49d3ec8432be6d36f16 alpine-standard-3.23.3-x86_64.iso cat alpine-standard-3.23.3-x86_64.iso.sha256 # 966d6bf4d4c79958d43abde84a3e5bbeb4f8c757c164a49d3ec8432be6d36f16 alpine-standard-3.23.3-x86_64.iso -
make file to store installation (here only 1GB chosen, adjust if needed)
qemu-img create -f qcow2 alpine-standard-3.23.3-x86_64.qcow2 1G -
create shell script for starting alpine (there is likely some unneeded stuff, prune):
#! /bin/sh
# create file by:
#
# qemu-img create -f qcow2 alpine-standard-3.23.3-x86_64.qcow2 1G
qemu-system-x86_64 \
-enable-kvm \
-m 2048 \
-drive file=alpine-standard-3.23.3-x86_64.qcow2,if=virtio \
-boot d \
-cdrom alpine-standard-3.23.3-x86_64.iso \
-netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9 \
-device virtio-net-pci,netdev=net0 \
-vga std
-
start system via script above
-
log in as root (no password)
-
partition disk
fdisk /dev/vdause
nto add a new primary partition and choose default values, then chosewto write the table and exit. -
prepare filesystem, mount, and start setup:
mkdosfs /dev/vda1 mkdir -p /media/vda1 echo "/dev/vda1 /media/vda1 vfat rw 0 0" >> /etc/fstab mount -a setup-alpine # (select vda1 for saving configs) -
continue through setup, answered (mostly defaults):
* Keymap [none] * Hostname [localhost] * Interface [eth0] * Ip address for eth0? [dhcp] * Do you want to do any manual network configuration? (y/n) [n] * Root Password <something-appropriate> * Timezone [UTC] * Proxy [none] * APK Mirror * Enter mirror number or URL: [1] * User [no] * Which ssh server? [none] * Disk & Install * Which disk(s) would you like to use? [none] * Enter where to store configs [vda1] * Enter apk cache directory [/media/vda1/cache] -
update apk repository indexes
apk update -
install some packages
apk add gcc make git musl-dev -
tweak PATH things:
mkdir -p $HOME/.local/bin export PATH=$HOME/.local/bin:$PATH -
fetch janet source:
mkdir src cd src git clone https://github.com/janet-lang/janet cd janet -
edit
Makefilefor static build, findCFLAGSlines and append-staticappropriately -
build janet:
make clean && PREFIX=$HOME/.local make -
copy
build/janetto/media/vda1/cachecp buid/janet /media/vda1/ -
might be able to keep packages and such via
lbu commit-- not sure -
shut down
sync halt -
use nbd to get at static
janetfrom qcow2sudo modprobe nbd max_part=8 sudo qemu-nbd --connect=/dev/nbd0 alpine-standard-3.23.3-x86_64.qcow2 sudo mount /dev/nbd0p1 /mnt cp /mnt/janet /tmp/ sudo umount /mnt sudo qemu-nbd --disconnect /dev/nbd0
- https://wiki.alpinelinux.org/wiki/Running_Alpine_in_Live_mode_in_QEMU
- https://www.qemu.org/docs/master/system/devices/net.html
- https://www.baeldung.com/linux/mount-qcow2-image - nbd
- https://wiki.alpinelinux.org/wiki/Alpine_local_backup - lbu
- https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html - semi-automatic installation