changeset 317:90c5fff61c7b

Teach package script to recreate mini-native tarball if it changed.
author Rob Landley <rob@landley.net>
date Tue, 08 Apr 2008 23:56:19 -0500
parents 713a53bce9a6
children b3cf2e4b74f0
files package-mini-native.sh
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/package-mini-native.sh	Fri Apr 04 09:31:33 2008 -0500
+++ b/package-mini-native.sh	Tue Apr 08 23:56:19 2008 -0500
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # Create an ext2 root filesystem image
+# User User Mode Linux to package this, until toybox mke2fs is ready.
 
 source include.sh
 
@@ -15,10 +16,21 @@
 dd if=/dev/zero of="$IMAGE" bs=1024 seek=$[64*1024-1] count=1 &&
 /sbin/mke2fs -b 1024 -F "$IMAGE" &&
 
-# User User Mode Linux to package this, until toybox mke2fs is ready.
+# Recreate tarball if changed.  We need to use tarball produced outside of
+# UML because hostfs doesn't detect hard links, which wastes space in the
+# resulting filesystem.
+
+cd "$BUILD" || dienow
+if [ ! -z "$(find "mini-native-${ARCH}" -newer "mini-native-${ARCH}.tar.bz2")" ]
+then
+  echo -n updating mini-native-"${ARCH}".tar.bz2 &&
+  { tar cjvf "mini-native-${ARCH}.tar.bz2" "mini-native-${ARCH}" || dienow
+  } | dotprogress
+fi
 
 # Write out a script to control user mode linux
 TARDEST="mini-native-$ARCH"
+tar c
 cat > "${WORK}/uml-package.sh" << EOF &&
 #!/bin/sh
 mount -n -t ramfs /dev /dev