[Slackbuilds-users] WIP: protobuf3 25.3
Tonus
tonus1 at free.fr
Wed Mar 20 19:46:02 UTC 2024
On Mon, Mar 11, 2024 at 09:13:58AM -0300, Slackbuilds Mailing List wrote:
>I'm still looking for some guidelines on how developers usually create virtual machines to test. I used virtualbox when I developed for debian, but I don't like this approach anymore. I'm trying to learn LCX, and for slackware it doesn't have templates ready to go, so there is that.
>
Hi
Not really a developer here but found great advice from Alien Bob with
qemu.
Can't find the source with a quick search so here's the pitch :
- create a qemu base image with genuine and up-to-date Slackware
- I only add autocompletion, bash magic key and sbo tools and tree
- then I use the following script to get a snapshot
- I launch it , do stuff and tests, save the package on host
- test on my machine and share on SBo
- an important thing is to get a share between machines
- another one is to keep a consistant SBo tree on base qemu image
Now the script from AlienBOB (modified but can't recall if/how) :
│ #!/bin/sh
│ #
│ # Start Slackware in QEMU
│ # Use QEMU snapshots (COW - Copy On Write images) for the purpose of
│ # testing software in a clean environment.
│
│ ## ---------------------------------------------------------------------------
│ ## Create an empty 15GB image file like this:
│ ## # dd if=/dev/zero of=slackware.img bs=1k count=15000000
│ ##
│ ## You must install a version of Slackware in this image file.
│ ## This installation will be your base image. It will not change unless
│ ## you want to install security patches.
│ ##
│ ## Then create the QCOW (qemu copy-on-write) file like this:
│ ## $ qemu-img create -b slackware.img -f qcow slackware_snapshot.qcow
│ ##
│ ## DO NOT commit the changes made in the QCOW file back to the base image!
│ ## The QCOW image is only used once and re-created every time the script runs!
│ ## ---------------------------------------------------------------------------
│
│ # Location of your QEMU images:
│ IMAGEDIR=/path/to/disk_img/slackware
│
│ # ISO location
│ iso_file=/path/to/disk_img/slackware64-current-iso/slackware64-15.0-install-dvd.iso
│ # add next option to have it
│ # -cdrom "${iso_file}"
│
│ #[ ! -z $* ] && PARAMS=$*
│ # add command line parameters to defaults
│ PARAMS=$*
│
│ # Qemu can use SDL sound instead of the default OSS
│ export QEMU_AUDIO_DRV=sdl
│
│ # Whereas SDL can play through alsa:
│ export SDL_AUDIODRIVER=alsa
│
│ cd $IMAGEDIR
│ # Remove old QCOW file, create a new one:
│ if [ -f slackware-15.0_snapshot.qcow ]; then
│ rm -f slackware-15.0_snapshot.qcow
│ fi
│ qemu-img create -f qcow2 -b slackware64-15.0.qcow2 -F qcow2 slackware64-15.0_snapshot.qcow
│
│ qemu-system-x86_64 -enable-kvm -smp cpus=2 -smp maxcpus=3 -m 4096 -k fr -daemonize \
│ -vga virtio -boot menu=on -usb -drive file=slackware64-15.0_snapshot.qcow \
│ -fsdev local,id=repos,path=/path/to/share,security_model=none \
│ -device virtio-9p-pci,fsdev=repos,mount_tag=repos ${PARAMS} >slackware-15.0_snapshot.log \
│ 2>slackware-15.0_snapshot.err
--
Regards,
Tonus
More information about the SlackBuilds-users
mailing list