Combining "balena os configure" arguments

Hi,

I’m flashing Raspberry Pi CM4s with balena OS. I have it setup such that the device is first registered in balenaCloud. I take the device UUID (used for later reference in our db) and then use the same UUID to flash it. I prepare the image before flashing with balena os configure --device <uuid>

But now I want to combine this with a premade config.json containing udev rules. To my surprise if I use balena os configure --device <uuid> --config config.json, the final image does not contain the pregenerated UUID anymore and when the device comes online it gets assigned a new UUID automatically.

Is this intended behavior? And if so, is there another way to inject both the udev rules and a device UUID into the image?

Hello @bartvanderhoeven12

How do you generate the config.json? Effectively the config.json file has a uuid of its own (with associated device api key, so it can’t be simply overriden). If you are generating the config file with balena config generate I would reccomend you pass the device uuid there

1 Like

Hi,

Right now I used a pregenerated config.json from balenaCloud (and then inserted custom key/value pairs with jq on CLI). But now I see you mention balena config generate (and I suppose I would use balena config write to write the udev rules into the config file). I must have looked over these commands, this seems to be what I was looking for.

Thanks a lot!

1 Like