[or-cvs] r18929: {torvm} Include kamikaze kernel and initramfs software license archi (in torvm/trunk: . build/kamikaze build/kamikaze/scripts build/win32 build/win32/files)

coderman at seul.org coderman at seul.org
Thu Mar 12 04:58:35 UTC 2009


Author: coderman
Date: 2009-03-12 00:58:35 -0400 (Thu, 12 Mar 2009)
New Revision: 18929

Added:
   torvm/trunk/build/kamikaze/scripts/
   torvm/trunk/build/kamikaze/scripts/genlicense.sh
Modified:
   torvm/trunk/Makefile
   torvm/trunk/build/win32/Makefile
   torvm/trunk/build/win32/files/buildall.sh
Log:
Include kamikaze kernel and initramfs software license archive for use in license.msi package.

Modified: torvm/trunk/Makefile
===================================================================
--- torvm/trunk/Makefile	2009-03-12 04:55:10 UTC (rev 18928)
+++ torvm/trunk/Makefile	2009-03-12 04:58:35 UTC (rev 18929)
@@ -44,7 +44,7 @@
 export WDLDIR
 export SDLDIR
 
-default all: prereq import buildtree buildkern buildw32
+default all: prereq import buildtree buildkern buildlicense buildw32
 
 #XXX move this into configure
 prereq: Makefile
@@ -145,6 +145,11 @@
 		exit 1; \
 	fi
 
+buildlicense: buildkern
+	@echo "Generating License and other legal documentation archive ..."; \
+	$(SHELL) build/kamikaze/scripts/genlicense.sh build/kamikaze/$(TGTNAME)/build_dir kernel-license-docs.tgz ; \
+	if [ -f kernel-license-docs.tgz ]; then mv kernel-license-docs.tgz build/kamikaze/; fi;
+
 # XXX: add instructions for automated win32 package builds with a vm using these hooks.
 # see https://data.peertech.org/torbld
 W32MK=WDLDIR=$(WDLDIR) all
@@ -161,7 +166,7 @@
   W32MK:=W32AUTO_BUILD_CMD="$(W32AUTO_BUILD_CMD)" $(W32MK)
 endif
 
-# NOTE: for now this is not dependent on buildkern though maybe it should be...
+# NOTE: for now this is not dependent on buildkern/buildlicense though maybe it should be...
 buildw32: 
 	@cd build/win32; \
 	chown -R $(BUSER):$(BGROUP) . ; \
@@ -171,5 +176,5 @@
 		exit 1; \
 	fi
 
-.PHONY: clean prereq import buildkern buildw32
+.PHONY: clean prereq import buildkern buildlicense buildw32
 

Added: torvm/trunk/build/kamikaze/scripts/genlicense.sh
===================================================================
--- torvm/trunk/build/kamikaze/scripts/genlicense.sh	                        (rev 0)
+++ torvm/trunk/build/kamikaze/scripts/genlicense.sh	2009-03-12 04:58:35 UTC (rev 18929)
@@ -0,0 +1,64 @@
+#!/bin/bash
+lf="target:busybox:LICENSE $lf"
+lf="target:openssl:LICENSE $lf"
+lf="target:e2fsprogs:COPYING $lf"
+lf="target:iproute2:COPYING $lf"
+lf="target:ncurses:README $lf"
+lf="target:util-linux-ng:COPYING $lf"
+lf="linux:linux:COPYING $lf"
+lf="linux:iptables:COPYING $lf"
+lf="linux:tor:LICENSE $lf"
+function usage () {
+  if (( $# )); then
+    echo "Error: $1" >&2
+  fi
+  echo 'Usage: genlicense.sh <kamikaze build dir> <license file tgz>' >&2
+  exit 1
+}
+function extractlicense () {
+  if (( $# != 5 )); then
+    echo "ERROR: extractlicense invalid args." >&2
+    return 1
+  fi
+  mysrcdir="$1"
+  mysrcsubdir="$2"
+  mysrcname="$3"
+  myfilename="$4"
+  mydestdir="$5"
+  cp ${mysrcdir}/${mysrcsubdir}*/${mysrcname}*/${myfilename} "${mydestdir}/${mysrcname}-${myfilename}.txt"
+  return $?
+}
+
+# start of script execution
+if (( $# != 2 )); then
+  usage
+fi
+dir="$1"
+docfile="$2"
+if [ ! -d "$dir" ]; then
+  usage "Directory $dir does not exist."
+fi
+tmpdir=_lictmp
+if [ -e $tmpdir ]; then
+  rm -rf $tmpdir >/dev/null 2>&1
+fi
+mkdir $tmpdir
+cp $dir/../LICENSE "${tmpdir}/OpenWRT-LICENSE.txt"
+for pair in $lf; do
+  sdir=${pair%%*:}
+  sdir=${sdir/:*/}
+  name=${pair#*:}
+  name=${name/:*/}
+  lfile=${pair##*:}
+  extractlicense $dir $sdir $name $lfile $tmpdir
+done
+(
+  cd $tmpdir
+  tar zcf ../$docfile .
+)
+rm -rf $tmpdir >/dev/null 2>&1
+if [ -f $docfile ]; then
+  ls -l $docfile
+  exit 0
+fi
+exit 1

Modified: torvm/trunk/build/win32/Makefile
===================================================================
--- torvm/trunk/build/win32/Makefile	2009-03-12 04:55:10 UTC (rev 18928)
+++ torvm/trunk/build/win32/Makefile	2009-03-12 04:58:35 UTC (rev 18929)
@@ -217,7 +217,7 @@
 VIDALIA_TGZ=$(VIDALIA_NAME).tar.gz
 VIDALIA_SVN=https://svn.vidalia-project.net/svn/vidalia/
 VIDALIA_BR=trunk
-VIDALIA_VER=3616
+VIDALIA_VER=3617
 
 # for package resources
 TORSVN_NAME=tor-latest
@@ -323,6 +323,9 @@
 	mkdir -p $(ISODIR)/dl/src; \
 	mkdir $(ISODIR)/bin; \
 	mkdir $(ISODIR)/add; \
+	if [ -e ../kamikaze/kernel-license-docs.tgz ]; then \
+		cp ../kamikaze/kernel-license-docs.tgz $(ISODIR)/add/; \
+	fi; \
 	if [ -e ../kamikaze/x86-uclibc-vm/bin/openwrt-x86-vmlinuz ]; then \
 		cp ../kamikaze/x86-uclibc-vm/bin/openwrt-x86-vmlinuz $(ISODIR)/add/vmlinuz; \
 	fi; \

Modified: torvm/trunk/build/win32/files/buildall.sh
===================================================================
--- torvm/trunk/build/win32/files/buildall.sh	2009-03-12 04:55:10 UTC (rev 18928)
+++ torvm/trunk/build/win32/files/buildall.sh	2009-03-12 04:58:35 UTC (rev 18929)
@@ -8,6 +8,7 @@
 
   export KERNEL_IMAGE=/src/add/vmlinuz
   export VMHDD_IMAGE=/src/add/hdd.img
+  export KERNEL_LICENSE_DOCS=/src/add/kernel-license-docs.tgz
   
   # set sysdrive, ddir, and brootdir in parent env if needed.
   if [[ "$sysdrive" == "" ]]; then
@@ -991,7 +992,16 @@
 cp $KERNEL_IMAGE $bdlibdir/
 cp $VMHDD_IMAGE $bdlibdir/
 
+# add VM kernel license docs, if present
+if [ -f $KERNEL_LICENSE_DOCS ]; then
+  cd $licensedir
+  mkdir VMKernel
+  cd VMKernel
+  tar zxf $KERNEL_LICENSE_DOCS
+fi
+cd /src
 
+
 # Microsoft Installer package build
 TOR_WXS_DIR=contrib
 # Suppress logo and irrelevant warnings about ALLUSERS path variation



More information about the tor-commits mailing list