summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/bootimg.bbclass14
-rw-r--r--classes/java.bbclass60
2 files changed, 70 insertions, 4 deletions
diff --git a/classes/bootimg.bbclass b/classes/bootimg.bbclass
index 0c96001096..d58cf1f424 100644
--- a/classes/bootimg.bbclass
+++ b/classes/bootimg.bbclass
@@ -13,9 +13,9 @@
# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
do_bootimg[depends] += "dosfstools-native:do_populate_staging \
- syslinux-native:do_populate_staging \
- mtools-native:do_populate_staging \
- cdrtools-native:do_populate_staging"
+ syslinux-native:do_populate_staging \
+ mtools-native:do_populate_staging \
+ cdrtools-native:do_populate_staging"
PACKAGES = " "
@@ -31,6 +31,8 @@ SYSLINUXCFG = "${HDDDIR}/syslinux.cfg"
SYSLINUXMENU = "${HDDDIR}/menu"
inherit syslinux
+
+IMAGE_POSTPROCESS_COMMAND ?= ""
build_boot_bin() {
install -d ${HDDDIR}
@@ -49,13 +51,15 @@ build_boot_bin() {
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
+ install -d ${DEPLOY_DIR_IMAGE}
+
mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
- #Create an ISO if we have an INITRD
+ # Create an ISO if we have an INITRD
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
install -d ${ISODIR}
@@ -78,6 +82,8 @@ build_boot_bin() {
cp ${STAGING_DATADIR_NATIVE}/syslinux/isolinux.bin \
${ISODIR}
+ ${IMAGE_POSTPROCESS_COMMAND}
+
mkisofs -V ${BOOTIMG_VOLUME_ID} \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat -r \
diff --git a/classes/java.bbclass b/classes/java.bbclass
index 7fa6dc1786..41d52fe425 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -60,3 +60,63 @@ oe_jarinstall() {
shift
done
}
+
+# Creates a simple wrapper script for your Java program.
+# The script is written to ${PN} by default.
+#
+# Parameters are as follows:
+# [options] <output file> <main class> [jar files ...]
+#
+# Options are
+# -o <name> where name is the output file name
+#
+# It can only take jar files from ${datadir_java}!
+oe_java_simple_wrapper() {
+ delimiter=
+ mainclass=
+ classpath=
+ output=${PN}
+
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -o)
+ shift
+ output=$1
+ ;;
+ -*)
+ oefatal "oe_java_simple_wrapper: unknown option: $1"
+ ;;
+ *)
+ if [ $mainclass ]
+ then
+ classpath=$classpath$delimiter${datadir_java}/$1
+ delimiter=":"
+ else
+ mainclass=$1
+ fi
+ ;;
+ esac
+ shift
+ done
+
+ oenote "Creating simple Java wrapper script"
+ oenote "Output File: $output"
+ oenote "Main Class: $mainclass"
+ oenote "Classpath: $classpath"
+
+ echo "#!/bin/sh" > $output
+ echo "# This file is autogenerated by the oe_java_simple_wrapper function of OpenEmbedded" >> $output
+ echo >> $output
+ echo "# You can provide additional VM arguments by setting the VMARGS environment variable." >> $output
+ echo "CLASSPATH_ARG=\"-cp $classpath\"" >> $output
+ echo >> $output
+ echo "MAIN_CLASS=$mainclass" >> $output
+ echo >> $output
+ echo "# Allows overriding the VM by setting the JAVA environment variable." >> $output
+ echo "if [ x\${JAVA} = x ]" >> $output
+ echo "then" >> $output
+ echo " JAVA=java" >> $output
+ echo "fi" >> $output
+ echo >> $output
+ echo "exec \${JAVA} \${VMARGS} \${CLASSPATH_ARG} \${MAIN_CLASS} \${@}" >> $output
+}