diff --git a/Makefile b/Makefile index eb6d627dae..621a67b99a 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ system: release: ./scripts/image release +noobs: + ./scripts/image noobs + clean: rm -rf $(BUILD_DIRS)/* $(BUILD_DIRS)/.stamps diff --git a/config/noobs/os.json b/config/noobs/os.json new file mode 100644 index 0000000000..138711e799 --- /dev/null +++ b/config/noobs/os.json @@ -0,0 +1,7 @@ +{ + "name": "@DISTRONAME@", + "version": "@OPENELEC_VERSION@", + "release_date": "@RELEASE_DATE@", + "kernel": "@KERNEL_VERSION@", + "description": "@DESCRIPTION@" +} diff --git a/config/noobs/partition_setup.sh b/config/noobs/partition_setup.sh new file mode 100755 index 0000000000..7f6ace2da7 --- /dev/null +++ b/config/noobs/partition_setup.sh @@ -0,0 +1,69 @@ +#!/bin/sh -x +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2013 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 +################################################################################ + +MOUNTPOINT="/tmp/OpenELEC-System" + +md5sumCheck() { + ( cd $MOUNTPOINT + echo "checking MD5: $1" + md5sum -c $1.md5 + if [ "$?" = "1" ]; then + echo "######################################################" + echo "# #" + echo "# OpenELEC failed md5 check - Installation will quit #" + echo "# #" + echo "# Your original download was probably corrupt. #" + echo "# Please visit www.openelec.tv and get another copy #" + echo "# #" + echo "######################################################" + exit 1 + fi + rm -rf $1.md5 + ) +} + +if [ -z $part1 -o -z $part2 -o -z $id1 -o -z $id2]; then + echo "error: part1, part2, id1 or id2 not specified" + echo "actual values:" + echo "part1:" $part1 + echo "part2:" $part2 + echo "id1 :" $id1 + echo "id2 :" $id2 + exit 1 +fi + +# create mountpoint + mkdir -p $MOUNTPOINT + +# mount needed partition + mount $part1 $MOUNTPOINT + +# check md5sum + md5sumCheck kernel.img + md5sumCheck SYSTEM + +# create bootloader configuration + echo "creating bootloader configuration..." + echo "boot=$id1 disk=$id2 quiet" > $MOUNTPOINT/cmdline.txt + +# cleanup mountpoint + umount $MOUNTPOINT + rmdir $MOUNTPOINT diff --git a/config/noobs/partitions.json b/config/noobs/partitions.json new file mode 100644 index 0000000000..e91964f1fb --- /dev/null +++ b/config/noobs/partitions.json @@ -0,0 +1,20 @@ +{ + "partitions": [ + { + "label": "System", + "filesystem_type": "FAT", + "partition_size_nominal: "128", + "want_maximised": "false", + "uncompressed_tarball_size": 128, + "mkfs_options": "" + }, + { + "label": "Storage", + "filesystem_type": "ext4", + "partition_size_nominal: "864", + "want_maximised": "true", + "uncompressed_tarball_size": 512, + "mkfs_options": "" + } + ], +} diff --git a/projects/ARCTIC_MC/options b/projects/ARCTIC_MC/options index d46e85fcc3..71c075f34a 100755 --- a/projects/ARCTIC_MC/options +++ b/projects/ARCTIC_MC/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/ATV/options b/projects/ATV/options index 3668febef9..4080518154 100755 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/Fusion/options b/projects/Fusion/options index 992872a711..1dd72b080a 100755 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/Generic/options b/projects/Generic/options index 9e50d1a50b..f31c79b5f1 100755 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options index 9b21c63328..0d96b77703 100755 --- a/projects/Generic_OSS/options +++ b/projects/Generic_OSS/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/ION/options b/projects/ION/options index 9019a682f1..d6240a4a55 100755 --- a/projects/ION/options +++ b/projects/ION/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/Intel/options b/projects/Intel/options index 4b0445ec77..dbf4a567a3 100755 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/RPi/options b/projects/RPi/options index 66ecdee32d..68e0e7da6f 100755 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/projects/Virtual/options b/projects/Virtual/options index 6e1716cc4d..2412d393d2 100755 --- a/projects/Virtual/options +++ b/projects/Virtual/options @@ -4,6 +4,9 @@ DISTRONAME="${DISTRONAME}_Gotham" fi +# short project description + DESCRIPTION="OpenELEC is the fastest, smallest and most userfriendly XBMC Mediacenter appliance distribution with official support from XBMC.org" + # Welcome Message for e.g. SSH Server (up to 5 Lines) GREETING0="##############################################" GREETING1="# OpenELEC - The living room PC for everyone #" diff --git a/scripts/image b/scripts/image index 64b92b4939..e382cd55d6 100755 --- a/scripts/image +++ b/scripts/image @@ -274,4 +274,82 @@ IMAGE_NAME="$DISTRONAME-$TARGET_VERSION" # cleanup release dir rm -rf $RELEASE_DIR + + elif [ "$1" = "noobs" ]; then + + RELEASE_DIR="$TARGET_IMG/${IMAGE_NAME}-$1" + + # cleanup + rm -rf $RELEASE_DIR + + # create release dir + mkdir -p $RELEASE_DIR + + cp -PR $ROOT/config/$1/* $RELEASE_DIR + + cp $ROOT/README* $RELEASE_DIR + cp $ROOT/CHANGELOG $RELEASE_DIR/release_notes.txt + cp -R $CONFIG/release/openelec.ico $RELEASE_DIR + + + sed -e "s%@DISTRONAME@%$DISTRONAME%g" \ + -e "s%@OPENELEC_VERSION@%$OPENELEC_VERSION%g" \ + -e "s%@RELEASE_DATE@%$(date +%F)%g" \ + -e "s%@KERNEL_VERSION@%$(echo $(basename $BUILD/linux-*) | awk -F - '{print $2}')%g" \ + -e "s%@DESCRIPTION@%$DESCRIPTION%g" \ + -i $RELEASE_DIR/os.json + + # create System dir + mkdir -p $RELEASE_DIR/System + + BOOTLOADER_DIR=`find $PACKAGES -type d -name $BOOTLOADER 2>/dev/null` + if [ -d "$BOOTLOADER_DIR"/files/3rdparty/bootloader/ ]; then + cp -PR $BOOTLOADER_DIR/files/3rdparty/bootloader/* $RELEASE_DIR/System + fi + + # copy Bootloader + cp -PR $BUILD/bcm2835-bootloader-*/LICENCE* $RELEASE_DIR/System/ + cp -PR $BUILD/bcm2835-bootloader-*/bootcode.bin $RELEASE_DIR/System/ + cp -PR $BUILD/bcm2835-bootloader-*/fixup_x.dat $RELEASE_DIR/System/fixup.dat + cp -PR $BUILD/bcm2835-bootloader-*/start_x.elf $RELEASE_DIR/System/start.elf + + # copy system files + cp $TARGET_IMG/$IMAGE_NAME.system $RELEASE_DIR/System/SYSTEM + cp $TARGET_IMG/$IMAGE_NAME.kernel $RELEASE_DIR/System/kernel.img + + # create md5sum's + ( cd $RELEASE_DIR/System; + md5sum -t SYSTEM > SYSTEM.md5; + md5sum -t kernel.img > kernel.img.md5; + ) + + # copy additional files + cp -R $CONFIG/release/openelec.ico $RELEASE_DIR/System + mkdir -p $RELEASE_DIR/System/licenses + cp $ROOT/licenses/* $RELEASE_DIR/System/licenses + + # create Storage dir + mkdir -p $RELEASE_DIR/Storage + + # remove an previous created release tarball + rm -rf $RELEASE_DIR/System.tar.gz + rm -rf $RELEASE_DIR/Storage.tar.gz + + # create filesystem tarballs + tar czf $RELEASE_DIR/System.tar.gz -C $RELEASE_DIR/System/ . + tar czf $RELEASE_DIR/Storage.tar.gz -C $RELEASE_DIR/Storage/ . + + # remove an filesystem dirs + rm -rf $RELEASE_DIR/System + rm -rf $RELEASE_DIR/Storage + + # remove an previous created release tarball + rm -rf $TARGET_IMG/${IMAGE_NAME}-$1.tar + + # create release tarball + tar cf $TARGET_IMG/${IMAGE_NAME}-$1.tar -C $TARGET ${IMAGE_NAME}-$1 + + # cleanup release dir + rm -rf $RELEASE_DIR fi +