A simple, zero-configuration script to quickly boot FreeBSD ISO images using QEMU

Enhance README with customizable VM options and command-line usage examples

+90 -8
+90 -8
README.md
··· 21 21 guest:22) 22 22 - ๐Ÿ’พ **Smart caching**: Automatically skips re-downloading existing ISO files 23 23 - ๐Ÿ†˜ **Help support**: Built-in help with `--help` or `-h` flags 24 + - โš™๏ธ **Configurable VM options**: Customize CPU type and memory allocation 25 + - ๐Ÿ“ **Enhanced CLI**: Powered by [Cliffy](http://cliffy.io/) for robust 26 + command-line parsing 24 27 25 28 ## ๐Ÿ“‹ Prerequisites 26 29 ··· 89 92 ./main.ts /path/to/your/freebsd.iso 90 93 ``` 91 94 95 + ### Customize VM Configuration 96 + 97 + Specify custom CPU type and memory allocation: 98 + 99 + ```bash 100 + # Custom CPU and memory 101 + ./main.ts --cpu host --memory 4G 14.3-RELEASE 102 + 103 + # Download to specific location 104 + ./main.ts --output ./downloads/freebsd.iso 15.0-BETA3 105 + 106 + # Combine options 107 + ./main.ts --cpu qemu64 --memory 1G --output ./my-freebsd.iso 108 + ``` 109 + 92 110 ### Get Help 93 111 94 112 ```bash ··· 105 123 deno run --allow-run --allow-read --allow-env main.ts [options] 106 124 ``` 107 125 126 + ## ๐Ÿ”ง Command Line Options 127 + 128 + FreeBSD-Up supports several command-line options for customization: 129 + 130 + - `-c, --cpu <type>` - CPU type to emulate (default: `host`) 131 + - `-m, --memory <size>` - Amount of memory for the VM (default: `2G`) 132 + - `-o, --output <path>` - Output path for downloaded ISO files 133 + - `-h, --help` - Show help information 134 + - `-V, --version` - Show version information 135 + 136 + ### Examples 137 + 138 + ```bash 139 + # Use different CPU type 140 + ./main.ts --cpu qemu64 14.3-RELEASE 141 + 142 + # Allocate more memory 143 + ./main.ts --memory 4G 15.0-BETA3 144 + 145 + # Save ISO to specific location 146 + ./main.ts --output ./isos/freebsd.iso https://example.com/freebsd.iso 147 + 148 + # Combine multiple options 149 + ./main.ts --cpu host --memory 8G --output ./downloads/ 14.3-RELEASE 150 + ``` 151 + 108 152 ## ๐Ÿ–ฅ๏ธ Console Setup 109 153 110 154 When FreeBSD boots, you'll see the boot menu. For the best experience with the ··· 121 165 122 166 ## โš™๏ธ VM Configuration 123 167 124 - The script creates a VM with the following specifications: 168 + The script creates a VM with the following default specifications: 125 169 126 - - **CPU**: Host CPU with KVM acceleration 127 - - **Memory**: 2GB RAM 170 + - **CPU**: Host CPU with KVM acceleration (configurable with `--cpu`) 171 + - **Memory**: 2GB RAM (configurable with `--memory`) 128 172 - **Cores**: 2 virtual CPUs 129 173 - **Network**: User mode networking with SSH forwarding 130 174 - **Console**: Enhanced serial console via stdio with proper signal handling 131 175 - **Default Version**: FreeBSD 14.3-RELEASE (when no arguments provided) 132 176 177 + ### Available CPU Types 178 + 179 + Common CPU types you can specify with `--cpu`: 180 + 181 + - `host` (default) - Use host CPU features for best performance 182 + - `qemu64` - Generic 64-bit CPU for maximum compatibility 183 + - `Broadwell` - Intel Broadwell CPU 184 + - `Skylake-Client` - Intel Skylake CPU 185 + - `max` - Enable all supported CPU features 186 + 133 187 ## ๐Ÿ”ง Customization 134 188 135 - To modify VM settings, edit the QEMU arguments in `main.ts`: 189 + ### Modifying VM Settings via Command Line 190 + 191 + The easiest way to customize VM settings is through command-line options: 192 + 193 + ```bash 194 + # Increase memory to 4GB 195 + ./main.ts --memory 4G 196 + 197 + # Use a different CPU type 198 + ./main.ts --cpu qemu64 199 + 200 + # Combine options 201 + ./main.ts --cpu host --memory 8G 14.3-RELEASE 202 + ``` 203 + 204 + ### Advanced Customization 205 + 206 + To modify other VM settings, edit the QEMU arguments in the `runQemu` function 207 + in `main.ts`: 136 208 137 209 ```typescript 138 210 const cmd = new Deno.Command("qemu-system-x86_64", { 139 211 args: [ 140 212 "-enable-kvm", 141 213 "-cpu", 142 - "host", 214 + options.cpu, 143 215 "-m", 144 - "2G", // Change memory 216 + options.memory, 145 217 "-smp", 146 218 "2", // Change CPU cores 147 219 "-chardev", ··· 170 242 171 243 ``` 172 244 freebsd-up/ 173 - โ”œโ”€โ”€ main.ts # Main script 174 - โ”œโ”€โ”€ deno.json # Deno configuration 245 + โ”œโ”€โ”€ main.ts # Main script with Cliffy CLI integration 246 + โ”œโ”€โ”€ deno.json # Deno configuration with dependencies 247 + โ”œโ”€โ”€ deno.lock # Dependency lock file 175 248 โ””โ”€โ”€ README.md # This file 176 249 ``` 250 + 251 + ### Dependencies 252 + 253 + The project uses the following key dependencies: 254 + 255 + - **[@cliffy/command](https://jsr.io/@cliffy/command)** - Modern command-line 256 + argument parsing 257 + - **[chalk](https://www.npmjs.com/package/chalk)** - Terminal styling and colors 177 258 178 259 ## ๐Ÿค Contributing 179 260 ··· 193 274 - [FreeBSD Downloads](https://www.freebsd.org/where/) 194 275 - [QEMU Documentation](https://www.qemu.org/docs/master/) 195 276 - [Deno Manual](https://docs.deno.com/runtime/) 277 + - [Cliffy Command Documentation](https://cliffy.io/docs@v1.0.0-rc.8/command/) 196 278 197 279 --- 198 280