Skip to content
Browse files
make fixup-fs idempotent
I had tested repacking a -lxc.tar.gz file, and found that it would
fail because fixup-fs didn't work on an already fix'd up image.

This should change it to be idempotent.

This means that you can now do something like:

sudo ./bin/bundle download/lxc-amd64.tar download/kernel-amd64.deb \

And that will excercise the bundle stage, effectively using the lxc tarball
as if it were the 'root.tar' file that buildroot would produce.
  • Loading branch information
smoser committed Jan 14, 2013
1 parent 324ce27 commit 8df5589e81ea7fdc2570502b7ee2cf2110c82ab6
Showing 1 changed file with 18 additions and 4 deletions.
@@ -12,14 +12,28 @@ rm -f "$rootd/usr/sbin/visudo"

# buildroot symlinks stuff in /var to /tmp
links="lib/pcmcia pcmcia lock cache log spool pcmcia"
( cd "$rootd/var" && rm -f $links && mkdir -p $links ) ||
fail "failed to remove links in /var"
for f in $links; do
if [ -L "$rootd/$p" ]; then
rm "$rootd/$p" ||
fail "failed to remove file $p"
elif [ -d "$rootd/$p" ]; then
rmdir "$rootd/$p" ||
fail "rmdir $p failed"
[ -e "$rootd/$p" ] &&
fail "don't know what to do with $p. not dir or link"
mkdir -p $rootd/var
( cd "$rootd/var" && mkdir -p $links ) ||
fail "failed to create directories in /var"

( cd "$rootd/var" && rm -f tmp run &&
( cd "$rootd/var" && rm -Rf tmp run &&
ln -s ../run run && ln -s ../run/var.tmp tmp ) ||
fail "failed to make var/run and var/tmp"

rm $rootd/etc/resolv.conf &&
rm -f $rootd/etc/resolv.conf &&
ln -sf ../run/resolv.conf "$rootd/etc/resolv.conf" ||
fail "failed to create resolv.conf symlink"

0 comments on commit 8df5589

Please sign in to comment.