Basil,
You can perform any post-setup steps you like using the Configure:commands and Configure:scripts sections in the yaml file for your root filesystem.
In the case of the commands section it just runs the command you specify. You can refer to the root filesystem directory as $(__rfs__)s in your command.
For example, if you added python-pip as a debian package and then wanted to run a pip install command you would add the following under Configure:
- 'sudo chroot %(__rfs__)s pip install python-iptables'
For your particular use case you will run into other issues which will also need to be resolved or accepted:
1. The chroot into the root filesystem does not have a resolv.conf at the time your command is executed so pip transactions (really general network transactions) won't be successful. You can probably fix this by added a 'sudo cp /etc/resolv.conf %(__rfs__)s/etc/' command before the pip command.
2. PIP install will likely need to compile things within the chroot and those dependencies will get added to the packages installed in the RFS. If you don't want these in the final image you will want to clean it up afterwards.
If the commands you need to execute get too complicated you can put them all in a script and execute that instead by adding to the scripts section:
scripts:
- myscript.py
The script is executed under sudo and the first and only argument is the root filesystem directory. From there you can do as much or as little as you want.
I'd be happy to help your further once you try these out.
Jeff