IPXE 開發html
1: 上報安裝進度
curl http://localhost:8083/api/osinstall/v1/report/deviceInstallLog -X POST -d '{"Sn":"xxxxxxx","Title":"dwasd","InstallProgres":0.4}'
2: 生成MAC 文件
curl http://localhost:8083/api/osinstall/v1/device/createIpxeConfig -X POST -d '{"Sn":"xxxxxx","OsVersion":"bms_centos7.5-x86_64_Base"}'
3: 增長機器
curl http://localhost:8083/api/osinstall/v1/machine/newadd -X POST -d '{"Sn":"xxxxxx","Mac":"68:05:CA:A2:5F:B8,68:05:CA:A2:5F:B9"}'
4: 查詢機器
curl http://localhost:8083/api/osinstall/v1/machine/newlist -X POST -d '{"Sn":"xxxxxx"}'linux
1:數據庫維護,
2: ios
待定
5: 接收參數
curl http://100.71.70.47:8083/api/osinstall/v1/device/parameter -X POST -d '{"Sn":"xxxxxxx","IP":"192.168.3.10"}'數據庫
6: 生成OS配置文件centos
DROP TABLE IF EXISTS new_macs
;
CREATE TABLE new_macs
( id
int(11) unsigned NOT NULL AUTO_INCREMENT,created_at
timestamp NULL DEFAULT NULL,deleted_at
timestamp NULL DEFAULT NULL,updated_at
timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, sn
varchar(255) NOT NULL, mac
varchar(512) NOT NULL, status
varchar(255) NOT NULL, installProgres
float NULL, PRIMARY KEY (id
),UNIQUE KEY sn
(sn
)) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;api
insert INTO new_macs (created_at,updated_at,sn,mac,status,installProgres) values(NOW(),NOW(),"xxxxxxxx","68:05:CA:A2:5F:B8,68:05:CA:A2:5F:B9,68:05:CA:A2:6D:E8,68:05:CA:A2:6D:E9","stat",0);curl
insert INTO os_configs (id,created_at,updated_at,deleted_at,name,pxe) values("17",NOW(),NOW(),NULL,"bms_centos7.5-x86_64_Base","#!ipxe
kernel http://30.138.250.65/centos7.5/images/pxeboot/vmlinuz initrd=initrd.img ksdevice=bootif ks=http://30.138.250.65/centos7.5/ks.cfg console=tty0 selinux=0 net.ifnames=0 biosdevname=0
initrd http://30.138.250.65/centos7.5/images/pxeboot/initrd.img
boot
");ide
make bin-x86_64-efi/ipxe.efi EMBED=uefi.ipxe
#!ipxe
dhcp
chain pxelinux.cfg/01-${netX/mac:hexhyp}
#iset ${pxelinux.cfg/01-${netX/mac:hexhyp}} && chain ${pxelinux.cfg/01-${netX/mac:hexhyp}} || chain pxelinux.cfg/default_uefiurl
#!ipxe
kernel http://192.168.255.133/centos/7.5/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img ksdevice=bootif ks=http://192.168.255.133/centos/ks.cfg console=tty0 selinux=0 net.ifnames=0 biosdevname=0
initrd http://192.168.255.133/centos/7.5/os/x86_64/images/pxeboot/initrd.img
bootcentos7