diff --git a/packages/image/install b/packages/image/install deleted file mode 100755 index 4ab591bc6e..0000000000 --- a/packages/image/install +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/sh - -. config/options $1 - -$SCRIPTS/checkdeps build - -if [ "$OPENELEC_VERSION" = devel -o "$OPENELEC_VERSION" = debug ]; then - BUILD_DATE=`date +%Y%m%d` - GIT_BUILD=`git log --pretty=format:'' | wc -l` - OPENELEC_VERSION=$OPENELEC_VERSION-$BUILD_DATE-r$GIT_BUILD -fi - -TARGET_VERSION="$PROJECT.$TARGET_ARCH-$OPENELEC_VERSION" - -case "$2" in - system) - - $SCRIPTS/install squashfs - $SCRIPTS/build fakeroot - - export INSTALL=$BUILD/$1/$2 - - rm -rf $FAKEROOT_SCRIPT # remove $FAKEROOT_SCRIPT if it exist - touch $FAKEROOT_SCRIPT # create an empty $FAKEROOT_SCRIPT - chmod +x $FAKEROOT_SCRIPT # make $FAKEROOT_SCRIPT executable - echo "chown -R 0:0 $INSTALL" >> $FAKEROOT_SCRIPT - - rm -rf $INSTALL - mkdir -p $INSTALL - - mkdir -p $INSTALL/bin - mkdir -p $INSTALL/etc - mkdir -p $INSTALL/lib - mkdir -p $INSTALL/sbin - mkdir -p $INSTALL/dev - mkdir -p $INSTALL/proc - mkdir -p $INSTALL/sys - mkdir -p $INSTALL/usr - mkdir -p $INSTALL/var - mkdir -p $INSTALL/flash - mkdir -p $INSTALL/storage - - ln -sf /var $INSTALL/usr/var - ln -sf /var/tmp $INSTALL/tmp - ln -sf /var/media $INSTALL/media - - if [ $TARGET_ARCH = x86_64 -o $TARGET_ARCH = powerpc64 ]; then - ln -s /lib $INSTALL/lib64 - ln -s lib $INSTALL/usr/lib64 - fi - -# copy project related files to filesystem - if [ -d $PROJECT_DIR/$PROJECT/filesystem ]; then - cp -PR $PROJECT_DIR/$PROJECT/filesystem/* $INSTALL - fi - -# Basissystem... - $SCRIPTS/install eglibc - $SCRIPTS/install gcc-final - $SCRIPTS/install linux $2 - $SCRIPTS/install busybox - $SCRIPTS/install acpid - $SCRIPTS/install util-linux-ng - - echo "OpenELEC" > $INSTALL/etc/distribution - echo "$PROJECT.$TARGET_ARCH" > $INSTALL/etc/arch - echo "$OPENELEC_VERSION" > $INSTALL/etc/version - echo "OpenELEC.tv - Date of build: $BUILD_DATE Build: $BZR_BUILD" > $INSTALL/etc/openelec-release - -# Network support - [ "$NETWORK" = yes ] && $SCRIPTS/install network - -# Transmission BitTorrent support - [ "$TRANSMISSION" = yes ] && $SCRIPTS/install transmission - -# Graphic support - [ ! "$DISPLAYSERVER" = no ] && $SCRIPTS/install $DISPLAYSERVER - -# Multimedia support - [ ! "$MEDIACENTER" = no ] && $SCRIPTS/install mediacenter - -# Automounter support - [ "$UDISKS" = yes ] && $SCRIPTS/install udisks - -# Powermanagement support - [ "$UPOWER" = yes ] && $SCRIPTS/install upower - [ "$UPOWER" = yes ] && $SCRIPTS/install ConsoleKit - -# NTFS 3G support - [ "$NTFS3G" = yes ] && $SCRIPTS/install ntfs-3g - -# Remote support - [ "$REMOTE_SUPPORT" = yes ] && $SCRIPTS/install remote - -# LCD support - [ ! "$LCD_DRIVER" = none ] && $SCRIPTS/install lcdproc - -# Sensors support - [ "$SENSOR_SUPPORT" = yes ] && $SCRIPTS/install lm_sensors - -# Update support - [ "$UPDATE_SUPPORT" = yes ] && $SCRIPTS/install autoupdate - -# Update support - [ "$INSTALLER_SUPPORT" = yes ] && $SCRIPTS/install installer - -# Games and Emulators support (SDK's) - [ "$GAMES" = yes ] && $SCRIPTS/install games-sdk - [ "$EMULATORS" = yes ] && $SCRIPTS/install emulators-sdk - -# Devtools... (not for Release) - [ "$TESTING" = yes ] && $SCRIPTS/install testing - [ "$DEVTOOLS" = yes ] && $SCRIPTS/install debug - -# OEM packages - [ "$OEM_SUPPORT" = yes ] && $SCRIPTS/install oem - -# setting - echo $TARGET_VERSION > $INSTALL/etc/release - -# strip kernel modules - for MOD in `find $INSTALL/lib/modules/ -name *.ko`; do - $STRIP --strip-debug $MOD - done - - mkdir -p $TARGET_IMG - rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel - cp -PR $BUILD/linux-*/arch/x86/boot/bzImage $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel - - echo "rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.system" >> $FAKEROOT_SCRIPT -# echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $INSTALL $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend -comp lzma" >> $FAKEROOT_SCRIPT - echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $INSTALL $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend" >> $FAKEROOT_SCRIPT - $ROOT/$TOOLCHAIN/bin/fakeroot -- $FAKEROOT_SCRIPT - chmod 0644 $TARGET_IMG/OpenELEC-$TARGET_VERSION.system - rm -rf $FAKEROOT_SCRIPT - ;; - - release) - - $SCRIPTS/install image system - -# cleanup - rm -rf $BUILD/$2/OpenELEC-$TARGET_VERSION - - mkdir -p $BUILD/$2/OpenELEC-$TARGET_VERSION - cp -R $CONFIG/release/* $BUILD/$2/OpenELEC-$TARGET_VERSION - echo "$TARGET_VERSION" > $BUILD/$2/OpenELEC-$TARGET_VERSION/RELEASE - cp $ROOT/CHANGELOG $BUILD/$2/OpenELEC-$TARGET_VERSION - - mkdir -p $BUILD/$2/OpenELEC-$TARGET_VERSION/licenses - cp $ROOT/licenses/* $BUILD/$2/OpenELEC-$TARGET_VERSION/licenses - - mkdir -p $BUILD/$2/OpenELEC-$TARGET_VERSION/target - cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.system $BUILD/$2/OpenELEC-$TARGET_VERSION/target/SYSTEM - cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel $BUILD/$2/OpenELEC-$TARGET_VERSION/target/KERNEL - -# create release directory - mkdir -p $TARGET_IMG - -# remove an previous created release tarball - rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2 - tar cjf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2 -C $BUILD/$2 OpenELEC-$TARGET_VERSION - ;; - - addons) - - export INSTALL=$BUILD/$1/$2 - - $SCRIPTS/install emulators addons - $SCRIPTS/install games addons - ;; - - qemu) - - $SCRIPTS/install image system - - mkdir -p $TARGET_IMG - rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.flash - qemu-img create -f raw $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.flash 192M - /sbin/mkfs.ext4 -L Boot -F $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.flash - - mkdir -p $ROOT/.tmp - sudo mount -o loop $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.flash $ROOT/.tmp - cp -R $TARGET_IMG/OpenELEC-$TARGET_VERSION.system $ROOT/.tmp/openelec.system - sudo umount $ROOT/.tmp - - rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.storage - qemu-img create -f raw $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.storage 1024M - /sbin/mkfs.ext4 -L Storage -F $TARGET_IMG/OpenELEC-$TARGET_VERSION-qemu.storage - - ;; - -esac diff --git a/scripts/image b/scripts/image new file mode 100755 index 0000000000..2840aaefbf --- /dev/null +++ b/scripts/image @@ -0,0 +1,108 @@ +#!/bin/sh + +. config/options $1 + +$SCRIPTS/checkdeps build + +export INSTALL=$BUILD/image/system + +get_version + +rm -rf $INSTALL +rm -rf $STAMPS_INSTALL + +mkdir -p $INSTALL + +# create baselayout + mkdir -p $INSTALL/bin + mkdir -p $INSTALL/etc + mkdir -p $INSTALL/lib + mkdir -p $INSTALL/sbin + mkdir -p $INSTALL/dev + mkdir -p $INSTALL/proc + mkdir -p $INSTALL/sys + mkdir -p $INSTALL/usr + mkdir -p $INSTALL/var + mkdir -p $INSTALL/flash + mkdir -p $INSTALL/storage + + ln -sf /var $INSTALL/usr/var + ln -sf /var/tmp $INSTALL/tmp + ln -sf /var/media $INSTALL/media + + if [ $TARGET_ARCH = x86_64 -o $TARGET_ARCH = powerpc64 ]; then + ln -s /lib $INSTALL/lib64 + ln -s lib $INSTALL/usr/lib64 + fi + + echo "OpenELEC" > $INSTALL/etc/distribution + echo "$PROJECT.$TARGET_ARCH" > $INSTALL/etc/arch + echo "$OPENELEC_VERSION" > $INSTALL/etc/version + echo "OpenELEC.tv - Date of build: $BUILD_DATE Build: $GIT_BUILD" > $INSTALL/etc/openelec-release + echo "$TARGET_VERSION" > $INSTALL/etc/release + +# copy project related files to filesystem + if [ -d $PROJECT_DIR/$PROJECT/filesystem ]; then + cp -PR $PROJECT_DIR/$PROJECT/filesystem/* $INSTALL + fi + +# Basissystem... + $SCRIPTS/install eglibc + $SCRIPTS/install gcc-final + $SCRIPTS/install linux system + $SCRIPTS/install busybox + $SCRIPTS/install acpid + $SCRIPTS/install util-linux-ng + +# Network support + [ "$NETWORK" = yes ] && $SCRIPTS/install network + +# Transmission BitTorrent support + [ "$TRANSMISSION" = yes ] && $SCRIPTS/install transmission + +# Graphic support + [ ! "$DISPLAYSERVER" = no ] && $SCRIPTS/install $DISPLAYSERVER + +# Multimedia support + [ ! "$MEDIACENTER" = no ] && $SCRIPTS/install mediacenter + +# Automounter support + [ "$UDISKS" = yes ] && $SCRIPTS/install udisks + +# Powermanagement support + [ "$UPOWER" = yes ] && $SCRIPTS/install upower + [ "$UPOWER" = yes ] && $SCRIPTS/install ConsoleKit + +# NTFS 3G support + [ "$NTFS3G" = yes ] && $SCRIPTS/install ntfs-3g + +# Remote support + [ "$REMOTE_SUPPORT" = yes ] && $SCRIPTS/install remote + +# LCD support + [ ! "$LCD_DRIVER" = none ] && $SCRIPTS/install lcdproc + +# Sensors support + [ "$SENSOR_SUPPORT" = yes ] && $SCRIPTS/install lm_sensors + +# Update support + [ "$UPDATE_SUPPORT" = yes ] && $SCRIPTS/install autoupdate + +# Update support + [ "$INSTALLER_SUPPORT" = yes ] && $SCRIPTS/install installer + +# Games and Emulators support (SDK's) + [ "$GAMES" = yes ] && $SCRIPTS/install games-sdk + [ "$EMULATORS" = yes ] && $SCRIPTS/install emulators-sdk + +# Devtools... (not for Release) + [ "$TESTING" = yes ] && $SCRIPTS/install testing + [ "$DEVTOOLS" = yes ] && $SCRIPTS/install debug + +# OEM packages + [ "$OEM_SUPPORT" = yes ] && $SCRIPTS/install oem + +# strip kernel modules + for MOD in `find $INSTALL/lib/modules/ -name *.ko`; do + $STRIP --strip-debug $MOD + done diff --git a/scripts/image_release b/scripts/image_release new file mode 100755 index 0000000000..89df2c5f29 --- /dev/null +++ b/scripts/image_release @@ -0,0 +1,35 @@ +#!/bin/sh + +. config/options $1 + +$SCRIPTS/image_squashfs + +get_version + +RELEASE_DIR="$BUILD/target/OpenELEC-$TARGET_VERSION" + +# cleanup + rm -rf $RELEASE_DIR + +# create release dir + mkdir -p $RELEASE_DIR + cp -R $CONFIG/image/* $RELEASE_DIR + cp -R $CONFIG/release/* $RELEASE_DIR + echo "$TARGET_VERSION" > $RELEASE_DIR/RELEASE + cp $ROOT/CHANGELOG $RELEASE_DIR + + mkdir -p $RELEASE_DIR/licenses + cp $ROOT/licenses/* $RELEASE_DIR/licenses + + mkdir -p $RELEASE_DIR/target + cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.system $RELEASE_DIR/target/SYSTEM + cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel $RELEASE_DIR/target/KERNEL + +# create target directory + mkdir -p $TARGET_IMG + +# remove an previous created release tarball + rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2 + +# create release tarball + tar cjf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2 -C $BUILD/target OpenELEC-$TARGET_VERSION diff --git a/scripts/image_squashfs b/scripts/image_squashfs new file mode 100755 index 0000000000..db2658c89b --- /dev/null +++ b/scripts/image_squashfs @@ -0,0 +1,25 @@ +#!/bin/sh + +. config/options $1 + +rm -rf $FAKEROOT_SCRIPT # remove $FAKEROOT_SCRIPT if it exist +touch $FAKEROOT_SCRIPT # create an empty $FAKEROOT_SCRIPT +chmod +x $FAKEROOT_SCRIPT # make $FAKEROOT_SCRIPT executable +echo "chown -R 0:0 $INSTALL" >> $FAKEROOT_SCRIPT + +$SCRIPTS/image +$SCRIPTS/build squashfs +$SCRIPTS/build fakeroot + +get_version + +mkdir -p $TARGET_IMG + rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel + cp -PR $BUILD/linux-*/arch/x86/boot/bzImage $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel + + echo "rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.system" >> $FAKEROOT_SCRIPT +# echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend -comp lzma" >> $FAKEROOT_SCRIPT + echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend" >> $FAKEROOT_SCRIPT + $ROOT/$TOOLCHAIN/bin/fakeroot -- $FAKEROOT_SCRIPT + chmod 0644 $TARGET_IMG/OpenELEC-$TARGET_VERSION.system + rm -rf $FAKEROOT_SCRIPT