mirror of
				https://github.com/siderolabs/talos.git
				synced 2025-11-04 10:21:13 +01:00 
			
		
		
		
	This will fix running these scripts on distros without /bin/bash, but where bash is in $PATH, such as NixOS. Currently, `make fmt` otherwise fails to run: ``` make[3]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos' sh: ./hack/fix-artifacts.sh: /bin/bash: bad interpreter: No such file or directory make[2]: *** [Makefile:163: local-fmt-protobuf] Error 126 make[2]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos' make[1]: *** [Makefile:274: fmt-protobuf] Error 2 make[1]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos' make: *** [Makefile:277: fmt] Error 2 ``` Signed-off-by: Florian Klink <flokli@flokli.de> Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
set -e
 | 
						|
 | 
						|
: ${TALOS_QEMU_ROOT:="/tmp"}
 | 
						|
 | 
						|
case $(uname -s) in
 | 
						|
  Linux*)
 | 
						|
    ACCEL=kvm
 | 
						|
    ;;
 | 
						|
 | 
						|
  Darwin*)
 | 
						|
    ACCEL=hvf
 | 
						|
    ;;
 | 
						|
  *)
 | 
						|
    exit 1
 | 
						|
    ;;
 | 
						|
esac
 | 
						|
 | 
						|
KERNEL="_out/vmlinuz-amd64"
 | 
						|
INITRD="_out/initramfs-amd64.xz"
 | 
						|
IMAGE="$TALOS_QEMU_ROOT/rootfs.qcow2"
 | 
						|
ISO="$TALOS_QEMU_ROOT/iso/config.iso"
 | 
						|
 | 
						|
talosctl gen config -o ${TALOS_QEMU_ROOT}/iso qemu https://10.254.0.10
 | 
						|
cp ${TALOS_QEMU_ROOT}/iso/init.yaml ${TALOS_QEMU_ROOT}/iso/config.yaml
 | 
						|
mkisofs -joliet -rock -volid 'metal-iso' -output ${ISO} ${TALOS_QEMU_ROOT}/iso
 | 
						|
qemu-img create -f qcow2 ${IMAGE} 8G
 | 
						|
 | 
						|
qemu-system-x86_64 \
 | 
						|
    -m 2048 \
 | 
						|
    -accel ${ACCEL} \
 | 
						|
    -cpu max \
 | 
						|
    -smp 2 \
 | 
						|
    -hda ${IMAGE} \
 | 
						|
    -netdev user,id=talos,ipv4=on,net=10.254.0.0/24,dhcpstart=10.254.0.10,hostfwd=tcp::50000-:50000,hostfwd=tcp::6443-:6443,hostname=master-1 \
 | 
						|
    -device virtio-net,netdev=talos \
 | 
						|
    -nographic \
 | 
						|
    -serial mon:stdio \
 | 
						|
    -cdrom ${ISO} \
 | 
						|
    -append "talos.platform=metal init_on_alloc=1 slab_nomerge pti=on printk.devkmsg=on earlyprintk=serial,tty0,keep console=tty0 talos.config=metal-iso" \
 | 
						|
    -kernel ${KERNEL} \
 | 
						|
    -initrd ${INITRD}
 |