mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
scripts/image: add initial NOOBS support
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
d15f86876e
commit
f81e4c5c43
3
Makefile
3
Makefile
@ -8,6 +8,9 @@ system:
|
||||
release:
|
||||
./scripts/image release
|
||||
|
||||
noobs:
|
||||
./scripts/image noobs
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIRS)/* $(BUILD_DIRS)/.stamps
|
||||
|
||||
|
7
config/noobs/os.json
Normal file
7
config/noobs/os.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@DISTRONAME@",
|
||||
"version": "@OPENELEC_VERSION@",
|
||||
"release_date": "@RELEASE_DATE@",
|
||||
"kernel": "@KERNEL_VERSION@",
|
||||
"description": "@DESCRIPTION@"
|
||||
}
|
69
config/noobs/partition_setup.sh
Executable file
69
config/noobs/partition_setup.sh
Executable file
@ -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
|
20
config/noobs/partitions.json
Normal file
20
config/noobs/partitions.json
Normal file
@ -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": ""
|
||||
}
|
||||
],
|
||||
}
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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 #"
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user