Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from CHBMB/V6.4.0
Browse files Browse the repository at this point in the history
V6.4.0 Scripts
  • Loading branch information
CHBMB authored Jun 6, 2017
2 parents ba208b4 + ab2d827 commit 72bde34
Show file tree
Hide file tree
Showing 9 changed files with 257 additions and 291 deletions.
57 changes: 0 additions & 57 deletions build_scripts/ceton-module.sh

This file was deleted.

71 changes: 34 additions & 37 deletions build_scripts/dd-module.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@

#!/bin/bash

###Run kernel_compile.sh prior to running a module###

##Pull variables from github
##Pull variables from github
wget -nc https://raw.githubusercontent.com/CHBMB/Unraid-DVB/master/files/variables.sh
. "$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"/variables.sh

##Remove any files remaining in /lib/modules/ & /lib/firmware/
cd $D
find /lib/modules/$(uname -r) -type f -exec rm -rf {} \;
find /lib/firmware -type f -exec rm -rf {} \;

#Restore default /lib/modules/ & /lib/firmware/
rsync -av $D/lib/modules/$(uname -r)/ /lib/modules/$(uname -r)/
rsync -av $D/lib/firmware/ /lib/firmware/

#Create bzroot-ddgit files from master
rsync -avr $D/bzroot-master-$VERSION/ $D/bzroot-dd
##Restore /lib/modules/ & /lib/firmware/
umount -l /lib/modules/
umount -l /lib/firmware/
rm -rf /lib/modules
rm -rf /lib/firmware
mkdir /lib/modules
mkdir /lib/firmware
mount /boot/bzmodules /lib/modules -t squashfs -o loop
mount /boot/bzfirmware /lib/firmware -t squashfs -o loop

##Unmount bzmodules and make rw
cp -r /lib/modules /tmp
umount -l /lib/modules/
rm -rf /lib/modules
mv -f /tmp/modules /lib

##Unount bzfirmware and make rw
cp -r /lib/firmware /tmp
umount -l /lib/firmware/
rm -rf /lib/firmware
mv -f /tmp/firmware /lib

##Digital Devices Github
cd /usr/src/
Expand All @@ -28,37 +35,27 @@ tar -xf $DD.tar.gz
cd dddvb-$DD
make
make install
mkdir -p $D/bzroot-dd/etc/depmod.d
echo 'search extra updates built-in' | tee $D/bzroot-dd/etc/depmod.d/extra.conf
depmod -a

#Copy firmware to bzroot
find /lib/modules/$(uname -r) -type f -exec cp -r --parents '{}' $D/bzroot-dd/ \;
find /lib/firmware/ -type f -exec cp -r --parents '{}' $D/bzroot-dd/ \;

#Create /etc/unraid-media to identify type of mediabuild and copy to bzroot
echo base=\"Digital Devices \(Github\)\" > $D/bzroot-dd/etc/unraid-media
echo driver=\"$DD\" >> $D/bzroot-dd/etc/unraid-media
echo base=\"Digital Devices \(Github\)\" > /lib/firmware/unraid-media
echo driver=\"$DD\" >> /lib/firmware/unraid-media

#Copy /etc/unraid-media to identify type of mediabuild to destination folder
mkdir -p $D/$VERSION/dd/
cp $D/bzroot-dd/etc/unraid-media $D/$VERSION/dd/

#Package Up bzroot
cd $D/bzroot-dd
find . | cpio -o -H newc | xz --format=lzma > $D/$VERSION/dd/bzroot
cp /lib/firmware/unraid-media $D/$VERSION/dd/

#Package Up bzimage
cp -f $D/kernel/arch/x86/boot/bzImage $D/$VERSION/dd/bzimage

#Copy default bzroot-gui
cp -f $D/unraid/bzroot-gui $D/$VERSION/dd/bzroot-gui
##Make new bzmodules and bzfirmware
mksquashfs /lib/modules $D/$VERSION/dd/bzmodules -noappend
mksquashfs /lib/firmware $D/$VERSION/dd/bzfirmware -noappend

#MD5 calculation of files
cd $D/$VERSION/dd/
md5sum bzroot > bzroot.md5
md5sum bzimage > bzimage.md5
md5sum bzroot-gui > bzroot-gui.md5
md5sum bzmodules > bzmodules.md5
md5sum bzfirmware > bzfirmware.md5

#Copy necessary stock files
cp $D/$VERSION/stock/bzimage* $D/$VERSION/dd/
cp $D/$VERSION/stock/bzroot* $D/$VERSION/dd/

#Return to original directory
cd $D
76 changes: 46 additions & 30 deletions build_scripts/kernel-compile-module.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash

##Clean up working directory
rm -rf $D/bzroot-dd $D/bzroot-libreelec $D/bzroot-tbs-* $D/kernel $D/lib $D/libreelec-drivers $D/packages $D/tbs-drivers-* $D/unraid $D/FILE_LIST $D/linux-*.tar.xz $D/unRAIDServer-*.zip $D/URLS $D/variables.sh
##This will create a base UnraidDVB bzmodules & bzfirmware named bzmodules-new and bzfirmware-new

##Pull variables from github
wget -nc https://raw.githubusercontent.com/CHBMB/Unraid-DVB/master/files/variables.sh
. "$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"/variables.sh

##Install packages
[ ! -d "$D/packages" ] && mkdir $D/packages
wget -nc -P $D/packages -i $D/URLS_CURRENT
installpkg $D/packages/*.*

#Download patchutils & Proc-ProcessTable
mkdir $D/packages
cd $D/packages
Expand All @@ -16,15 +19,17 @@ wget -nc https://github.com/CHBMB/Unraid-DVB/raw/master/files/Proc-ProcessTable-
#Change to current directory
cd $D

##Install pkg modules
[ ! -d "$D/packages" ] && mkdir $D/packages
wget -nc -P $D/packages -i $D/URLS_CURRENT
wget -nc -P $D/packages -i $D/URLS_142
installpkg $D/packages/*.*

##Instal perl-process-table for CrazyCat
#export PERL_MM_USE_DEFAULT=1
#cpan> install Proc::ProcessTable
##Unmount bzmodules and make rw
cp -r /lib/modules /tmp
umount -l /lib/modules/
rm -rf /lib/modules
mv -f /tmp/modules /lib

##Unount bzfirmware and make rw
cp -r /lib/firmware /tmp
umount -l /lib/firmware/
rm -rf /lib/firmware
mv -f /tmp/firmware /lib

##Download and Install Kernel
[[ $(uname -r) =~ ([0-9.]*) ]] && KERNEL=${BASH_REMATCH[1]} || return 1
Expand All @@ -41,7 +46,7 @@ cd $D

##Make menuconfig
cd $D
wget https://files.linuxserver.io/unraid-dvb/$VERSION/stock/.config
wget https://files.linuxserver.io/unraid-dvb-rc/$VERSION/stock/.config
cd $D/kernel
if [ -e $D/.config ]; then
rm -f .config
Expand All @@ -60,40 +65,51 @@ make all modules_install install

##Download Unraid
cd $D
wget -nc http://dnld.lime-technology.com/stable/unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip
if [ -e $D/unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip]; then
unzip unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip -d $D/unraid
unzip unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip -d $D/unraid
else
wget -nc http://dnld.lime-technology.com/next/unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip
unzip unRAIDServer-"$(grep -o '".*"' /etc/unraid-version | sed 's/"//g')"-x86_64.zip -d $D/unraid
fi

##Extract bzroot
rm -rf $D/bzroot-master-$VERSION; mkdir $D/bzroot-master-$VERSION; cd $D/bzroot-master-$VERSION
xzcat $D/unraid/bzroot | cpio -i -d -H newc --no-absolute-filenames

##Copy default Mediabuild Kernel Modules to bzroot
cd $D/kernel/
make modules_install
find /lib/modules/$(uname -r) -type f -exec cp -r --parents '{}' $D/bzroot-master-$VERSION/ \;

##Backup /lib/modules/ & /lib/firmware/
find /lib/modules/$(uname -r) -type f -exec cp -r --parents '{}' $D/ \;
find /lib/firmware -type f -exec cp -r --parents '{}' $D/ \;

##Copy default Unraid bz files to folder prior to uploading
mkdir -p $D/$VERSION/stock/
cp -f $D/unraid/bzimage $D/$VERSION/stock/
cp -f $D/unraid/bzroot $D/$VERSION/stock/
cp -f $D/unraid/bzroot-gui $D/$VERSION/stock/
cp -f $D/unraid/bzmodules $D/$VERSION/stock/
cp -f $D/unraid/bzfirmware $D/$VERSION/stock/
cp -f $D/kernel/.config $D/$VERSION/stock/

##Calculate md5 on stock files
cd $D/$VERSION/stock/
md5sum bzroot > bzroot.md5
md5sum bzimage > bzimage.md5
md5sum bzroot > bzroot.md5
md5sum bzroot-gui > bzroot-gui.md5
md5sum bzmodules > bzmodules.md5
md5sum bzfirmware > bzfirmware.md5
md5sum .config > .config.md5

#Return to original directory
##Make new bzmodules and bzfirmware - overwriting existing
mksquashfs /lib/modules /boot/bzmodules -noappend
mksquashfs /lib/firmware /boot/bzfirmware -noappend

##Copy new bzfirmware & bzmodule to stock
cp -f $D/boot/bzmodules $D/$VERSION/stock/bzmodules-new
cp -f $D/boot/bzfirmware $D/$VERSION/stock/bzfirmware-new

##Calculate md5 on new bzfirmware & bzmodules
cd $D/$VERSION/stock/
md5sum bzmodules-new > bzmodules-new.md5
md5sum bzfirmware-new > bzfirmware-new.md5

##Return to original directory
cd $D

##Update bzmodules & bzfirmware to DVB
rm -rf /lib/modules
rm -rf /lib/firmware
mkdir /lib/modules
mkdir /lib/firmware
mount /boot/bzmodules /lib/firmware -t squashfs -o loop
mount /boot/bzfirmware /lib/firmware -t squashfs -o loo
75 changes: 38 additions & 37 deletions build_scripts/libreelec-module.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#!/bin/bash

###Run kernel_compile.sh prior to running a module###

##Pull variables from github
##Pull variables from github
wget -nc https://raw.githubusercontent.com/CHBMB/Unraid-DVB/master/files/variables.sh
. "$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"/variables.sh

##Remove any files remaining in /lib/modules/ & /lib/firmware/
cd $D
find /lib/modules/$(uname -r) -type f -exec rm -rf {} \;
find /lib/firmware -type f -exec rm -rf {} \;

#Restore default /lib/modules/ & /lib/firmware/
rsync -av $D/lib/modules/$(uname -r)/ /lib/modules/$(uname -r)/
rsync -av $D/lib/firmware/ /lib/firmware/

#Create bzroot-libreelec files from master
rsync -avr $D/bzroot-master-$VERSION/ $D/bzroot-libreelec
##Restore /lib/modules/ & /lib/firmware/
umount -l /lib/modules/
umount -l /lib/firmware/
rm -rf /lib/modules
rm -rf /lib/firmware
mkdir /lib/modules
mkdir /lib/firmware
mount /boot/bzmodules /lib/modules -t squashfs -o loop
mount /boot/bzfirmware /lib/firmware -t squashfs -o loop

##Unmount bzmodules and make rw
cp -r /lib/modules /tmp
umount -l /lib/modules/
rm -rf /lib/modules
mv -f /tmp/modules /lib

##Unount bzfirmware and make rw
cp -r /lib/firmware /tmp
umount -l /lib/firmware/
rm -rf /lib/firmware
mv -f /tmp/firmware /lib

##libreelec Mediabuild
cd $D
Expand All @@ -25,36 +33,29 @@ cd libreelec-drivers
wget -nc https://github.com/LibreELEC/dvb-firmware/archive/$LE.tar.gz
tar xvf $LE.tar.gz

#Copy firmware to bzroot
find /lib/modules/$(uname -r) -type f -exec cp -r --parents '{}' $D/bzroot-libreelec/ \;
find /lib/firmware/ -type f -exec cp -r --parents '{}' $D/bzroot-libreelec/ \;
#Copy firmware to /lib/firmware
rsync -av $D/libreelec-drivers/dvb-firmware-$LE/firmware/ /lib/firmware/

#Copy firmware to bzroot
rsync -av $D/libreelec-drivers/dvb-firmware-$LE/firmware/ $D/bzroot-libreelec/lib/firmware/
#Create /lib/firmware/unraid-media to identify type of mediabuild
echo base=\"LibreELEC\" > /lib/firmware/unraid-media
echo driver=\"$LE\" >> /lib/firmware/unraid-media

#Create /etc/unraid-media to identify type of mediabuild and copy to bzroot
echo base=\"LibreELEC\" > $D/bzroot-libreelec/etc/unraid-media
echo driver=\"$LE\" >> $D/bzroot-libreelec/etc/unraid-media

#Copy /etc/unraid-media to identify type of mediabuild to destination folder
#Copy /lib/firmware/unraid-media to identify type of mediabuild to destination folder
mkdir -p $D/$VERSION/libreelec/
cp $D/bzroot-libreelec/etc/unraid-media $D/$VERSION/libreelec/

#Package Up bzroot
cd $D/bzroot-libreelec
find . | cpio -o -H newc | xz --format=lzma > $D/$VERSION/libreelec/bzroot
cp /lib/firmware/unraid-media $D/$VERSION/libreelec/

#Package Up bzimage
cp -f $D/kernel/arch/x86/boot/bzImage $D/$VERSION/libreelec/bzimage

#Copy default bzroot-gui
cp -f $D/unraid/bzroot-gui $D/$VERSION/libreelec/bzroot-gui
##Make new bzmodules and bzfirmware
mksquashfs /lib/firmware $D/$VERSION/libreelec/bzfirmware -noappend
cp /boot/bzmodules $D/$VERSION/libreelec/bzmodules

#MD5 calculation of files
cd $D/$VERSION/libreelec/
md5sum bzroot > bzroot.md5
md5sum bzimage > bzimage.md5
md5sum bzroot-gui > bzroot-gui.md5
md5sum bzmodules > bzmodules.md5
md5sum bzfirmware > bzfirmware.md5

#Copy necessary stock files
cp $D/$VERSION/stock/bzimage* $D/$VERSION/libreelec/
cp $D/$VERSION/stock/bzroot* $D/$VERSION/libreelec/

#Return to original directory
cd $D
Loading

0 comments on commit 72bde34

Please sign in to comment.