- Just use qcow2 images and create an Oracle Custom Image.
- Images: https://gitlab.archlinux.org/archlinux/arch-boxes/-/packages
- Example: Arch-Linux-x86_64-cloudimg-20221015.94571.qcow2
Refs:
- http://mirror.cs.pitt.edu/archlinux/iso/2021.02.01/archlinux-bootstrap-2021.02.01-x86_64.tar.gz
- https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-virt-3.13.1-x86_64.iso
- https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely
- https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
Requirement: Console access.
wget https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-virt-3.13.1-x86_64.iso -O- | dd of=/dev/sda bs=1M sync reboot -f
vi /etc/network/interfaces auto eth0 iface eth0 inet dhcp ifup eth0
setup-sshd
mkdir .ssh
cat > .ssh/authorized_keys
[At this point it's easier to use SSH to copy & paste] [Per Ref #3]
mkdir /media/setup
cp -a /media/sda/* /media/setup
mkdir /lib/setup
cp -a /.modloop/* /lib/setup
/etc/init.d/modloop stop
umount /dev/sda
mv /media/setup/* /media/sda/
mv /lib/setup/* /.modloop/
setup-apkrepos vi /etc/apk/repositories, enable community apk update apk add dosfstools e2fsprogs pacman arch-install-scripts
Use gpt table, set esp partition #15 size 260M), set root partition 1 size remaining
fdisk /dev/sda
mkfs.vfat /dev/sda15
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
mkdir -p /mnt/boot
mount /dev/sda15 /mnt/boot
1G ram is not enough to hold arch bootstrap. Use HDD for now.
mkdir /mnt/tmp
cd /mnt/tmp
wget https://mirror.arizona.edu/archlinux/iso/latest/archlinux-bootstrap-x86_64.tar.gz -O- | tar zxvf -
vi root.x86_64/etc/pacman.d/mirrorlist
arch-chroot root.x86_64/
pacman-key --init
pacman-key --populate archlinux
Any other way than mount again?
mount /dev/sda1 /mnt
mount /dev/sda15 /mnt/boot
pacstrap /mnt base linux linux-firmware
genfstab -U /mnt >> /mnt/etc/fstab
Follow https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system
mkdir /dev/block ; ln -sfrv /dev/sda15 /dev/block/8:15
bootctl install
sed -e 's:options.*:options root=/dev/sda1 rw:' /usr/share/systemd/bootctl/arch.conf > /boot/loader/entries/arch.conf
exit # Exit chroot
cd /
umount /dev/sda*
sync
reboot
-
Investigate qcow2 image via Alpine to harddrive image using qemu-img https://gitlab.archlinux.org/archlinux/arch-boxes
qemu-img convert -f qcow2 -O raw my-qcow2.img /dev/sdb
-
Possible to drop
linux-firmware
, is it needed?