working state
This commit is contained in:
parent
d94113878f
commit
46cea63aae
12 changed files with 241 additions and 61 deletions
28
build.sh
28
build.sh
|
@ -5,16 +5,18 @@ cd "$(dirname "$(realpath "$0")")"
|
|||
alias log='echo [build.sh]'
|
||||
|
||||
|
||||
ETH_DEV=$(route | grep '^default' | grep -o '[^ ]*$')
|
||||
VM_NAME="epitls_build"
|
||||
|
||||
|
||||
log "creating iso"
|
||||
sudo rm -fr tmp
|
||||
sudo rm -fr tmp/*
|
||||
mkdir -p tmp output
|
||||
sudo mkarchiso -v -w $PWD/tmp/wdir -r -o $PWD/output $PWD/profile
|
||||
rm -f output/install.iso
|
||||
mv output/archlinux-*.iso output/install.iso
|
||||
|
||||
|
||||
VM_NAME="epitls_build"
|
||||
|
||||
|
||||
if VBoxManage showvminfo $VM_NAME 2> /dev/null
|
||||
then log "disposing old VM"
|
||||
VBoxManage unregistervm $VM_NAME --delete-all
|
||||
|
@ -22,13 +24,25 @@ fi
|
|||
|
||||
|
||||
log "creating VM"
|
||||
VBoxManage createvm --name=$VM_NAME --register
|
||||
VBoxManage createvm --name=$VM_NAME --ostype=ArchLinux_64 --register
|
||||
VBoxManage modifyvm $VM_NAME --cpus=4 --memory=4096 --vram=12
|
||||
VBoxManage modifyvm $VM_NAME --nic1=bridged --bridgeadapter1=$ETH_DEV
|
||||
VBoxManage createhd --filename=$PWD/tmp/drive.vdi --size=$((1024 * 20)) --variant=Standard
|
||||
VBoxManage storagectl $VM_NAME --name=SATA --add sata --bootable on
|
||||
VBoxManage storageattach $VM_NAME --storagectl=SATA --port=0 --device=0 --type=hdd --medium=$PWD/tmp/drive.vdi
|
||||
VBoxManage storagectl $VM_NAME --name=IDE --add ide
|
||||
VBoxManage storageattach $VM_NAME --storagectl=IDE --port=0 --device=0 --type=dvddrive --medium=$PWD/output/install.iso
|
||||
|
||||
|
||||
log "running VM with iso"
|
||||
virtualboxvm --startvm $VM_NAME --dvd output/install.iso
|
||||
virtualboxvm --startvm $VM_NAME --dvd $PWD/output/install.iso
|
||||
VBoxManage storageattach $VM_NAME --storagectl=IDE --port=0 --device=0 --medium=none
|
||||
|
||||
|
||||
log "exporting VM"
|
||||
rm -f $PWD/output/epitls.ova
|
||||
VBoxManage export $VM_NAME --output=$PWD/output/epitls.ova --vsys=0 --vmname=epitls --description="VM pour le développement à EPITA Toulouse"
|
||||
|
||||
|
||||
log "disposing VM"
|
||||
VBoxManage unregistervm $VM_NAME --delete-all
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue