11.4Smaya# $NetBSD: rc.conf.emuimage,v 1.4 2024/04/16 16:13:44 maya Exp $ 21.1Sjmcneill 31.1Sjmcneillis_ec2() { 41.1Sjmcneill val=NO 51.1Sjmcneill # Look for the string "amazon" in one of these sysctl nodes 61.1Sjmcneill for node in machdep.dmi.system-vendor \ 71.1Sjmcneill machdep.dmi.system-version \ 81.1Sjmcneill machdep.dmi.bios-version \ 91.2Shgutch machdep.dmi.system-product \ 101.1Sjmcneill machdep.xen.version ; do 111.1Sjmcneill if /sbin/sysctl -q $node; then 121.1Sjmcneill nodeval="$(/sbin/sysctl -n $node | tr '[A-Z]' '[a-z]')" 131.1Sjmcneill case "$nodeval" in 141.1Sjmcneill *amazon*) 151.1Sjmcneill val=YES 161.1Sjmcneill ;; 171.1Sjmcneill # OpenStack is not EC2 but it does have a metadata service. 181.1Sjmcneill *openstack*) 191.1Sjmcneill val=YES 201.1Sjmcneill ;; 211.1Sjmcneill esac 221.1Sjmcneill fi 231.1Sjmcneill done 241.1Sjmcneill printf $val 251.1Sjmcneill} 261.1Sjmcneill 271.3Sriastradcertctl_init=YES 281.4Smayaresize_gpt=YES 291.1Sjmcneillresize_root=YES 301.1Sjmcneillresize_root_flags="-p" 311.1Sjmcneillresize_root_postcmd="/sbin/reboot -n" 321.1Sjmcneilldhcpcd=YES 331.1Sjmcneillsshd=YES 341.1Sjmcneillec2_init=$(is_ec2) 351.1Sjmcneill 361.1Sjmcneillif checkyesno ec2_init; then 371.1Sjmcneill dhcpcd_flags="$dhcpcd_flags -w" 381.1Sjmcneillfi 39