Add files via upload

This commit is contained in:
gutosie
2021-03-10 15:43:55 +02:00
committed by GitHub
parent 571798db9c
commit 908e5cbe82

View File

@@ -1,136 +1,275 @@
#!/bin/sh #!/bin/sh
#script mod by gutosie #script mod by gutosie
IMAGE=/media/neoboot/ImageBoot #neo init arm
IMAGEBOOT=/media/neoboot/ImageBoot/.neonextboot
NEO=/media/neoboot
NEOBOOT=/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot
MODPROBE=/sbin/modprobe
BOXNAME=`cat /etc/hostname`
FINDBOOT=/media/*/ImageBoot/.neonextboot
CELBOOT=`cat $FINDBOOT`
if [ $CELBOOT = "Flash" ] || [ -e /tmp/.init_reboot ] ; then echo "====================================================> "
exec /sbin/init.sysvinit $1 echo " "
else echo " -=*[ NEOBOOT - BOOT UP ]*=- "
echo " NEO BOOT INIT Version: gutosie "
echo " q(-_-)p "
echo " "
echo "====================================================> "
NEODEVICE=`cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`
IMAGEKATALOG=ImageBoot
if [ -e /tmp/.init_reboot ]; then
rm /tmp/.init_reboot
break;
else
if [ -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`IMAGEKATALOG/.neonextboot ] ; then
CELBOOT=`cat $NEODEVICE$IMAGEKATALOG/.neonextboot`
if [ $CELBOOT = "Flash" ]; then
exec /sbin/init.sysvinit $*
exit 0
else
echo " "
break;
fi
fi
LIBDIR=/lib/modules/`uname -r` LIBDIR=/lib/modules/`uname -r`
if [ ! -d $LIBDIR ]; then if [ ! -d $LIBDIR ]; then
LIBDIR=/lib/modules/`ls /lib/modules | tail -n 1` LIBDIR=/lib/modules/`ls /lib/modules | tail -n 1`
fi fi
if [ `mount | grep /proc | wc -l` -lt 1 ]; then echo "Mount kernel filesystems ..."
if [ `mount | grep /proc | wc -l` -lt 1 ]; then
/bin/mount -a
/bin/mount -t proc proc /proc > /dev/null 2>&1 /bin/mount -t proc proc /proc > /dev/null 2>&1
/bin/mount -t sysfs sysfs /sys > /dev/null 2>&1 /bin/mount -t sysfs sysfs /sys > /dev/null 2>&1
/sbin/depmod -Ae > /dev/null 2>&1 /sbin/depmod -Ae > /dev/null 2>&1
fi fi
sleep 2
sleep 5
echo "NeoBoot is starting mdev and mout HDD USB ..."
sleep 1
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
/etc/init.d/mdev > /dev/null 2>&1
############..>>>>>>>>
sleep 5
mnttest="nouuid" mnttest="nouuid"
if [ -e $NEOBOOT/bin/install ]; then if [ -e /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install ]; then
orgimag1=`mount | sed '/sd/!d' | cut -d" " -f1` orgimag1=`mount | sed '/sd/!d' | cut -d" " -f1`
selectinstall=`cat $NEOBOOT/bin/install` selectinstall=`cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install`
for item in $orgimag1; do for item in $orgimag1; do
selectmnt=`blkid | sed '/$selectinstall/!d' | cut -d":" -f1` selectmnt=`blkid | sed "/$selectinstall/!d" | cut -d":" -f1`
if [ $selectmnt == $item ]; then if [ $selectmnt == $item ]; then
echo "selectmnt=" $selectmnt echo "selectmnt=" $selectmnt
mnttest="uuid" mnttest="uuid"
mount $selectmnt $NEO > /dev/null 2>&1 mount $selectmnt `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` > /dev/null 2>&1
fi fi
if [ ! -e $NEO/ImageBoot ]; then if [ ! -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`ImageBoot ]; then
echo "NEOBOOT hasn't been installed on: " $selectmnt echo "NeoBoot hasn't been installed on: " $selectmnt
umount $NEO > /dev/null 2>&1 umount `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` > /dev/null 2>&1
else else
echo "NEOBOOT has been installed on: " $selectmnt echo "NeoBoot has been installed on: " $selectmnt
break; break;
fi fi
done done
fi fi
if [ ! -e $NEO ]; then if [ ! -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG ]; then
mkdir $NEO > /dev/null 2>&1 mkdir -p /media/hdd > /dev/null 2>&1
fi mkdir -p /media/usb > /dev/null 2>&1
fi
if [ ! -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` ]; then
mkdir `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` > /dev/null 2>&1
fi
if [ $mnttest == "nouuid" ] ; then if [ $mnttest == "nouuid" ] ; then
echo "NeoBoot mount by Device" echo "NeoBoot mount by Device"
DEVICES1=`find /dev/sd??` DEVICES1=`find /dev/sd??`
for DEVICE in $DEVICES1; for DEVICE in $DEVICES1;
do do
if [ -e $NEO ]; then if [ -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` ]; then
echo "neoboot checking installation on: " $DEVICE echo "neoboot checking installation on: " $DEVICE
mount $DEVICE $NEO > /dev/null 2>&1 mount $DEVICE `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` > /dev/null 2>&1
fi fi
if [ ! -e `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`ImageBoot ]; then
if [ ! -e $NEO/ImageBoot ]; then
echo "NeoBoot hasn't been installed on: " $DEVICE echo "NeoBoot hasn't been installed on: " $DEVICE
umount $NEO > /dev/null 2>&1 umount `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location` > /dev/null 2>&1
else else
echo "NEOBOOTt has been installed on: " $DEVICE echo "NeoBoot has been installed on: " $DEVICE
break; break;
fi fi
done done
elif [ $mnttest == "uuid" ]; then elif [ $mnttest == "uuid" ]; then
echo "NEOBOOT mount by UUID" echo "NeoBoot mount by UUID"
fi fi
if [ ! -e $IMAGEBOOT ]; then
ln -sfn /sbin/init.sysvinit /sbin/init if [ ! -e $NEODEVICE$IMAGEKATALOG/.neonextboot ]; then
echo "Flash " > $IMAGEBOOT if [ -e /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh ]; then
echo "Used Kernel: Reinstall kernel !" > /media/neoboot/ImagesUpload/.kernel/used_flash_kernel /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh
reboot -f echo "___________________neoMountpoint_______________________ "
fi sleep 1
fi
fi
MODPROBE=/sbin/modprobe
echo "Load video and frame buffer modules ..."
#modprobe dvb
echo "NeoBoot is loading modules"
for mod in dvb; do
$MODPROBE $mod
done
# Hack for loading modules which are not loaded on diffrent kernel images
/etc/init.d/modutils.sh
#
echo "Set BOOTLOGO ..."
sleep 1
cat /etc/videomode > /proc/stb/video/videomode
#we must wait until udev has created the video device
(
if [ -d /proc/stb ]; then
while true; do
if [ -e /dev/dvb/adapter0/video0 ]; then
break;
fi;
done;
fi;
[ -e /etc/dropbear/dropbear_rsa_host_key ] && /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/neowait.mvi;
) &
/etc/init.d/bootlogo > /dev/null 2>&1
sleep 2
echo "Driverload end"
if [ -f $LIBDIR/kernel/fs/autofs4/autofs4.ko ]; then
/sbin/insmod $LIBDIR/kernel/fs/autofs4/autofs4.ko > /dev/null 2>&1
fi
if [ -e /tmp/init_reboot ]; then
break;
fi
###>>>>>>>>>>>>>>>>>
UPLOAD=ImagesUpload
mount /dev/sda1 /media/hdd
if [ ! -e $NEODEVICE$IMAGEKATALOG ]; then
echo "Error mounting, Return to image Flash..."
sleep 2
ln -sfn /sbin/init.sysvinit /sbin/init
echo "Flash " > $NEODEVICE$IMAGEKATALOG/.neonextboot
echo "Reinstall kernel -Press number 3" > $NEODEVICE$UPLOAD/.kernel/used_flash_kernel
echo " Sending all processes the TERM- KILL signal..."
reboot -f
fi
TARGET=Flash TARGET=Flash
if [ -f $IMAGEBOOT ]; then if [ -f `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/.neonextboot ]; then
TARGET=`cat $IMAGEBOOT` TARGET=`cat $NEODEVICE$IMAGEKATALOG/.neonextboot`
fi fi
if [ $TARGET = "Flash" ]; then if [ $TARGET = "Flash" ]; then
echo "NEOBOOT is booting image from " $TARGET echo "NEOBOOT is booting image from " $TARGET
/bin/umount $NEO > /dev/null 2>&1
/bin/umount /media/usb > /dev/null 2>&1 /bin/umount /media/usb > /dev/null 2>&1
/bin/umount /media/hdd > /dev/null 2>&1 /bin/umount /media/hdd > /dev/null 2>&1
/usr/bin/showiframe /usr/share/bootlogo.mvi > /dev/null 2>&1
sync; ln -sfn /sbin/init.sysvinit /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/mountpoint.sh
echo "----------------------------------"
echo " BOOT UP IMAGE FROM FLASH "
echo "----------------------------------"
else else
echo "NEOBOOT is booting" $TARGET " from " $DEVICE
echo 3 > /proc/sys/vm/drop_caches echo "NeoBoot is booting" $TARGET " from " `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`
if [ -d $NEO/ImageBoot/$TARGET ]; then
if [ -f $NEO/ImageBoot/$TARGET/etc/init.d/udev ]; then if [ -d $NEODEVICE$IMAGEKATALOG/$TARGET ]; then
sed -ie s!"\$4"!"\$3"!g $NEO/ImageBoot/$TARGET/etc/init.d/udev if [ -f $NEODEVICE$IMAGEKATALOG/$TARGET/etc/init.d/udev ]; then
sed -ie s!"\$4"!"\$3"!g $NEODEVICE$IMAGEKATALOG/$TARGET/etc/init.d/udev
fi fi
sleep 1
/bin/mount -o bind /dev $NEO/ImageBoot/$TARGET/dev
/bin/mount -o bind /proc $NEO/ImageBoot/$TARGET/proc
/bin/mount -o bind /sys $NEO/ImageBoot/$TARGET/sys
rm $NEO/ImageBoot/$TARGET$NEO > /dev/null 2>&1
mkdir $NEO/ImageBoot/$TARGET$NEO > /dev/null 2>&1
orgimag=`mount | sed '/sd/!d' | cut -d" " -f1`
rm -f $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
for item in $orgimag; do
ohdd=`echo $item | cut -d"/" -f3`
nhdd=`mount | sed "/\$ohdd/!d" | sed q | cut -d" " -f3`
if [ $nhdd == '$NEO' ]; then
echo $nhdd
echo "mkdir "$nhdd >> $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mount "$item $nhdd >> $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
else
echo "umount "$nhdd >> $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mkdir "$nhdd >> $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mount "$item $nhdd >> $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
echo ok
fi
done
chmod 755 $IMAGE/$TARGET/usr/bin/enigma2_pre_start.sh
if [ -f $IMAGE/$TARGET/sbin/init.sysvinit ]; then if [ -f $NEODEVICE$IMAGEKATALOG/$TARGET/usr/share/bootlogo.mvi ]; then
exec /usr/sbin/chroot $IMAGE/$TARGET /sbin/init.sysvinit /usr/bin/showiframe $NEODEVICE$IMAGEKATALOG/$TARGET/usr/share/bootlogo.mvi
elif [ -f $IMAGE/$TARGET/sbin/init ]; then
exec /usr/sbin/chroot $IMAGE/$TARGET /sbin/init
else else
echo " " /usr/bin/showiframe $NEODEVICE$IMAGEKATALOG/$TARGET/usr/share/bootlogo.mvi
fi
sleep 1
/bin/mount -o bind /dev $NEODEVICE$IMAGEKATALOG/$TARGET/dev
/bin/mount -o bind /proc $NEODEVICE$IMAGEKATALOG/$TARGET/proc
/bin/mount -o bind /sys $NEODEVICE$IMAGEKATALOG/$TARGET/sys
rm $NEODEVICE$IMAGEKATALOG/$TARGET$NEODEVICE > /dev/null 2>&1
mkdir $NEODEVICE$IMAGEKATALOG/$TARGET$NEODEVICE > /dev/null 2>&1
rm -f $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
orgimag=`mount | sed '/sd/!d' | cut -d" " -f1`
for item in $orgimag; do
ohdd=`echo $item | cut -d"/" -f3`
nhdd=`mount | sed "/\$ohdd/!d" | sed q | cut -d" " -f3`
if [ $nhdd == '$NEODEVICE' ]; then
echo $nhdd
echo "mkdir "$nhdd >> $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mount "$item $nhdd >> $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
else
echo "umount "$nhdd >> $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mkdir "$nhdd >> $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
echo "mount "$item $nhdd >> $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
echo ok
fi
done
if [ ! -e $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh ]; then
cp -f /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/mountpoint.sh $NEODEVICE$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
fi
chmod 755 `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/$TARGET/usr/bin/enigma2_pre_start.sh
echo "NeoBOOT created the file mount enigma2_pre_start.sh "
echo " [NEOBOOT] Use chroot ... exec /usr/sbin/chroot..."
if [ -f `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/$TARGET/sbin/init.sysvinit ]; then
echo "----------------------------------------"
echo " -=*[ BOOT UP IMAGE FROM DISK ]*=- "
echo "----------------------------------------"
exec /usr/sbin/chroot `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/$TARGET /sbin/init.sysvinit
elif [ -f `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/$TARGET/sbin/init ]; then
exec /usr/sbin/chroot `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/$TARGET /sbin/init
else
echo " "
echo " NEOBOOT - ERROR !!! " echo " NEOBOOT - ERROR !!! "
echo "Nie odnaleziono poprawnie rozpakowanego image "$TARGET" z partycji " $DEVICE echo "Not found correctly unpacked image "$TARGET" z partycji " $DEVICE
echo " Sprawdz poprawnosc rozpakowanych katalogow w wybranym image. " echo "Check the correctness of unpacked catalogs in the selected one image. "
echo " Powrot do image Flash... " echo " Back to image Flash... "
rm -f $IMAGEBOOT; touch $IMAGEBOOT; echo "Flash " >> $IMAGEBOOT
sync; sleep 10; exec /sbin/init.sysvinit $1 /usr/bin/showiframe /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/error.mvi > /dev/null 2>&1
sync; ln -sfn /sbin/init.sysvinit /sbin/init
echo "Flash " > `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$IMAGEKATALOG/.neonextboot
echo "Used Kernel: Reinstall kernel !" > `cat /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location`$UPLOAD/.kernel/used_flash_kernel
sleep 15; reboot -f
fi fi
exit 0 exit 0
fi fi
fi fi
fi fi
# boot Flash
if [ -f /sbin/init.sysvinit ]; then if [ -f /sbin/init.sysvinit ]; then
#echo "Running /sbin/init.sysvinit"
exec /sbin/init.sysvinit $1 exec /sbin/init.sysvinit $1
fi fi
exit 0 exit 0
;;
esac
exit