New apt2sfs attached, which has a very different approach.
Instead of creating module from downloaded/extracted packages, the packages will be installed and afterwards uninstalled.
It depends on a very small package 'inotify-tools'.
Some info about how it works:
Using inotifywait, the added or created files in /live/cow during apt-get installing, are listed in /tmp/instfiles.
Filtering /var directory out (so /var won't be copied) to /tmp/newfiles
Copying files (read from /tmp/newfiles) to the working directory.
Then the part that I most struggled with: Uninstalling exactly what was previously installed.
I may have overlooked something but I thought doing this should do it right:
Code: Select all
apt-get install <package1> <package2>
apt-get purge <package1> <package2> # purge exactly the same packages as just installed
apt-get autoremove
If anyone knows a better way please say, but I finally I used in the script this dirty trick:
Code: Select all
rm -f /var/log/dpkg.log # Start fresh logging
apt-get install <package1> <package2>
PURGE=`cat /var/log/dpkg.log |grep ' unpacked ' |cut -d\ -f5 |cut -d: -f1 |sort |uniq` # read most recent from dpkg.log
apt-get purge $PURGE # purge all previously installed packages
This should work better because the packages are 'really' installed.
For example creating a sfs for 'bleachbit' didn't work with previous apt2sfs, now it does
Fred