From ac3c98aae2cb88c0fb93698a02b9e9ebda3a6b88 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 18:07:32 +0300 Subject: [PATCH 01/19] scripts/image: no more .tar.bz. images coming soon --- scripts/image | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/image b/scripts/image index 5fab510bb2..c7dead4335 100755 --- a/scripts/image +++ b/scripts/image @@ -262,11 +262,10 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION" # remove an previous created release tarball rm -rf $TARGET_IMG/$IMAGE_NAME.tar - rm -rf $TARGET_IMG/$IMAGE_NAME.tar.bz2 # to remove later + rm -rf $TARGET_IMG/$IMAGE_NAME.img.gz # create release tarball tar cf $TARGET_IMG/$IMAGE_NAME.tar -C target $IMAGE_NAME - tar cjf $TARGET_IMG/$IMAGE_NAME.tar.bz2 -C target $IMAGE_NAME # to remove later # cleanup release dir rm -rf $RELEASE_DIR From be630adfe11e15c636d9b1522b44cf8abc102b1d Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 18:13:09 +0300 Subject: [PATCH 02/19] Makefile: add optional "make image" support --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 621a67b99a..9386193b56 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ system: release: ./scripts/image release +image: + BUILD_IMAGE=yes ./scripts/image release + noobs: ./scripts/image noobs From 0665aa74e997002b6e12142e077b633f78256a38 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 19:06:11 +0300 Subject: [PATCH 03/19] scripts/checkdeps: check for parted --- scripts/checkdeps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkdeps b/scripts/checkdeps index 20567cd829..719bc4126f 100755 --- a/scripts/checkdeps +++ b/scripts/checkdeps @@ -33,8 +33,8 @@ case $1 in deps_pkg="wget" ;; build) - deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf cvs zip unzip mkfontscale diff xsltproc java" - deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf cvs zip unzip xutils diff xsltproc default-jre" + deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf cvs zip unzip mkfontscale diff xsltproc java parted" + deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf cvs zip unzip xutils diff xsltproc default-jre parted" files="/usr/include/stdio.h /usr/include/ncurses.h" files_pkg="libc6-dev libncurses5-dev" ;; From 47fd1cc66b152f56a6d76e020975df14035b7a09 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 18:15:21 +0300 Subject: [PATCH 04/19] bcm2835-bootloader/release: add initial "make image" support BIG FAT WARNING: this requires sudo at build-time. may not work with auto-builds. check your etc/sudoers BIG FAT WARNING: this is a work in progress. use only if you know what you are doing. --- packages/tools/bcm2835-bootloader/image | 128 ++++++++++++++++++++++ packages/tools/bcm2835-bootloader/release | 8 ++ 2 files changed, 136 insertions(+) create mode 100755 packages/tools/bcm2835-bootloader/image diff --git a/packages/tools/bcm2835-bootloader/image b/packages/tools/bcm2835-bootloader/image new file mode 100755 index 0000000000..d92ef6814c --- /dev/null +++ b/packages/tools/bcm2835-bootloader/image @@ -0,0 +1,128 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +cleanup() +{ + echo "image: cleanup..." + umount /tmp/oe_image_install &>/dev/null || : + losetup -d "$LOOP" + [ -f /tmp/oe_image_install/ldlinux.sys ] && chattr -i /tmp/oe_image_install/ldlinux.sys || : + rm -rf /tmp/oe_image_install + exit +} + +trap cleanup SIGINT + +# set variables + SYSTEM_SIZE=128 + # 3STORAGE_SIZE must be >= 32 ! + STORAGE_SIZE=32 + DISK_SIZE=$(( $SYSTEM_SIZE + $STORAGE_SIZE )) + DISK="$TARGET_IMG/$IMAGE_NAME.img" + LOOP=$(losetup -f) + +# ensure loopX not in use + echo "image: next two errors can be ignored..." + umount /tmp/oe_image_install >/dev/null || : + umount "$LOOP" &>/dev/null >/dev/null || : + losetup -d "$LOOP" &>/dev/null >/dev/null || : + rm -rf /tmp/oe_image_install &>/dev/null + +# create an image + echo "image: creating new image: $DISK..." + dd if=/dev/zero of="$DISK" bs=1M count="$DISK_SIZE" + sync + +# write a disklabel + echo "image: creating partition table: $DISK..." + losetup "$LOOP" "$DISK" + parted -s "$LOOP" mklabel msdos + sync + +# create part1 + echo "image: creating par1 on $DISK..." + SYSTEM_PART_END=$(( $SYSTEM_SIZE * 1024 * 1024 / 512 + 64 )) + parted -s "$LOOP" -a min unit s mkpart primary fat32 64 $SYSTEM_PART_END + parted -s "$LOOP" set 1 boot on + +# create part2 + echo "image: creating part2 on $DISK..." + STORAGE_PART_START=$(( $SYSTEM_PART_END + 1 )) + parted -s "$LOOP" -a min unit s mkpart primary ext4 $STORAGE_PART_START 100% + sync + +# create filesystem on part1 + losetup -d "$LOOP" + echo "image: creating filesystem on part1..." + OFFSET=$(( 64 * 512 )) + SIZELIMIT=$(( $SYSTEM_SIZE * 1024 * 1024 )) + losetup -o $OFFSET --sizelimit $SIZELIMIT "$LOOP" "$DISK" + mkfs.vfat "$LOOP" + sync + +# mount partition + echo "image: mounting part1 on /tmp/oe_image_install..." + mkdir -p /tmp/oe_image_install + mount "$LOOP" /tmp/oe_image_install + +# create bootloader configuration + echo "image: creating bootloader configuration..." + cat >/tmp/oe_image_install/cmdline.txt << EOF +boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet +EOF + +# copy files + echo "image: copying files to part1..." + cp $RELEASE_DIR/3rdparty/bootloader/bootcode.bin /tmp/oe_image_install + cp $RELEASE_DIR/3rdparty/bootloader/fixup.dat /tmp/oe_image_install + cp $RELEASE_DIR/3rdparty/bootloader/start.elf /tmp/oe_image_install + cp $TARGET_IMG/$IMAGE_NAME.kernel /tmp/oe_image_install/kernel.img + cp $TARGET_IMG/$IMAGE_NAME.system /tmp/oe_image_install/SYSTEM + +# unmount part1 + echo "image: unmounting part1..." + umount "$LOOP" + sync + +# create filesystem on part2 + losetup -d "$LOOP" + echo "image: creating filesystem on part2..." + OFFSET=$(( $STORAGE_PART_START * 512 )) + losetup -o $OFFSET "$LOOP" "$DISK" + mke2fs -q -t ext4 -m 0 "$LOOP" + e2fsck -n "$LOOP" + sync + +# add resize mark + echo "image: mounting part2 on /tmp/oe_image_install..." + mount "$LOOP" /tmp/oe_image_install + touch /tmp/oe_image_install/.please_resize_me + echo "image: unmounting part2..." + umount "$LOOP" + sync + +# gzip + echo "image: compressing..." + gzip $DISK + +# cleanup + cleanup diff --git a/packages/tools/bcm2835-bootloader/release b/packages/tools/bcm2835-bootloader/release index eb39ab8fe9..6d1f68a326 100755 --- a/packages/tools/bcm2835-bootloader/release +++ b/packages/tools/bcm2835-bootloader/release @@ -28,3 +28,11 @@ mkdir -p $RELEASE_DIR/3rdparty/bootloader cp -PR $BUILD/bcm2835-bootloader-*/fixup_x.dat $RELEASE_DIR/3rdparty/bootloader/fixup.dat cp -PR $BUILD/bcm2835-bootloader-*/start_x.elf $RELEASE_DIR/3rdparty/bootloader/start.elf +if [ "$BUILD_IMAGE" = "yes" -a -x "$BOOTLOADER_DIR/image" ] ; then + # variables used in image script must be passed + sudo env \ + TARGET_IMG="$TARGET_IMG" \ + IMAGE_NAME="$IMAGE_NAME" \ + RELEASE_DIR="$RELEASE_DIR" \ + $BOOTLOADER_DIR/image +fi From f39fe40ce328fcf48c9513d71171cd9b6a320ad1 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Mon, 16 Sep 2013 18:51:24 +0200 Subject: [PATCH 05/19] projects/*/linux: remove PSTATE support again Signed-off-by: Stephan Raue --- projects/Generic/linux/linux.i386.conf | 2 +- projects/Generic/linux/linux.x86_64.conf | 2 +- projects/Generic_OSS/linux/linux.i386.conf | 2 +- projects/Intel/linux/linux.x86_64.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/Generic/linux/linux.i386.conf b/projects/Generic/linux/linux.i386.conf index 7d5addbb39..07a2455e63 100644 --- a/projects/Generic/linux/linux.i386.conf +++ b/projects/Generic/linux/linux.i386.conf @@ -531,7 +531,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # # x86 CPU frequency scaling drivers # -CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y diff --git a/projects/Generic/linux/linux.x86_64.conf b/projects/Generic/linux/linux.x86_64.conf index 3e027b4ee6..87d5ca8191 100644 --- a/projects/Generic/linux/linux.x86_64.conf +++ b/projects/Generic/linux/linux.x86_64.conf @@ -521,7 +521,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # # x86 CPU frequency scaling drivers # -CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y diff --git a/projects/Generic_OSS/linux/linux.i386.conf b/projects/Generic_OSS/linux/linux.i386.conf index 015d3b7435..0f18adbf81 100644 --- a/projects/Generic_OSS/linux/linux.i386.conf +++ b/projects/Generic_OSS/linux/linux.i386.conf @@ -531,7 +531,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # # x86 CPU frequency scaling drivers # -CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y diff --git a/projects/Intel/linux/linux.x86_64.conf b/projects/Intel/linux/linux.x86_64.conf index 1bd0bd810e..03bf385d6a 100644 --- a/projects/Intel/linux/linux.x86_64.conf +++ b/projects/Intel/linux/linux.x86_64.conf @@ -513,7 +513,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y # # x86 CPU frequency scaling drivers # -CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ=y # CONFIG_X86_POWERNOW_K8 is not set From 52bf3bf4db534900aa984ae7f8ca8cb569a45216 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 20:20:33 +0300 Subject: [PATCH 06/19] xbmc: After suspend wait for the first NIC to come up beforecontinuing thanks @devkid --- ...nd-wait-for-the-first-NIC-to-come-up.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch new file mode 100644 index 0000000000..12da4927f4 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch @@ -0,0 +1,66 @@ +From 7cd450bb2b8ea18277efff955202bf3b36573898 Mon Sep 17 00:00:00 2001 +From: verybadsoldier +Date: Sun, 1 Sep 2013 17:10:19 +0200 +Subject: [PATCH] After suspend wait for the first NIC to come up before + continuing + +--- + xbmc/powermanagement/PowerManager.cpp | 24 ++++++++++++++++++++++++ + xbmc/powermanagement/PowerManager.h | 2 ++ + 2 files changed, 26 insertions(+) + +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index a68910b..8e93492 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -207,6 +207,8 @@ void CPowerManager::OnWake() + { + CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); + ++ WaitForNic(); ++ + // reset out timers + g_application.ResetShutdownTimers(); + +@@ -254,3 +256,25 @@ void CPowerManager::OnLowBattery() + + CAnnouncementManager::Announce(System, "xbmc", "OnLowBattery"); + } ++ ++void CPowerManager::WaitForNic() ++{ ++ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); ++ ++ const unsigned maxLoopCount = 50u; ++ const unsigned sleepTimeMs = 200u; ++ ++ for(unsigned i=0; i < maxLoopCount; ++i) ++ { ++ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); ++ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) ++ { ++ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); ++ return; ++ } ++ ++ Sleep(sleepTimeMs); ++ } ++ ++ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); ++} +diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h +index deb4b66..476cdc1 100644 +--- a/xbmc/powermanagement/PowerManager.h ++++ b/xbmc/powermanagement/PowerManager.h +@@ -73,6 +73,8 @@ class CPowerManager : public IPowerEventsCallback + + void OnLowBattery(); + ++ void WaitForNic(); ++ + IPowerSyscall *m_instance; + }; + +-- +1.8.4 + From 08ece3366135df7e138e47cb8561568865ad5ddf Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 21:34:14 +0300 Subject: [PATCH 07/19] Makefile: ups. bad c/p --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9386193b56..8af8e33052 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ release: ./scripts/image release image: - BUILD_IMAGE=yes ./scripts/image release + BUILD_IMAGE=yes ./scripts/image release noobs: ./scripts/image noobs From 044f79c4ff3efa8b3976213c4442b388e9025be8 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 21:59:08 +0300 Subject: [PATCH 08/19] scripts/image: clean up old .img.gz before starting bootloader/releas --- scripts/image | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/image b/scripts/image index c7dead4335..c38e05c3cf 100755 --- a/scripts/image +++ b/scripts/image @@ -215,6 +215,8 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION" # create release dir mkdir -p $RELEASE_DIR + # remove n previous created release image + rm -rf $TARGET_IMG/$IMAGE_NAME.img.gz if [ -n "$BOOTLOADER" ]; then BOOTLOADER_DIR=`find $PACKAGES -type d -name $BOOTLOADER 2>/dev/null` if [ -d "$BOOTLOADER_DIR"/files ]; then @@ -262,7 +264,6 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION" # remove an previous created release tarball rm -rf $TARGET_IMG/$IMAGE_NAME.tar - rm -rf $TARGET_IMG/$IMAGE_NAME.img.gz # create release tarball tar cf $TARGET_IMG/$IMAGE_NAME.tar -C target $IMAGE_NAME From 51e117945961b519efba56bc481a136987e3146b Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 22:14:55 +0300 Subject: [PATCH 09/19] util-linux: add host configure opts ... for utl-linux:host --- packages/sysutils/util-linux/package.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/sysutils/util-linux/package.mk b/packages/sysutils/util-linux/package.mk index 280d4b5bf9..ea45175a40 100644 --- a/packages/sysutils/util-linux/package.mk +++ b/packages/sysutils/util-linux/package.mk @@ -98,6 +98,8 @@ PKG_CONFIGURE_OPTS_TARGET="--disable-gtk-doc \ --without-utempter \ --without-systemdsystemunitdir" +PKG_CONFIGURE_OPTS_HOST="$PKG_CONFIGURE_OPTS_TARGET" + post_makeinstall_target() { rm -rf $INSTALL/usr/bin rm -rf $INSTALL/usr/sbin From 4ce825bae6656a915d438eebe2d04d005ec81dec Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 22:18:50 +0300 Subject: [PATCH 10/19] syslinux: build syslinux-host TODO: ugly. needs some rework --- packages/tools/syslinux/build | 26 ++++++++++++++++++++++---- packages/tools/syslinux/meta | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/tools/syslinux/build b/packages/tools/syslinux/build index 5001807864..71bb28e855 100755 --- a/packages/tools/syslinux/build +++ b/packages/tools/syslinux/build @@ -24,12 +24,30 @@ $SCRIPTS/build toolchain -LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` - -CFLAGS="$CFLAGS -I../libinstaller -I../libfat" - cd $PKG_BUILD +setup_toolchain host +HOST_LDFLAGS=`echo $HOST_LDFLAGS | sed -e "s|-Wl,--as-needed||"` +HOST_CFLAGS="$HOST_CFLAGS -I../libinstaller -I../libfat" + +# TODO: fix +cp $ROOT/$PKG_BUILD/com32/include/com32.h $ROOT/$TOOLCHAIN/include +make clean +make CC=$CC \ + AR=$AR \ + RANLIB="$RANLIB" \ + LDFLAGS="$HOST_LDFLAGS" \ + CFLAGS="$HOST_CFLAGS -fomit-frame-pointer -D_FILE_OFFSET_BITS=64" \ + installer + +# TODO: fix +cp $ROOT/$PKG_BUILD/extlinux/extlinux $ROOT/$PKG_BUILD/extlinux/extlinux.host + +setup_toolchain target +LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"` +CFLAGS="$CFLAGS -I../libinstaller -I../libfat" + +make clean make CC=$CC \ AR=$AR \ RANLIB="$RANLIB" \ diff --git a/packages/tools/syslinux/meta b/packages/tools/syslinux/meta index adaf33447c..abecbc92b9 100644 --- a/packages/tools/syslinux/meta +++ b/packages/tools/syslinux/meta @@ -26,7 +26,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://syslinux.zytor.com/" PKG_URL="http://www.kernel.org/pub/linux/utils/boot/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2" PKG_DEPENDS="" -PKG_BUILD_DEPENDS="toolchain util-linux e2fsprogs" +PKG_BUILD_DEPENDS="toolchain util-linux:host util-linux e2fsprogs" PKG_PRIORITY="optional" PKG_SECTION="tools" PKG_SHORTDESC="syslinux: Linux bootloader collection" From abe6e06d169eeb7445373afb3c8a7c6856e2340b Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 22:19:50 +0300 Subject: [PATCH 11/19] syslinuxrelease: add initial "make image" support BIG FAT WARNING: this requires sudo at build-time. may not work with auto-builds. check your etc/sudoers BIG FAT WARNING: this is a work in progress. use only if you know what you are doing. --- packages/tools/syslinux/image | 180 ++++++++++++++++++++++++++++++++ packages/tools/syslinux/release | 16 +++ 2 files changed, 196 insertions(+) create mode 100755 packages/tools/syslinux/image diff --git a/packages/tools/syslinux/image b/packages/tools/syslinux/image new file mode 100755 index 0000000000..75147981a5 --- /dev/null +++ b/packages/tools/syslinux/image @@ -0,0 +1,180 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +cleanup() +{ + echo "image: cleanup..." + umount /tmp/oe_image_install &>/dev/null || : + losetup -d "$LOOP" + [ -f /tmp/oe_image_install/ldlinux.sys ] && chattr -i /tmp/oe_image_install/ldlinux.sys || : + rm -rf /tmp/oe_image_install + exit +} + +trap cleanup SIGINT + +# set variables + SYSTEM_SIZE=256 + # 3STORAGE_SIZE must be >= 32 ! + STORAGE_SIZE=32 + DISK_SIZE=$(( $SYSTEM_SIZE + $STORAGE_SIZE )) + DISK="$TARGET_IMG/$IMAGE_NAME.img" + LOOP=$(losetup -f) + +# ensure loopX not in use + echo "image: next two errors can be ignored..." + umount /tmp/oe_image_install >/dev/null || : + umount "$LOOP" &>/dev/null >/dev/null || : + losetup -d "$LOOP" &>/dev/null >/dev/null || : + rm -rf /tmp/oe_image_install &>/dev/null + +# create an image + echo "image: creating new empty image: $DISK..." + dd if=/dev/zero of="$DISK" bs=1M count="$DISK_SIZE" + sync + +# write a disklabel + echo "image: creating new partition table: $DISK..." + losetup "$LOOP" "$DISK" + parted -s "$LOOP" mklabel msdos + sync + +# create part1 + echo "image: creating part1 on $DISK..." + SYSTEM_PART_END=$(( $SYSTEM_SIZE * 1024 * 1024 / 512 + 64 )) + parted -s "$LOOP" -a min unit s mkpart primary ext4 64 $SYSTEM_PART_END + parted -s "$LOOP" set 1 boot on + +# create part2 + echo "image: creating part2 on $DISK..." + STORAGE_PART_START=$(( $SYSTEM_PART_END + 1 )) + parted -s "$LOOP" -a min unit s mkpart primary ext4 $STORAGE_PART_START 100% + sync + +# write mbr + echo "image: writing mbr..." + MBR="$EXTLINUX_DIR/mbr/mbr.bin" + if [ -n "$MBR" ]; then + dd bs=440 count=1 conv=notrunc if="$MBR" of="$LOOP" + fi + sync + +# create filesystem on part1 + losetup -d "$LOOP" + echo "image: creating filesystem on part1..." + OFFSET=$(( 64 * 512 )) + SIZELIMIT=$(( $SYSTEM_SIZE * 1024 * 1024 )) + losetup -o $OFFSET --sizelimit $SIZELIMIT "$LOOP" "$DISK" + mke2fs -q -t ext4 -m 0 "$LOOP" + tune2fs -U $UUID_SYSTEM "$LOOP" + e2fsck -n "$LOOP" + sync + +# mount partition + echo "image: mounting part1 on /tmp/oe_image_install..." + mkdir -p /tmp/oe_image_install + mount "$LOOP" /tmp/oe_image_install + +# create bootloader configuration + echo "image: creating bootloader configuration..." + cat >/tmp/oe_image_install/syslinux.cfg << EOF +UI vesamenu.c32 +PROMPT 0 +MENU TITLE Boot Menu +MENU BACKGROUND splash.png +TIMEOUT 50 +DEFAULT live + +MENU WIDTH 70 +MENU MARGIN 15 +MENU ROWS 2 +MENU HSHIFT 4 +MENU VSHIFT 13 +MENU TIMEOUTROW 10 +MENU TABMSGROW 8 +MENU CMDLINEROW 8 +MENU HELPMSGROW 13 +MENU HELPMSGENDROW 26 +MENU CLEAR + +MENU COLOR border 30;44 #40ffffff #00000000 std +MENU COLOR title 1;36;44 #ff8bbfe3 #00000000 std +MENU COLOR sel 7;37;40 #80f0f0f0 #ff606060 all +MENU COLOR unsel 37;44 #50ffffff #00000000 std +MENU COLOR help 37;40 #c0ffffff #a0000000 std +MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std +MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std +MENU COLOR msg07 37;40 #90ffffff #a0000000 std +MENU COLOR tabmsg 31;40 #ff868787 #00000000 std + +LABEL installer + MENU LABEL Run OpenELEC Installer + KERNEL /KERNEL + APPEND boot=UUID=$UUID_SYSTEM installer quiet vga=current + +LABEL live + MENU LABEL Run OpenELEC Live + KERNEL /KERNEL + APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE quiet vga=current +EOF + +# install extlinux + echo "image: installing extlinux to part1..." + $EXTLINUX_DIR/extlinux/extlinux.host --heads=4 --sector=32 -i /tmp/oe_image_install + +# copy files + echo "image: copying files to part1..." + cp $TARGET_IMG/$IMAGE_NAME.kernel /tmp/oe_image_install/KERNEL + cp $TARGET_IMG/$IMAGE_NAME.system /tmp/oe_image_install/SYSTEM + cp $RELEASE_DIR/splash.png /tmp/oe_image_install + cp $EXTLINUX_DIR/com32/menu/vesamenu.c32 /tmp/oe_image_install + cp $EXTLINUX_DIR/com32/lib/libcom32.c32 /tmp/oe_image_install + cp $EXTLINUX_DIR/com32/libutil/libutil.c32 /tmp/oe_image_install + +# unmount part1 + echo "image: unmounting part1..." + umount "$LOOP" + sync + +# create filesystem on part2 + losetup -d "$LOOP" + echo "image: creating filesystem on part2..." + OFFSET=$(( $STORAGE_PART_START * 512 )) + losetup -o $OFFSET "$LOOP" "$DISK" + mke2fs -q -t ext4 -m 0 "$LOOP" + tune2fs -U $UUID_STORAGE "$LOOP" + e2fsck -n "$LOOP" + sync + + echo "image: mounting part2 on /tmp/oe_image_install..." + mount "$LOOP" /tmp/oe_image_install + touch /tmp/oe_image_install/.please_resize_me + echo "image: unmounting part2..." + umount "$LOOP" + sync + +# gzip + echo "image: compressing..." + gzip $DISK + +# cleanup + cleanup diff --git a/packages/tools/syslinux/release b/packages/tools/syslinux/release index 7da6013399..24a2bc8313 100755 --- a/packages/tools/syslinux/release +++ b/packages/tools/syslinux/release @@ -40,3 +40,19 @@ mkdir -p $RELEASE_DIR/3rdparty/syslinux/win32 mkdir -p $RELEASE_DIR/3rdparty/syslinux/win64 cp -PR $BUILD/syslinux-*/win64/syslinux64.exe $RELEASE_DIR/3rdparty/syslinux/win64 + +if [ "$BUILD_IMAGE" = "yes" -a -x "$BOOTLOADER_DIR/image" ] ; then + # variables used in image script must be passed + EXTLINUX_DIR=$(ls -d $ROOT/$BUILD/syslinux-*/) + UUID_SYSTEM=$(uuidgen) + UUID_STORAGE=$(uuidgen) + + sudo env \ + TARGET_IMG="$TARGET_IMG" \ + IMAGE_NAME="$IMAGE_NAME" \ + RELEASE_DIR="$RELEASE_DIR" \ + EXTLINUX_DIR="$EXTLINUX_DIR" \ + UUID_SYSTEM="$UUID_SYSTEM" \ + UUID_STORAGE="$UUID_STORAGE" \ + $BOOTLOADER_DIR/image +fi From 25bf923b4a5d0f59c20756dbc3fef0773d3aece5 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 22:24:57 +0300 Subject: [PATCH 12/19] Revert "scripts/checkdeps: check for parted" This reverts commit 0665aa74e997002b6e12142e077b633f78256a38. --- scripts/checkdeps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkdeps b/scripts/checkdeps index 719bc4126f..20567cd829 100755 --- a/scripts/checkdeps +++ b/scripts/checkdeps @@ -33,8 +33,8 @@ case $1 in deps_pkg="wget" ;; build) - deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf cvs zip unzip mkfontscale diff xsltproc java parted" - deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf cvs zip unzip xutils diff xsltproc default-jre parted" + deps="bash bc gcc g++ sed patch touch tar bzip2 gzip perl cp gawk makeinfo gperf cvs zip unzip mkfontscale diff xsltproc java" + deps_pkg="bash bc gcc g++ sed patch fileutils tar bzip2 gzip perl coreutils gawk texinfo gperf cvs zip unzip xutils diff xsltproc default-jre" files="/usr/include/stdio.h /usr/include/ncurses.h" files_pkg="libc6-dev libncurses5-dev" ;; From 048b53714bac72dd6416b1d80d8ab35fe05254a9 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 23:17:11 +0300 Subject: [PATCH 13/19] xbmc: remove unneeded patch --- .../xbmc-990.24-wait-for-nic-on-wakeup.patch | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch deleted file mode 100644 index a75dba87e4..0000000000 --- a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index 26d7002..71c4bd4 100644 ---- a/xbmc/powermanagement/PowerManager.cpp -+++ b/xbmc/powermanagement/PowerManager.cpp -@@ -23,6 +23,7 @@ - #include "Application.h" - #include "cores/AudioEngine/AEFactory.h" - #include "input/KeyboardStat.h" -+#include "network/Network.h" - #include "settings/GUISettings.h" - #include "windowing/WindowingFactory.h" - #include "utils/log.h" -@@ -218,10 +219,34 @@ void CPowerManager::OnSleep() - CAEFactory::Suspend(); - } - -+void CPowerManager::WaitForNet() -+{ -+ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); -+ -+ const unsigned maxLoopCount = 50u; -+ const unsigned sleepTimeMs = 200u; -+ -+ for(unsigned i=0; i < 50; ++i) -+ { -+ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); -+ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) -+ { -+ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); -+ return; -+ } -+ -+ Sleep(sleepTimeMs); -+ } -+ -+ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); -+} -+ - void CPowerManager::OnWake() - { - CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); - -+ WaitForNet(); -+ - // reset out timers - g_application.ResetShutdownTimers(); - -diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h -index 0a9183c..714b5cc 100644 ---- a/xbmc/powermanagement/PowerManager.h -+++ b/xbmc/powermanagement/PowerManager.h -@@ -72,6 +72,8 @@ private: - - void OnLowBattery(); - -+ void WaitForNet(); -+ - IPowerSyscall *m_instance; - }; - From 812be228832fdfb47399e2e31637566335b1089f Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 23:34:44 +0300 Subject: [PATCH 14/19] Revert "xbmc: remove unneeded patch" This reverts commit 048b53714bac72dd6416b1d80d8ab35fe05254a9. --- .../xbmc-990.24-wait-for-nic-on-wakeup.patch | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch new file mode 100644 index 0000000000..a75dba87e4 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch @@ -0,0 +1,60 @@ +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index 26d7002..71c4bd4 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -23,6 +23,7 @@ + #include "Application.h" + #include "cores/AudioEngine/AEFactory.h" + #include "input/KeyboardStat.h" ++#include "network/Network.h" + #include "settings/GUISettings.h" + #include "windowing/WindowingFactory.h" + #include "utils/log.h" +@@ -218,10 +219,34 @@ void CPowerManager::OnSleep() + CAEFactory::Suspend(); + } + ++void CPowerManager::WaitForNet() ++{ ++ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); ++ ++ const unsigned maxLoopCount = 50u; ++ const unsigned sleepTimeMs = 200u; ++ ++ for(unsigned i=0; i < 50; ++i) ++ { ++ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); ++ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) ++ { ++ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); ++ return; ++ } ++ ++ Sleep(sleepTimeMs); ++ } ++ ++ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); ++} ++ + void CPowerManager::OnWake() + { + CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); + ++ WaitForNet(); ++ + // reset out timers + g_application.ResetShutdownTimers(); + +diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h +index 0a9183c..714b5cc 100644 +--- a/xbmc/powermanagement/PowerManager.h ++++ b/xbmc/powermanagement/PowerManager.h +@@ -72,6 +72,8 @@ private: + + void OnLowBattery(); + ++ void WaitForNet(); ++ + IPowerSyscall *m_instance; + }; + From 7d0bf986da37d74378da8408fac8e4d8c35a8614 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Mon, 16 Sep 2013 23:35:17 +0300 Subject: [PATCH 15/19] Revert "xbmc: After suspend wait for the first NIC to come up beforecontinuing" This reverts commit 52bf3bf4db534900aa984ae7f8ca8cb569a45216. ... nah. keep old patch. --- ...nd-wait-for-the-first-NIC-to-come-up.patch | 66 ------------------- 1 file changed, 66 deletions(-) delete mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch deleted file mode 100644 index 12da4927f4..0000000000 --- a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 7cd450bb2b8ea18277efff955202bf3b36573898 Mon Sep 17 00:00:00 2001 -From: verybadsoldier -Date: Sun, 1 Sep 2013 17:10:19 +0200 -Subject: [PATCH] After suspend wait for the first NIC to come up before - continuing - ---- - xbmc/powermanagement/PowerManager.cpp | 24 ++++++++++++++++++++++++ - xbmc/powermanagement/PowerManager.h | 2 ++ - 2 files changed, 26 insertions(+) - -diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index a68910b..8e93492 100644 ---- a/xbmc/powermanagement/PowerManager.cpp -+++ b/xbmc/powermanagement/PowerManager.cpp -@@ -207,6 +207,8 @@ void CPowerManager::OnWake() - { - CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); - -+ WaitForNic(); -+ - // reset out timers - g_application.ResetShutdownTimers(); - -@@ -254,3 +256,25 @@ void CPowerManager::OnLowBattery() - - CAnnouncementManager::Announce(System, "xbmc", "OnLowBattery"); - } -+ -+void CPowerManager::WaitForNic() -+{ -+ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); -+ -+ const unsigned maxLoopCount = 50u; -+ const unsigned sleepTimeMs = 200u; -+ -+ for(unsigned i=0; i < maxLoopCount; ++i) -+ { -+ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); -+ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) -+ { -+ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); -+ return; -+ } -+ -+ Sleep(sleepTimeMs); -+ } -+ -+ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); -+} -diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h -index deb4b66..476cdc1 100644 ---- a/xbmc/powermanagement/PowerManager.h -+++ b/xbmc/powermanagement/PowerManager.h -@@ -73,6 +73,8 @@ class CPowerManager : public IPowerEventsCallback - - void OnLowBattery(); - -+ void WaitForNic(); -+ - IPowerSyscall *m_instance; - }; - --- -1.8.4 - From 810b0da1902d58b76393b1db7e34ecc6aebf57da Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 17 Sep 2013 13:05:58 +0300 Subject: [PATCH 16/19] .cache/openelec is a dir. a not file .. so create it via tmpfiles.d + trailing / to default service configs. or very bad thing happens. --- packages/network/avahi/system.d/avahi-defaults.service | 2 +- packages/network/samba/system.d.opt/samba-defaults.service | 2 +- packages/sysutils/busybox/system.d.opt/cron-defaults.service | 2 +- packages/sysutils/busybox/tmpfiles.d/busybox.conf | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/network/avahi/system.d/avahi-defaults.service b/packages/network/avahi/system.d/avahi-defaults.service index 8deedac06e..2db5833be3 100644 --- a/packages/network/avahi/system.d/avahi-defaults.service +++ b/packages/network/avahi/system.d/avahi-defaults.service @@ -7,5 +7,5 @@ ConditionPathExists=!/storage/.cache/services/avahi.disabled [Service] Type=oneshot -ExecStart=/bin/sh -c 'cp /usr/share/services/avahi.conf /storage/.cache/services' +ExecStart=/bin/sh -c 'cp /usr/share/services/avahi.conf /storage/.cache/services/' RemainAfterExit=yes diff --git a/packages/network/samba/system.d.opt/samba-defaults.service b/packages/network/samba/system.d.opt/samba-defaults.service index db84326133..dcec936ff7 100644 --- a/packages/network/samba/system.d.opt/samba-defaults.service +++ b/packages/network/samba/system.d.opt/samba-defaults.service @@ -7,5 +7,5 @@ ConditionPathExists=!/storage/.cache/services/samba.disabled [Service] Type=oneshot -ExecStart=/bin/sh -c 'cp /usr/share/services/samba.conf /storage/.cache/services' +ExecStart=/bin/sh -c 'cp /usr/share/services/samba.conf /storage/.cache/services/' RemainAfterExit=yes diff --git a/packages/sysutils/busybox/system.d.opt/cron-defaults.service b/packages/sysutils/busybox/system.d.opt/cron-defaults.service index 0ce24d37c9..fdd14e95bd 100644 --- a/packages/sysutils/busybox/system.d.opt/cron-defaults.service +++ b/packages/sysutils/busybox/system.d.opt/cron-defaults.service @@ -7,5 +7,5 @@ ConditionPathExists=!/storage/.cache/services/crond.disabled [Service] Type=oneshot -ExecStart=/bin/sh -c 'cp /usr/share/services/crond.conf /storage/.cache/services' +ExecStart=/bin/sh -c 'cp /usr/share/services/crond.conf /storage/.cache/services/' RemainAfterExit=yes diff --git a/packages/sysutils/busybox/tmpfiles.d/busybox.conf b/packages/sysutils/busybox/tmpfiles.d/busybox.conf index 5215035410..7aa19f932a 100644 --- a/packages/sysutils/busybox/tmpfiles.d/busybox.conf +++ b/packages/sysutils/busybox/tmpfiles.d/busybox.conf @@ -26,3 +26,4 @@ d /var/media 0755 root root - - d /var/run 1777 root root - - f /var/run/utmp 1777 root root - - +d /storage/.cache/services 0755 root root - - From 7ebdcddb0d6c038c2cb76667f2fe4f912801f4c8 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 17 Sep 2013 17:10:00 +0300 Subject: [PATCH 17/19] scripts/create_addon: support PKG_CUSTOM_ADDON_VERSION use with care. could be tricky and you can easily break addon autoupdates.. --- scripts/create_addon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/create_addon b/scripts/create_addon index d72b7c0cb0..383d9659a2 100755 --- a/scripts/create_addon +++ b/scripts/create_addon @@ -74,6 +74,9 @@ if [ -f $PKG_DIR/addon ]; then else CUST_ADDON_VERSION="$PKG_VERSION" fi + if [ ! -z "$PKG_CUSTOM_ADDON_VERSION" ] ; then + CUST_ADDON_VERSION="$PKG_CUSTOM_ADDON_VERSION" + fi if [ -f $PKG_DIR/source/default.py ]; then cp -R $PKG_DIR/source/* $ADDON_BUILD/$PKG_ADDON_ID From e0b603ccfa4daf502b5f4d2e44edbdb14c7f31e8 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 17 Sep 2013 21:08:41 +0300 Subject: [PATCH 18/19] wlan-firmware: update to wlan-firmware-0.0.14 --- packages/linux-firmware/wlan-firmware/meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/linux-firmware/wlan-firmware/meta b/packages/linux-firmware/wlan-firmware/meta index 4ec73ad0fe..2cb551ffac 100644 --- a/packages/linux-firmware/wlan-firmware/meta +++ b/packages/linux-firmware/wlan-firmware/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="wlan-firmware" -PKG_VERSION="0.0.13" +PKG_VERSION="0.0.14" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="Free-to-use" From ab88416a94ffec51c5494ea0930db4d47ee131ee Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Tue, 17 Sep 2013 21:23:01 +0300 Subject: [PATCH 19/19] xbmc: rename and update wait-for-nic patch --- .../xbmc-990.24-wait-for-nic-on-wakeup.patch | 60 --------------- ...nd-wait-for-the-first-NIC-to-come-up.patch | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 60 deletions(-) delete mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch create mode 100644 packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch deleted file mode 100644 index a75dba87e4..0000000000 --- a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.24-wait-for-nic-on-wakeup.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp -index 26d7002..71c4bd4 100644 ---- a/xbmc/powermanagement/PowerManager.cpp -+++ b/xbmc/powermanagement/PowerManager.cpp -@@ -23,6 +23,7 @@ - #include "Application.h" - #include "cores/AudioEngine/AEFactory.h" - #include "input/KeyboardStat.h" -+#include "network/Network.h" - #include "settings/GUISettings.h" - #include "windowing/WindowingFactory.h" - #include "utils/log.h" -@@ -218,10 +219,34 @@ void CPowerManager::OnSleep() - CAEFactory::Suspend(); - } - -+void CPowerManager::WaitForNet() -+{ -+ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); -+ -+ const unsigned maxLoopCount = 50u; -+ const unsigned sleepTimeMs = 200u; -+ -+ for(unsigned i=0; i < 50; ++i) -+ { -+ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); -+ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) -+ { -+ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); -+ return; -+ } -+ -+ Sleep(sleepTimeMs); -+ } -+ -+ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); -+} -+ - void CPowerManager::OnWake() - { - CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); - -+ WaitForNet(); -+ - // reset out timers - g_application.ResetShutdownTimers(); - -diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h -index 0a9183c..714b5cc 100644 ---- a/xbmc/powermanagement/PowerManager.h -+++ b/xbmc/powermanagement/PowerManager.h -@@ -72,6 +72,8 @@ private: - - void OnLowBattery(); - -+ void WaitForNet(); -+ - IPowerSyscall *m_instance; - }; - diff --git a/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch new file mode 100644 index 0000000000..8cf2528f23 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/12.2-091cb29/xbmc-990.30-After-suspend-wait-for-the-first-NIC-to-come-up.patch @@ -0,0 +1,74 @@ +From 7cd450bb2b8ea18277efff955202bf3b36573898 Mon Sep 17 00:00:00 2001 +From: verybadsoldier +Date: Sun, 1 Sep 2013 17:10:19 +0200 +Subject: [PATCH] After suspend wait for the first NIC to come up before + continuing + +--- + xbmc/powermanagement/PowerManager.cpp | 24 ++++++++++++++++++++++++ + xbmc/powermanagement/PowerManager.h | 2 ++ + 2 files changed, 26 insertions(+) + +diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp +index a68910b..8e93492 100644 +--- a/xbmc/powermanagement/PowerManager.cpp ++++ b/xbmc/powermanagement/PowerManager.cpp +@@ -23,6 +23,7 @@ + #include "Application.h" + #include "cores/AudioEngine/AEFactory.h" + #include "input/KeyboardStat.h" ++#include "network/Network.h" + #include "settings/GUISettings.h" + #include "windowing/WindowingFactory.h" + #include "utils/log.h" +@@ -207,6 +207,8 @@ void CPowerManager::OnWake() + { + CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__); + ++ WaitForNic(); ++ + // reset out timers + g_application.ResetShutdownTimers(); + +@@ -254,3 +256,25 @@ void CPowerManager::OnLowBattery() + + CAnnouncementManager::Announce(System, "xbmc", "OnLowBattery"); + } ++ ++void CPowerManager::WaitForNic() ++{ ++ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__); ++ ++ const unsigned maxLoopCount = 50u; ++ const unsigned sleepTimeMs = 200u; ++ ++ for(unsigned i=0; i < maxLoopCount; ++i) ++ { ++ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface(); ++ if (pIface && pIface->IsEnabled() && pIface->IsConnected()) ++ { ++ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs); ++ return; ++ } ++ ++ Sleep(sleepTimeMs); ++ } ++ ++ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs); ++} +diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h +index deb4b66..476cdc1 100644 +--- a/xbmc/powermanagement/PowerManager.h ++++ b/xbmc/powermanagement/PowerManager.h +@@ -73,6 +73,8 @@ class CPowerManager : public IPowerEventsCallback + + void OnLowBattery(); + ++ void WaitForNic(); ++ + IPowerSyscall *m_instance; + }; + +-- +1.8.4 +