0%

IPXE编译(Ubuntu 22.04)

apt install gcc binutils make perl liblzma-dev mtools mkisofs syslinux
git clone git://git.ipxe.org/ipxe.git
cd ipxe/src
cat << EOF > script.ipxe
#!ipxe
dhcp
chain --autofree tftp://\${next-server}/boot.ipxe
#chain --autofree https://boot.netboot.xyz
EOF
  • UEFI
    git checkout config/general.h
    sed -i 's|#undef.*\(DOWNLOAD_PROTO_HTTPS\)|#define \1|' config/general.h
    make bin-x86_64-efi/ipxe.efi EMBED=script.ipxe
    
  • BIOS
    git checkout config/general.h
    sed -i 's|#undef.*\(DOWNLOAD_PROTO_HTTPS\)|#define \1|' config/general.h
    sed -i 's|\/\/#define.*\(IMAGE_COMBOOT\)|#define \1|' config/general.h
    make bin/undionly.kpxe EMBED=script.ipxe
    

windows powershell执行

Install-Module -Name VMware.PowerCLI -RequiredVersion 12.0.0.15947286
Set-ExecutionPolicy RemoteSigned

脚本导入

.\ESXi-Customizer-PS.ps1 -izip .\VMware-ESXi-7.0U3d-19482537-depot.zip -pkgDir .\pkg\

跳过TPM检查

# install shift+F10
REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1
REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1
# skip microsoft login
# username: no@thanks.com
# password: nothanks

RDM硬盘直通{0} 硬盘挂载地址, {1} 生成目标映射地址

vmkfstools -z /vmfs/devices/disks/t10.ATA_____xxxxxxxxxxxxxxxxxxxx /vmfs/volumes/datastore/disk0.vmdk
vmkfstools -z /vmfs/devices/disks/t10.ATA_____yyyyyyyyyyyyyyyyyyyy /vmfs/volumes/datastore/disk1.vmdk

直通usb键鼠

# list usb device
lsusb
# vi /etc/vmware/config
usb.generic.allowHID = "TRUE"
usb.quirks.device0 = "0x1bcf:0x08b8 allow"
usb.quirks.device1 = "0x04d9:0x1702 allow"

# vi /bootbank/boot.cfg
CONFIG./USB/quirks=0x1bcf:0x08b8::0xffff:UQ_KBD_IGNORE:0x04d9:0x1702::0xffff:UQ_KBD_IGNORE

设置仓库

Settings -> Actions -> Runners -> New self-hosted runner

  • Runner image: Linux
  • Architecture: x64

Register Runner

./config.sh --name <name> --url <repo_url> --token <token>
## 后台运行并输出日志到run.log
./run.sh > run.log 2>&1 &

测试Github workflow

  • 创建.github/workflows/ci.yaml
  • 注: runs-on: self-hosted
name: ci on self-hosted runners

on:
  workflow_dispatch:

defaults:
  run:
    shell: bash

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: hello world
        run: echo "hello"

Overlay 扩容

mnt <device> <dir>
tar -C /overlay -cvf - . | tar -C <dir> -xf -

常见问题

  • cron.err xxxxxx 意为cron执行过任务,不是任务内部出错

内核启动;串口进入U-Boot

setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.2
ping 192.168.1.2

tftpboot 0x46000000 kernel.bin
bootm 0x46000000