From 416a7e72babf991721c58537db80457a179e6698 Mon Sep 17 00:00:00 2001 From: zalaare Date: Tue, 12 Apr 2016 17:04:56 -0400 Subject: [PATCH 1/8] glib: build static for target host --- packages/devel/glib/package.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/devel/glib/package.mk b/packages/devel/glib/package.mk index 3e69553c6c..3c554a9e8f 100644 --- a/packages/devel/glib/package.mk +++ b/packages/devel/glib/package.mk @@ -1,6 +1,7 @@ ################################################################################ # This file is part of OpenELEC - http://www.openelec.tv # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) +# Copyright (C) 2016- Team LibreELEC # # OpenELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,6 +34,7 @@ PKG_LONGDESC="GLib is a library which includes support routines for C such as li PKG_IS_ADDON="no" PKG_AUTORECONF="yes" +PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared" PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_mmap_fixed_mapped=yes \ ac_cv_func_posix_getpwuid_r=yes \ ac_cv_func_posix_getgrgid_r=yes \ From bb57f2fb9c54b897a5aab745b0605ba3f12cb1a0 Mon Sep 17 00:00:00 2001 From: zalaare Date: Tue, 12 Apr 2016 17:05:52 -0400 Subject: [PATCH 2/8] qemu: add initial package --- packages/tools/qemu/package.mk | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 packages/tools/qemu/package.mk diff --git a/packages/tools/qemu/package.mk b/packages/tools/qemu/package.mk new file mode 100644 index 0000000000..024d99da4b --- /dev/null +++ b/packages/tools/qemu/package.mk @@ -0,0 +1,49 @@ +################################################################################ +# This file is part of LibreELEC - http://www.libreelec.tv +# Copyright (C) 2016- Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="qemu" +PKG_VERSION="2.5.1" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://wiki.qemu.org" +PKG_URL="http://wiki.qemu-project.org/download/qemu-$PKG_VERSION.tar.bz2" +PKG_DEPENDS_HOST="toolchain Python:host zlib:host glib:host" +PKG_PRIORITY="optional" +PKG_SECTION="tools" +PKG_SHORTDESC="QEMU is a generic and open source machine emulator and virtualizer." +PKG_LONGDESC="QEMU is a generic and open source machine emulator and virtualizer." + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +HOST_CONFIGURE_OPTS="--prefix=$ROOT/$TOOLCHAIN \ + --bindir=$ROOT/$TOOLCHAIN/bin \ + --sbindir=$ROOT/$TOOLCHAIN/sbin \ + --sysconfdir=$ROOT/$TOOLCHAIN/etc \ + --libexecdir=$ROOT/$TOOLCHAIN/lib \ + --localstatedir=$ROOT/$TOOLCHAIN/var \ + --extra-cflags=-I$ROOT/$TOOLCHAIN/include \ + --extra-ldflags=-L$ROOT/$TOOLCHAIN/lib \ + --static \ + --disable-vnc \ + --disable-werror \ + --disable-blobs \ + --disable-system \ + --disable-user \ + --disable-docs" From ce76ed6a5e37c524804638a8b36bf06b528a51aa Mon Sep 17 00:00:00 2001 From: zalaare Date: Fri, 15 Apr 2016 14:37:47 -0400 Subject: [PATCH 3/8] scripts/image: add PROJECT_DIR, PROJECT, and DISTRO variables to mkimage script --- scripts/image | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/image b/scripts/image index 29254a7854..be07b81b6d 100755 --- a/scripts/image +++ b/scripts/image @@ -367,6 +367,9 @@ fi PATH="$PATH:/sbin" \ ROOT="$ROOT" \ TOOLCHAIN="$TOOLCHAIN" \ + PROJECT_DIR="$PROJECT_DIR" \ + PROJECT="$PROJECT" \ + DISTRO="$DISTRO" \ TARGET_IMG="$TARGET_IMG" \ IMAGE_NAME="$IMAGE_NAME" \ BOOTLOADER="$BOOTLOADER" \ From 8ada2101830279d447b6636487ba88596399ce4d Mon Sep 17 00:00:00 2001 From: zalaare Date: Fri, 15 Apr 2016 14:47:20 -0400 Subject: [PATCH 4/8] scripts/mkimage: enable building Open Virtualization Format image --- scripts/mkimage | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/scripts/mkimage b/scripts/mkimage index c765dbbb88..2fe06335e0 100755 --- a/scripts/mkimage +++ b/scripts/mkimage @@ -108,7 +108,7 @@ fi HEADS=4 TRACKS=32 SECTORS=$(( $SYSTEM_SIZE * 1024 * 1024 / 512 / $HEADS / $TRACKS )) - + shopt -s expand_aliases # enables alias expansion in script alias mformat="mformat -i $DISK@@$OFFSET -h $HEADS -t $TRACKS -s $SECTORS" alias mcopy="mcopy -i $DISK@@$OFFSET" @@ -139,6 +139,18 @@ LABEL live APPEND boot=UUID=$UUID_SYSTEM live quiet tty vga=current EOF + if [ "$PROJECT" = Virtual ]; then + cat << EOF > "$OE_TMP"/syslinux.cfg +DEFAULT virtual +TIMEOUT 50 +PROMPT 0 + +LABEL virtual + KERNEL /$KERNEL_NAME + APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE quiet tty vga=current +EOF + fi + mcopy "$OE_TMP/syslinux.cfg" :: # install extlinux @@ -255,7 +267,7 @@ fi # bootloader sync # add resize mark - if [ "$BOOTLOADER" != "syslinux" ]; then + if [ "$BOOTLOADER" != "syslinux" -o "$PROJECT" = Virtual ]; then mkdir "$OE_TMP/part2.fs" touch "$OE_TMP/part2.fs/.please_resize_me" echo "image: populating filesystem on part2..." @@ -268,6 +280,7 @@ fi # bootloader echo "image: merging part2 back to image..." dd if="$OE_TMP/part2.ext4" of="$DISK" bs=512 seek="$STORAGE_PART_START" conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error + # extract part1 from image to run fsck echo "image: extracting part1 from image..." SYSTEM_PART_COUNT=$(( $SYSTEM_PART_END - $SYSTEM_PART_START + 1 )) @@ -276,6 +289,17 @@ fi # bootloader echo "image: checking filesystem on part1..." fsck -n $OE_TMP/part1.fat >"$SAVE_ERROR" 2>&1 || show_error +# create virtual images + if [ "$PROJECT" = Virtual ]; then + echo "image: creating open virtual appliance..." + qemu-img convert -O vmdk -o subformat=streamOptimized "$DISK" "$DISK.vmdk" + sed -e "s,@DISTRO@,$DISTRO,g" -e "s,@DISK@,$(basename $DISK),g" -e "s,@DISK_SIZE@,$(ls -l $DISK.vmdk | awk '{print $5}'),g" $PROJECT_DIR/$PROJECT/config/ovf.template > $DISK.ovf + tar -C $TARGET_IMG -cf $DISK.ova $(basename $DISK).ovf $(basename $DISK).vmdk + echo "image: cleaning up..." + rm $DISK.vmdk $DISK.ovf + [ -n "$SUDO_USER" ] && chown $SUDO_USER: $DISK.ova + fi + # gzip echo "image: compressing..." gzip $DISK From bc6f1da98aff8ffe0a3502556501b3bcf45f3f57 Mon Sep 17 00:00:00 2001 From: zalaare Date: Mon, 18 Apr 2016 13:01:46 +0000 Subject: [PATCH 5/8] Virtual: add initial ovf template --- projects/Virtual/config/ovf.template | 120 +++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 projects/Virtual/config/ovf.template diff --git a/projects/Virtual/config/ovf.template b/projects/Virtual/config/ovf.template new file mode 100644 index 0000000000..dff1caa235 --- /dev/null +++ b/projects/Virtual/config/ovf.template @@ -0,0 +1,120 @@ + + + + + + Virtual disk information + + + + The list of logical networks + + The bridged network + + + + A virtual machine + @DISTRO@ + + Meta-information about the installed software + LibreELEC + LibreELEC + http://libreelec.tv + http://libreelec.tv + + + A human-readable annotation + LibreELEC is ‘Just enough OS’ for Kodi, a Linux distribution built to run Kodi on current and popular mediacentre hardware. We are an evolution of the popular OpenELEC project. + + + The kind of installed guest operating system + + Virtual hardware requirements + + Virtual Hardware Family + 0 + LibreELEC + vmx-09 + + + hertz * 10^6 + Number of Virtual CPUs + 1 virtual CPU(s) + 1 + 3 + 1 + + + byte * 2^20 + Memory Size + 512MB of memory + 2 + 4 + 512 + + + 0 + USB Controller (EHCI) + usb + 3 + vmware.usb.ehci + 23 + + + + 0 + IDE Controller + ideController0 + 4 + 5 + + + 0 + disk0 + ovf:/disk/disk + 5 + 4 + 17 + + + 1 + true + bridged + E1000 ethernet adapter on "bridged" + ethernet0 + 6 + E1000 + 10 + + + + false + sound + 7 + vmware.soundcard.hdaudio + 1 + + + false + video + 8 + 24 + + + + false + vmci + 9 + vmware.vmci + 1 + + + + + + + + + From 1db1941eae720d8daea926cbdd762b12e7345760 Mon Sep 17 00:00:00 2001 From: zalaare Date: Mon, 18 Apr 2016 20:07:01 +0000 Subject: [PATCH 6/8] virtual: initial virtual package "virtual" for project Virtual dependencies --- packages/virtual/virtual/package.mk | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/virtual/virtual/package.mk diff --git a/packages/virtual/virtual/package.mk b/packages/virtual/virtual/package.mk new file mode 100644 index 0000000000..f078f71cca --- /dev/null +++ b/packages/virtual/virtual/package.mk @@ -0,0 +1,33 @@ +################################################################################ +# This file is part of LibreELEC - http://www.libreelec.tv +# Copyright (C) 2016- Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="virtual" +PKG_VERSION="" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.libreelec.tv" +PKG_URL="" +PKG_DEPENDS_TARGET="qemu:host" +PKG_PRIORITY="optional" +PKG_SECTION="virtual" +PKG_SHORTDESC="virtual: Meta package to install Virtual project extra deps" +PKG_LONGDESC="virtual is a Meta package to install Virtual project extra dependencies" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" From 4262d3fb4e322747e21a058ba1480ee3c76b18f5 Mon Sep 17 00:00:00 2001 From: zalaare Date: Mon, 18 Apr 2016 20:28:11 +0000 Subject: [PATCH 7/8] scripts/image: use virtual package "virtual" for ovf creation dependencies --- scripts/image | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/image b/scripts/image index be07b81b6d..67a620826a 100755 --- a/scripts/image +++ b/scripts/image @@ -177,6 +177,9 @@ fi # LCD support [ ! "$LCD_DRIVER" = "none" ] && $SCRIPTS/install lcdproc +# Virtual image creation support + [ "$PROJECT" = Virtual ] && $SCRIPTS/install virtual + # Installer support [ "$INSTALLER_SUPPORT" = "yes" ] && $SCRIPTS/install installer From 33c706103f2e08582097490addc6dc5e553e449a Mon Sep 17 00:00:00 2001 From: zalaare Date: Wed, 27 Jul 2016 18:01:07 -0400 Subject: [PATCH 8/8] Virtual: change OVF VM type from 1 (Unknown) to 94 (Ubuntu 64-Bit) * see http://schemas.dmtf.org/wbem/cim-html/2/CIM_OperatingSystem.html --- projects/Virtual/config/ovf.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Virtual/config/ovf.template b/projects/Virtual/config/ovf.template index dff1caa235..51f4baba68 100644 --- a/projects/Virtual/config/ovf.template +++ b/projects/Virtual/config/ovf.template @@ -28,7 +28,7 @@ xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemS A human-readable annotation LibreELEC is ‘Just enough OS’ for Kodi, a Linux distribution built to run Kodi on current and popular mediacentre hardware. We are an evolution of the popular OpenELEC project. - + The kind of installed guest operating system Virtual hardware requirements