Now you can use the script to convert an ISO image to a FAT32 image:./iso_to_fat32.sh input.iso output.img
Please note that this script requires sudo privileges to mount and unmount the images. Also, ensure that you have the dosfstools package installed on your system to use the mkfs.fat command. You can install it using:
sudo apt-get install dosfstools
To create a custom n8n.io node for generating an ISO image from a zip archive, you can follow these steps:
Install the required dependencies:
npm install --save n8n-core n8n-workflow
Create a new file called IsoImageFromZip.node.ts and add the following code:
import { IExecuteFunctions } from 'n8n-core';
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
import * as fs from 'fs';
import * as path from 'path';
import * as AdmZip from 'adm-zip';
import { exec } from 'child_process';
export class IsoImageFromZip implements INodeType {
description: INodeTypeDescription = {
displayName: 'ISO Image from Zip',
name: 'isoImageFromZip',
group: ['transform'],
version: 1,
description: 'Generate an ISO image from a zip archive',
defaults: {
name: 'ISO Image from Zip',
color: '#772244',
},
inputs: ['main'],
outputs: ['main'],
properties: [
{
displayName: 'Zip Archive Path',
name: 'zipArchivePath',
type: 'string',
default: '',
placeholder: '/path/to/your/zip-archive.zip',
description: 'Path to the zip archive file.',
required: true,
},
{
displayName: 'Output ISO Path',
name: 'outputIsoPath',
type: 'string',
default: '',
placeholder: '/path/to/your/output-image.iso',
description: 'Path to save the generated ISO image.',
required: true,
},
],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
for (let i = 0; i < items.length; i++) {
const zipArchivePath = this.getNodeParameter('zipArchivePath', i) as string;
const outputIsoPath = this.getNodeParameter('outputIsoPath', i) as string;
// Extract the zip archive to a temporary directory
const tempDir = fs.mkdtempSync(path.join(__dirname, 'isoImageFromZip-'));
const zip = new AdmZip(zipArchivePath);
zip.extractAllTo(tempDir, true);