From 481e8cc648f8572cdf12491f12dc5266bac07275 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@delfi.ee>
Date: Sat, 23 Mar 2013 20:06:40 +0200
Subject: [PATCH 1/4] changes to be able to get *working* isolinux result

do not remove tarball until build has finished, as the build process is
fragile and dependencies that are needed are listed nowhere, meaning i
have to download several times as appeared some tool or header was
missing

ignoring and hiding errors is bad and evil, instead stop on errors so
user can see error and try to fix it

additionally fill out requirements in comment. really should test for
program existence or headers to be very nice with it
---
 tools/isolinux.bin.update | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/isolinux.bin.update b/tools/isolinux.bin.update
index 025ef1a..b395f61 100755
--- a/tools/isolinux.bin.update
+++ b/tools/isolinux.bin.update
@@ -2,6 +2,9 @@
 
 # This script will update the file ../bootfiles/isolinux.bin to match
 # your LiveKit name used in ../.config
+# Requires: wget, tar, gzip, make, gcc, nasm, perl, glibc-devel, libuuid-devel (e2fsprogs)
+
+set -e
 
 PKG=syslinux-4.06
 PKGTGZ=$PKG.tar.gz
@@ -10,20 +13,23 @@ DL="http://www.kernel.org/pub/linux/utils/boot/syslinux/$PKGTGZ"
 . ../.config
 
 # download, unpack, and patch syslinux
-wget -c "$DL"
-tar -xf $PKGTGZ
-rm $PKGTGZ
+if [ ! -d $PKG ]; then
+	rm -rf $PKG
+	wget -c "$DL"
+	tar -xf $PKGTGZ
+fi
 
 cd $PKG
 
 sed -i -r "s:/boot/syslinux:/$LIVEKITNAME/boot:" core/fs/iso9660/iso9660.c
 sed -i -r "s:/boot/syslinux:/$LIVEKITNAME/boot:" core/fs/lib/loadconfig.c
 
-make -i
-cp core/isolinux.bin ../../bootfiles/isolinux.bin
+make
+cp -p core/isolinux.bin ../../bootfiles/isolinux.bin
 
 echo
 echo "Copying isolinux.bin to $(realpath ../../bootfiles/isolinux.bin)"
 
 cd ..
 rm -Rf $PKG
+rm $PKGTGZ
-- 
1.8.1.5


From 0d23cf0cce16f0581ccc0569f07e1580ce676951 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@delfi.ee>
Date: Mon, 25 Mar 2013 08:57:13 +0200
Subject: [PATCH 2/4] pass CC to make if set

---
 tools/isolinux.bin.update | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/isolinux.bin.update b/tools/isolinux.bin.update
index b395f61..1f2e1c6 100755
--- a/tools/isolinux.bin.update
+++ b/tools/isolinux.bin.update
@@ -24,7 +24,9 @@ cd $PKG
 sed -i -r "s:/boot/syslinux:/$LIVEKITNAME/boot:" core/fs/iso9660/iso9660.c
 sed -i -r "s:/boot/syslinux:/$LIVEKITNAME/boot:" core/fs/lib/loadconfig.c
 
-make
+make \
+	${CC:+CC="$CC"}
+
 cp -p core/isolinux.bin ../../bootfiles/isolinux.bin
 
 echo
-- 
1.8.1.5


From aea9727f0f69d57e67a83bfcef60ed32d963d7c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@delfi.ee>
Date: Mon, 25 Mar 2013 09:01:16 +0200
Subject: [PATCH 3/4] rm -f tarball.

it may not be there if the unpacked source was organized there some
other ways than wget (builder)
---
 tools/isolinux.bin.update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/isolinux.bin.update b/tools/isolinux.bin.update
index 1f2e1c6..502fac3 100755
--- a/tools/isolinux.bin.update
+++ b/tools/isolinux.bin.update
@@ -34,4 +34,4 @@ echo "Copying isolinux.bin to $(realpath ../../bootfiles/isolinux.bin)"
 
 cd ..
 rm -Rf $PKG
-rm $PKGTGZ
+rm -f $PKGTGZ
-- 
1.8.1.5


From 54dd0a7eb6a8852eeeb2bdb2a0720b91c6baf31f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@delfi.ee>
Date: Mon, 25 Mar 2013 09:04:49 +0200
Subject: [PATCH 4/4] http://kernel.org redirects to https://

workaround for uninstalled certs, add --no-check-certificate parameter
---
 tools/isolinux.bin.update | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/isolinux.bin.update b/tools/isolinux.bin.update
index 502fac3..39ee218 100755
--- a/tools/isolinux.bin.update
+++ b/tools/isolinux.bin.update
@@ -15,7 +15,7 @@ DL="http://www.kernel.org/pub/linux/utils/boot/syslinux/$PKGTGZ"
 # download, unpack, and patch syslinux
 if [ ! -d $PKG ]; then
 	rm -rf $PKG
-	wget -c "$DL"
+	wget --no-check-certificate -c "$DL"
 	tar -xf $PKGTGZ
 fi
 
-- 
1.8.1.5

