Skip to content

Commit

Permalink
stable 9.6: push bugfix from dev to stable build
Browse files Browse the repository at this point in the history
6d49e29 fix install_from_github func
361e122 impl #945
779cf3c gui: move gui upgrade option as the first option
98b79a9 Revert "gui: move gui upgrade option as the first option"
db965bf core: add check for mkdir and normalize logging file
3dc5d0c gui: move gui upgrade option as the first option
51f5252 }?
753371a update changelog issue template
36aff9f fix syntax error move bank info to modgui modal
d0fe8fa remove also mobiled mappers when lib not found more shell
script optimizations
04ecc69 more infos for debug file minor shell warnings for rootdevice
fix #1034
0c0ca39 core: fix error in remove modgui_log dir
ec9e9da core: improve loggin of data
2bc05f5 core: move console echo to dedicated function
431e48a syntax error
db8730f force bank1 erase and reboot also on first install from bank2
check /proc/prozone is exposed before tricking failboot to avoid
warnings
5d48b3a fix feeds for 17.1/2 arm added macoers feeds for arm 18.x
update DGA (arm) specific package embedded ipk fix mv scripthelpers
warnings during install on some devices remove mobiled card on
unsupported devices (mobiled not installed)
a5f2b67 fix "1" echo during install
549568e fix perm
669b508 missing source file
bab60ea github: fix typo in README (#1026)
f38c4aa typo
2718536 fixes login for opkg repo feed fix logger_command: not found
during specific package install
0689a05 make specific_app cases more generic on cpu type
1e76fba fix luci install on some firmwares
22a6519 rework extensions install checks to use marketing_version and
cputype
318d781 gui: fix wireless-client-modal broken in minified source
eefa1fe move custom func to modgui modal remove transfer bank clone
bank
44f2bd3 gui: fix typo in serial modem for missing input box
7c5089c gui: permit to force a different modem serial
9ae6fee gui: improve cwmp settings in modgui modal
cc1ea83 gui: drop use of cwmp TIM latest version
0007ffc gui: Add new option to disable cwmp update
5c57543 gui: fix bad cwmp tim version
c1650eb gui: also export Kernel version in modgui mapper
43ea509 gui: export CPUtype in modgui mapper
fdac82d xdsl drivers: add A2pvfbH046w B2pvfbH046w
a2ce5dd remove hardcoded version from rootdevice
3986f23 typo
27f2032 core: disable switchover for cwmp
49281c6 core: skip bank_1 erase if it doesn't contain a valid firmware
9c38099 gui: drop use of driver_version to store xdsl firmware version
6f318fb gui: remove use of versioncustom latest config
2b262db gui: remove use of gui_version in modgui config
fa5333d gui: move gui version to rpc mapper
4787ef7 core: add option to disable modoverlay
317b395 core: force otp to second bank
d9210a9 improve feeds detection
3ab577c core: force second bank on firmware upgrade
5e5dcd1 core: fix typo in cwmpd upgrade script
e6506fd shellcheck avoid subshell spawning
fb149c3 core: refresh firmware upgrade script
da64dfc core: refresh cwmpd upgrade script
708bedf core: fix wrong preinit check
e8091fb core: update core file on gui upgrade
80094ba Fixed FEC translations (#1016)

Signed-off-by: Ansuel Smith <[email protected]>
  • Loading branch information
Ansuel committed Dec 16, 2020
1 parent 3b0cbe4 commit 89342d7
Show file tree
Hide file tree
Showing 58 changed files with 2,437 additions and 2,695 deletions.
15 changes: 5 additions & 10 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ about: Bug Issue template
---
NB: Before submitting an issue, check if there is one already open that suits the problem you are having!

<b>If you are on the latest dev, please go to Cards >> System Extras >> Debug Report and press the Generate button.
Please attach the file here:</b>
Device Model/Firmware:
GUI Version:

Please go to Cards >> Mod GUI >> Debug Report and press the Generate button.
Attach the debug file here:

Device Model:
Gui Version:

Description of problem:

How to reproduce (if possible):

Media/Photos (if possible):
Description of problem, HOW TO REPRODUCE, Media/Photos:
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@
---------------------------------------------------------------------------
# Mainline 18.3 Cobalt

9.6
9.6.58
---------------------------------------------------------------------------
- Fix vari che causavano la perdita delle configurazioni dopo un riavvio
- Fix che impedivano il corretto aggiornamento firmware da GUI
- Spostate alcune funzioni nella modal MODGUI
- Rimossa opzione di spoof versione "da rootscript"
- Aggiunta funzione, attiva di default, per ignorare gli update inviati dal CWMP
- Forzato riavvio su prima installazione se modoverlay non è applicato
- Rimossa card mobile su dispositivi che non la supportavano
- Migliorata la rilevazione dell'installazione dei pacchetti di upgrade e delle estensioni
- Aggiunti driver xDSL

9.6.10
---------------------------------------------------------------------------
- La mod ora applicherà in modo automatico l'OPTIMAL BANK PLAN e utilizzerà la partizione del bank_1 come spazio per le config/mod (MODOVERLAY), in modo da avere BOOTP come una modalità sicura di recovery di device brickati.
- Cambio al comportamento del reset da tasto fisico: al primo reset vengono rimosse tutte le mod e mantenuto solo il root al secondo reset (se non si reinstalla la MOD) il device viene riportato totalmente allo stato di fabbrica
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ with many fixes and new features like:

<h2><strong>Basic installation instructions for the latest Stable release:</strong></h2>

<h3><strong>First you need to get root acces to your Gateway</strong></h3>
<h3><strong>First you need to get root access to your Gateway</strong></h3>
Some Topics to help you get root access:
<ul>
<li>DGA4130 TIM: https://www.ilpuntotecnico.com/forum/index.php/topic,77325.html</li>
Expand Down
94 changes: 56 additions & 38 deletions decompressed/base/etc/init.d/do_migrate_overlay
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
#!/bin/ash /etc/rc.common

START=00
EXTRA_COMMANDS="preserve_files"
EXTRA_HELP=" preserve_files Transfer files from modoverlay to bank"

upperdir=/modoverlay/bank_mod
overlay_bank=/overlay/bank_2

logging_file=/overlay/modgui_log/migrate_log_$(date +"%H-%M_%m-%d-%y")

create_modgui_log() {
[ ! -d /overlay/modgui_log ] && mkdir /overlay/modgui_log
touch $logging_file
}

kecho() {
echo "$1"
echo "$1" > /dev/kmsg
echo mount_root-mod: "$@"
echo mount_root-mod: "$@" > /dev/kmsg
echo mount_root-mod: "$@" >> $logging_file
}

preserve_files() {
#these files should be moved back to bank_2 overlay to allow our mount hook to take place (and preserve root after boot)
local preserve_list="/etc/init.d/rootdevice /etc/rc.d/S94rootdevice /usr/sbin/random_seed /sbin/insmod \
/lib/mount_modroot/05_transfer_basefiles /etc/init.d/do_migrate_overlay /usr/sbin/mount_modoverlay /sbin/mount_root-mod"

if ! mount | grep /modoverlay/bank_mod > /dev/null ; then
kecho "Modroot not found. Can't preserve files."
exit 1
fi

update_file_if_needed() { # <file> <source> <dest>
cmp -s "$2$1" "$3$1" || cp -a "$2$1" "$3$1"
}

for f in $preserve_list; do
mkdir -p $overlay_bank$(dirname "$f")
# kecho "update_file_if_needed $f"
update_file_if_needed "$f" "$upperdir" $overlay_bank
done

sync
}

boot() {
local upperdir=/modoverlay/bank_mod
local overlay_bank=/overlay/bank_2
local ram_dir=/tmp/migrate_overlay
local upperdir_backup=/tmp/upperdir_backup
local files_to_del=/files_to_del
Expand All @@ -23,20 +57,20 @@ boot() {
local source=$1
local dest=$2

kecho "mount_root-mod: copying $source/* to $dest/ ..."
kecho "copying $source/* to $dest/ ..."

for d in $(find $source/ -xdev -type d ! -path "*/modoverlay" -a ! -path "*/saferoot" | cut -d '/' -f4-); do
# kecho "mount_root-mod: creating $dest/$d"
# kecho "creating $dest/$d"
mkdir -p "$dest/$d" 2>/dev/kmsg
done

for f in $(find $source/ -xdev -type f ! -path "*/modoverlay" -a ! -path "*/saferoot" | cut -d '/' -f4-); do
# kecho "mount_root-mod: copying $source/$f to $dest/$f"
# kecho "copying $source/$f to $dest/$f"
cp -dp "$source/$f" "$dest/$f" 2>/dev/kmsg
done

for l in $(find $source/ -xdev -type l ! -path "*/modoverlay" -a ! -path "*/saferoot" | cut -d '/' -f4-); do
# kecho "mount_root-mod: copying $source/$l to $dest/$l"
# kecho "copying $source/$l to $dest/$l"
cp -dp "$source/$l" "$dest/$l" 2>/dev/kmsg
done
}
Expand All @@ -51,7 +85,7 @@ boot() {
# Now scan for file to be deleted... depending on the system these can be char type file
# In new system the cp fails to copy this file. To fix this put the file in a txt file and then remove them by reading it
for c in $(find $source/ -xdev -type c ! -path "*/modoverlay" -a ! -path "*/saferoot" | cut -d '/' -f4-); do
# kecho "mount_root-mod: setting /"$c" to be flagged as deleted"
# kecho "setting /"$c" to be flagged as deleted"
echo /"$c" >> $path_to_save_list
done
}
Expand All @@ -63,13 +97,13 @@ boot() {
# 2. Clean the deleted file from the old overlay
# 3. Reboot to make the accessible from the new overlay
# 4. Remove the file again in the new mounted overlay
kecho "mount_root-mod: checking if there are files to be removed..."
kecho "checking if there are files to be removed..."
if [ -f $files_to_del ]; then
kecho "mount_root-mod: there are files scheduled to be removed..."
kecho "there are files scheduled to be removed..."

# Actually remove the file flagged as removed in the old overlay
while read -r file; do
# kecho "mount_root-mod: setting "$file" as deleted in the new overlay"
# kecho "setting "$file" as deleted in the new overlay"
rm "$file" 2>/dev/kmsg
done < "$files_to_del"

Expand All @@ -80,7 +114,7 @@ boot() {
}

move_overlay() {
kecho "mount_root-mod: checking if overlay must be transfered..."
kecho "checking if overlay must be transfered..."
#use the config folder as check to know that we should populate the modoverlay (mtd3) and cleanup real overlay (mtd2)
# Other process can write some config file before modoverlay is mounted, checking the config dir is not enough
# Try to check if modgui exist and assume the migration is needed if present
Expand All @@ -99,50 +133,34 @@ boot() {

#at this point we should remove all empty folders in bank_2 overlay, except the modoverlay mountpoint
for f in "$overlay_bank/"*; do
# kecho "mount_root-mod: check-for-rm $f"
# kecho "check-for-rm $f"
[ "$f" != "$overlay_bank/modoverlay" ] && [ "$f" != "$overlay_bank/saferoot" ] && rm -rf "$f"
done

sync

kecho "mount_root-mod: migration done!"
kecho "migration done!"

need_reboot="1"
fi
}

preserve_files(){
#these files should be moved back to bank_2 overlay to allow our mount hook to take place (and preserve root after boot)
preserve_list="/etc/init.d/rootdevice /etc/rc.d/S94rootdevice /usr/sbin/random_seed /sbin/insmod \
/lib/mount_modroot/05_transfer_basefiles /etc/init.d/do_migrate_overlay /usr/sbin/mount_modoverlay /sbin/mount_root-mod"

update_file_if_needed() { # <file> <source> <dest>
cmp -s "$2$1" "$3$1" || cp -a "$2$1" "$3$1"
}

for f in $preserve_list; do
mkdir -p $overlay_bank$(dirname "$f")
# kecho "mount_root-mod: update_file_if_needed $f"
update_file_if_needed "$f" "$upperdir" $overlay_bank
done

sync
}

reboot_if_needed(){
if [ "$need_reboot" = "1" ]; then
# Simulate the bank_1 failed 3 times
echo 1 > /proc/prozone/bootfail
echo 2 > /proc/prozone/bootcounter
echo 0 > /proc/prozone/bootbank
[ -d /proc/prozone ] && {
# Simulate the bank_1 failed 3 times
echo 1 > /proc/prozone/bootfail
echo 2 > /proc/prozone/bootcounter
echo 0 > /proc/prozone/bootbank
}
reboot && sleep 30
fi
}

if mount | grep /modoverlay/bank_mod > /dev/null ; then
{ check_files_to_delete; move_overlay; preserve_files; reboot_if_needed; }
else
kecho "mount_root-mod: modoverlay not mounted! Aborting migration!"
kecho "modoverlay not mounted! Aborting migration!"
fi

# Restart watchdog
Expand Down
Loading

0 comments on commit 89342d7

Please sign in to comment.