-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port OS upgrade stuff to master-v3.x
- Loading branch information
Showing
4 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
mount $1 /mnt | ||
|
||
|
||
ORIGTYPE=$(</etc/fpp/platform) | ||
NEWTYPE=$(</mnt/etc/fpp/platform) | ||
|
||
if [ $ORIGTYPE != $NEWTYPE ]; then | ||
echo "Image of '${NEWTYPE}' does no match '${ORIGTYPE}'" | ||
umount /mnt | ||
exit 1; | ||
fi | ||
|
||
mount -o bind / /mnt/mnt | ||
mount -o bind /boot /mnt/mnt/boot | ||
mount -t tmpfs tmpfs /mnt/tmp | ||
mount -o bind /dev /mnt/dev | ||
|
||
chroot /mnt /mnt/opt/fpp/SD/upgradeOS-part2.sh | ||
|
||
echo "Done copy" | ||
sync | ||
umount /mnt/dev | ||
umount /mnt/tmp | ||
umount /mnt/mnt/boot | ||
umount /mnt/mnt | ||
|
||
sync | ||
|
||
echo "</pre>" | ||
echo "<b>Rebooting.... please wait for FPP to reboot.</b><br>" | ||
echo "<a href='index.php'>Go to FPP Main Status Page</a><br>" | ||
echo "<a href='about.php'>Go back to FPP About page</a><br>" | ||
echo "</body>" | ||
echo "</html>" | ||
|
||
reboot -f -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
. /opt/fpp/scripts/common | ||
. /opt/fpp/scripts/functions | ||
|
||
cd / | ||
|
||
if [ "${FPPPLATFORM}" = "Raspberry Pi" ] | ||
then | ||
BOOTSIZE=$(sfdisk -q -l -o size /dev/mmcblk0 2>/dev/null | grep M) | ||
BOOTSIZE=${BOOTSIZE::-1} | ||
if [ `echo "$BOOTSIZE < 120"|bc` -eq 1 ]; then | ||
# 2.x image, boot partition is tiny and cannot fit everything needed for Pi4 so we need to exclude some more things | ||
rsync -aAxv boot /mnt --delete-before --exclude=boot/kernel8.img --exclude=boot/kernel7l.img --exclude=boot/.Spotlight* | ||
else | ||
rsync -aAxv boot /mnt --delete-before | ||
fi | ||
else | ||
rsync -aAxv boot /mnt --delete-during | ||
fi | ||
|
||
if [ "${FPPPLATFORM}" = "BeagleBone Black" ]; then | ||
# need to install the bootloader that goes with this version of the os | ||
cd /opt/backup/uboot | ||
dd if=MLO of=/dev/mmcblk1 seek=1 bs=128k | ||
dd if=u-boot.img of=/dev/mmcblk1 seek=1 bs=384k | ||
dd if=MLO of=/dev/mmcblk0 seek=1 bs=128k | ||
dd if=u-boot.img of=/dev/mmcblk0 seek=1 bs=384k | ||
cd / | ||
fi | ||
|
||
# temporarily copy the ssh keys | ||
mkdir tmp/ssh | ||
cp -a mnt/etc/ssh/*key* tmp/ssh | ||
|
||
#copy everything other than fstab | ||
rsync -aAxv bin etc lib opt root sbin usr var /mnt --delete-during --exclude=etc/fstab | ||
|
||
#restore the ssh keys | ||
cp -a tmp/ssh/* mnt/etc/ssh | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<?php | ||
|
||
$skipJSsettings = 1; | ||
require_once("common.php"); | ||
|
||
DisableOutputBuffering(); | ||
|
||
?> | ||
|
||
<head> | ||
<title> | ||
FPP OS Uprade | ||
</title> | ||
</head> | ||
<body> | ||
<h2>FPP OS Upgrade</h2> | ||
<pre> | ||
========================================================================== | ||
<? | ||
system($SUDO . " $fppDir/SD/upgradeOS-part1.sh /home/fpp/media/upload/" . $_GET['os']); | ||
?> | ||
========================================================================== | ||
</pre> | ||
<b>Rebooting.... please wait for FPP to reboot.</b> | ||
<a href='index.php'>Go to FPP Main Status Page</a><br> | ||
<a href='about.php'>Go back to FPP About page</a><br> | ||
</body> | ||
</html> |