Cross Rootfs on Git

Nice idea to use put rootfs in Git

  1. init git rootfs
    cd /usr/armv4tl-softfloat-linux-gnueabi
    git init
    
  2. .gitignore
    var/cache/edb/counter
    var/cache/edb/vdb_blockers.pickle
    var/cache/edb/vdb_metadata.pickle
    var/db/.pkg.portage_lockfile
    var/cache/ldconfig/aux-cache
    
  3. adding hack for committing every package to git during emerge, etc/portage/bashrc
    if [[ $EBUILD_PHASE == "clean" ]]; then
            cd ${ROOT} && git add . && git commit -a -m "=${CATEGORY}/${PF}";
    fi
    
  4. git usage
    1. man git
    2. GUI: git gui , gitk --all
  5. workflows
    1. Now you can easy return back to any git status.
    2. Create branches/tags, allowing you fix errors via ugly hacks, and then return and fix them correctly.
    3. Your...

Cross Rootfs on Git (Method 2)

I use the following to place my $ROOT under git control, it's slightly modified.

  1. init git rootfs
    cd /usr/armv4tl-softfloat-linux-gnueabi
    git init
    
  2. .gitignore
    var/cache/edb/counter
    var/cache/edb/vdb_blockers.pickle
    var/cache/edb/vdb_metadata.pickle
    var/db/.pkg.portage_lockfile
    var/cache/ldconfig/aux-cache
    tmp/*
    
  3. adding hack for committing every package to git during emerge, etc/portage/bashrc (This also executes cross_fix_root and etc-update prior to add/commit)
    if [[ $EBUILD_PHASE == "postinst" ]]; then
    	# This is the cross-fix-root from http://gentoo.mindzoo.de
    	[[ $EMERGE_FROM != binary ]] && cross_fix_root ${CHOST}
    	# This ensures that etc-update is handled before we do git commits
    	ROOT=${ROOT} etc-update
    
    	# This removes the /usr/share/gtk-doc directory
    	rm -rf ${ROOT}/usr/share/gtk-doc
    
    	# This commits newly installed packages to git for tracking
    	cd ${ROOT} && git add . && git commit -a -m "=${CATEGORY}/${PF}, `date`";
    fi
    

The modified version above does the submit only during portinst, executing during clean stage had the add and commit being run twice in most packages, and was resulting in a very large git archive.