This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_vbox() { | |
pushd "$HOME/src/forked/ipxe/src" >/dev/null && | |
#make bin/intel--virtio-net--pcnet32.dsk EMBED=../nic-menu.ipxe && | |
make CONFIG=vbox bin/intel--virtio-net--pcnet32.isarom && #EMBED=config/vbox/embedded.ipxe && | |
#perl util/padimg.pl --verbose --blksize 4096 bin/intel--virtio-net--pcnet32.isarom && | |
echo "Max size of VirtualBox ROM is 56KB, 57344 bytes" && | |
ls -l bin/intel--virtio-net--pcnet32.isarom && | |
prefix=$(date +%Y%m%d-%H%M%S) && | |
mkdir -p /ipxe/$prefix && | |
cp -v bin/intel--virtio-net--pcnet32.isarom /ipxe/$prefix/ && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only supported on Ubuntu 18.04 and newer | |
{% if grains.osmajorrelease >= 18 %} | |
userns.uidmap: | |
file.touch: | |
- name: /etc/subuid | |
- unless: test -f /etc/subuid | |
userns.gidmap: | |
file.touch: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Chipcard::PCSC; | |
use Data::Dumper qw(Dumper); | |
use HTTP::Tiny (); | |
my $http = HTTP::Tiny->new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File /config/network/my-network in hassos-boot partition | |
[connection] | |
id=my-network | |
# Must be unique | |
uuid=YOUR_UUID_NUMBER | |
type=802-11-wireless | |
[802-11-wireless] | |
mode=infrastructure | |
ssid=YOUR_WIFI_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In VirtualBox | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT13 drive 81 contains an ISO9660 filesystem; treating as CD-ROM | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT13 drive 81 has an El Torito boot catalog at LBA 00000014 | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT13 drive 81 (naturally 80) registered with C/H/S geometry 0/0/0 | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT13 drive 81 added to drive count: 2 HDDs, 1 FDDs | |
Mar 30 16:55:42 10.1.1.109 ipxe: Registered SAN device 0x81 | |
Mar 30 16:55:42 10.1.1.109 ipxe: Booting from SAN device 0x81 | |
Mar 30 16:55:42 10.1.1.109 ipxe: | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT 13 drive 81 invalid blocksize (2048) for non-extended read/write | |
Mar 30 16:55:42 10.1.1.109 ipxe: INT13,02 (81) failed with status 01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /sys/kernel/config/target/iscsi | |
#### iSCSI Discovery authentication information | |
echo -n 0 > /sys/kernel/config/target/iscsi/discovery_auth/enforce_discovery_auth | |
#### Network portals for iSCSI Target Portal Group | |
mkdir -p /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/np/10.1.1.10:3260 | |
#### iSCSI Target Ports | |
mkdir -p /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0 | |
ln -s /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0/../../../../../../target/core/iblock_7/testvm.boot.ubuntu /sys/kernel/config/target/iscsi/iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu/tpgt_1/lun/lun_0/0acc9b6c97 | |
lio_node --aluasecmd iqn.2011-02.lan.smidsrod:testvm.boot.ubuntu 1 0 | |
#### Attributes for iSCSI Target Portal Group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Figure out path to plink.exe | |
set putty_dir_key="HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1" | |
for /f "tokens=3*" %%x in ('reg query %putty_dir_key% /v "InstallLocation"') do set putty_dir=%%x %%y | |
if not defined putty_dir ( | |
echo Please install PuTTY using Windows installer from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | |
exit /b 1 | |
) | |
set plink="%putty_dir%\plink.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
echo | |
echo Booting FreeDOS installer for ${hostname} from SAN | |
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.freedos | |
sanhook ${root-path} || goto failed | |
sanboot -d 0x81 http://boot.smidsrod.lan/freedos-1.0/fdfullcd.iso || goto failed | |
:failed | |
echo Boot from ${root-path} failed, dropping to shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ipxe | |
echo | |
echo Starting Ubuntu 10.04.4 x64 installer for ${hostname} | |
# Hook SAN disk | |
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.ubuntu | |
sanhook ${root-path} || | |
# Start debian-installer | |
set base-url http://boot.smidsrod.lan/ubuntu-10.04.4-amd64-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $1 is a decimal number between 0-255 | |
dec2bin () { | |
[ -z "$1" ] && return | |
D2B=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}) | |
echo ${D2B[$1]} | |
} | |
# $1 is ip address (dotted quad) | |
# $2 is netmask (dotted quad) | |
calc_network () { |