summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-06 08:57:25 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-06 08:57:25 +0000
commit2d0758cfdf0f03d52dff5817b1d96b2b0e1e423a (patch)
treedc705b6505071983cf25dbb6b776b673727fa0b8
parent03f985441c601cf8e63df6b3f4bc56533db451a3 (diff)
downloadabuild-2d0758cfdf0f03d52dff5817b1d96b2b0e1e423a.tar.gz
abuild-2d0758cfdf0f03d52dff5817b1d96b2b0e1e423a.tar.bz2
abuild-2d0758cfdf0f03d52dff5817b1d96b2b0e1e423a.tar.xz
abuild-2d0758cfdf0f03d52dff5817b1d96b2b0e1e423a.zip
mkiso: check timestamps on initramfs and modloop
this avoids rebuilding those unless its needed
-rw-r--r--mkiso23
1 files changed, 19 insertions, 4 deletions
diff --git a/mkiso b/mkiso
index 7d83d2b..9c4684e 100644
--- a/mkiso
+++ b/mkiso
@@ -4,6 +4,9 @@ tmp=$PWD/tmp
aports=$PWD/../aports
target=alpine-test.iso
+initramfs=test.gz
+modloop=modloop.cmg
+
unapk() {
local dest="$1"
shift
@@ -14,6 +17,11 @@ unapk() {
rm -f "$dest/.PKGINFO"
}
+link_or_copy() {
+ ln -f "$1" "$2" 2>/dev/null || cp "$1" "$2"
+}
+
+
rm -r $tmp
mkdir -p $tmp/apks $tmp/isolinux
cp /usr/share/syslinux/isolinux.* $tmp/isolinux
@@ -32,13 +40,20 @@ EOF
unapk $tmp $aports/core/linux-grsec/linux-grsec-[0-9]*.apk
-sh mkinitram
-sh mkmodloop
+# only build initram if its missing or script is newer than target
+if [ ! -f "$initramfs" ] || [ mkinitram -nt "$initramfs" ]; then
+ sh mkinitram
+fi
+
+if [ ! -f "$modloop" ] || [ mkmodloop -nt "$modloop" ]; then
+ sh mkmodloop
+fi
mkdir -p $tmp/boot/
-cp test.gz $tmp/boot/
-cp modloop.cmg $tmp/boot/
+link_or_copy test.gz $tmp/boot/
+link_or_copy modloop.cmg $tmp/boot/
+echo "==> Creating ISO image"
genisoimage -o $target -l -J -R \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \