Metadata-Version: 2.4
Name: pxectl
Version: 0.3.0
Summary: An iPXE script generator.
Author: tunafysh
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click
Requires-Dist: colorama>=0.4.6
Requires-Dist: pyyaml

# pxectl

An iPXE script generator for managing PXE boot entries.

`pxectl` reads a simple YAML configuration file and generates iPXE boot scripts for Linux, Windows, EFI applications, and disk images.

## Features

* YAML-based configuration
* Generate iPXE scripts automatically
* Support for:
  * Linux kernel/initrd boot
  * Windows boot using wimboot
  * EFI applications
  * Disk images
* Configuration validation
* Simple Click-based CLI
* Designed for Linux PXE environments

## Requirements

* Linux
* Python 3.10+
* Root privileges for system operations

## Installation

### Using pipx

```bash
pipx install pxectl
```

### From source

```bash
git clone https://github.com/tunafysh/pxectl.git
cd pxectl

pipx install .
```

## Usage

Initialize a configuration:

```bash
sudo pxectl init
```

This creates:

```text
/etc/pxectl/config.yml
```

Validate the configuration:

```bash
pxectl validate
```

Generate the iPXE script:

```bash
sudo pxectl generate
```

The generated script will be placed in your configured PXE root.

## Configuration

Example configuration:

```yaml
# pxectl configuration

dhcp_enable: false
root: /srv/tftp

entries:
  - name: Ubuntu
    id: ubuntu
    type: linux
    kernel: images/ubuntu/vmlinuz
    initrd: images/ubuntu/initrd.img
    cmdline: "root=/dev/ram0"

  - name: Windows
    id: windows
    type: windows
    root: images/windows
    boot_wim: boot.wim

  - name: UEFI Shell
    id: shell
    type: efi
    path: efi/shell.efi
```

## Supported Entry Types

### Linux

Boots a Linux kernel and initrd:

```yaml
- name: Ubuntu
  id: ubuntu
  type: linux
  kernel: images/ubuntu/vmlinuz
  initrd: images/ubuntu/initrd.img
  cmdline: "root=/dev/ram0"
```

### Windows

Uses `wimboot` to start Windows PE:

```yaml
- name: Windows
  id: windows
  type: windows
  root: images/windows
  boot_wim: boot.wim
```

### EFI

Chains an EFI executable:

```yaml
- name: UEFI Shell
  id: shell
  type: efi
  path: efi/shell.efi
```

## Directory Layout Example

A typical PXE root:

```text
/srv/tftp/
├── boot.ipxe
├── images/
│   ├── ubuntu/
│   │   ├── vmlinuz
│   │   └── initrd.img
│   └── windows/
│       └── boot.wim
└── efi/
    └── shell.efi
```

## Design Goals

`pxectl` focuses on generating PXE boot configuration rather than managing the entire PXE environment.

It does not provide:

* DHCP server management
* TFTP server management
* Network configuration

Instead, it integrates with existing PXE infrastructure by generating the required boot files.

## License

No specific license, free to use.
