-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Multiboot pi + recovery or update partition #146
Conversation
br-webui/server1.js
Outdated
@@ -0,0 +1,191 @@ | |||
/*Recovery Server for Companion*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server1.js is not a good name, can be more explicit ? Like recovery-webserver, or webpage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this file is being executed ? There is no modification in the screen script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now i havent added any modification in companion.rc. this file is executed simply by typing node server1.js. I havent added any explicit name because its just a trial version of the server. I will change the name.
br-webui/server1.js
Outdated
app.get('/', function(req, res) { | ||
res.render('index', {}); | ||
}); | ||
/*app.get('/socket.io-file-client.js', (req, res, next) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary ? Is this a debug function ? Can add a comment why is this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this is rendering the frontend liquid file.
br-webui/server1.js
Outdated
res.send('Complete!'); | ||
}); | ||
|
||
/*var io = require('socket.io')(server); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing about commented code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commented code is another way to implement the server that we can revert to. its just there for trial purposes. and will be removed in the future commits.
scripts/rebootrecovery.sh
Outdated
@@ -0,0 +1,4 @@ | |||
#!/bin/bash | |||
|
|||
sudo -H -u root bash -c "sed -i -e 's/\-03/\-02/' /boot/cmdline.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment about what is happening here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sure. its basically just changing the partition id from 3 to 2 so that we can boot into the recovery partition
br-webui/server1.js
Outdated
|
||
storage: multer.diskStorage({ | ||
destination: function(req,file,next) { | ||
next(null, '/mnt/mainfs/home/pi/new_files'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you going to store the files in the mainfs (not recovery) ? How are you going to read the .img file if this partition will be formatted ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the recovery partition does not have enough space to save a 1.4 gb file. thats why im storing it on the other partition where the update is supposed to happen. and once its saved we can just extract the image over existing partition using dd. so there will be no issues with accessing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "other partition" is the mainfs where webui runs or is a 3rd one that is used to store this files ?
if it's in mainfs, how dd will read the .img file while rewriting the mainfs ?
ec175e6
to
1a755f3
Compare
1c56396
to
6b03e78
Compare
6b03e78
to
384c5d2
Compare
other goals:
|
Example of how to script the image: |
We are looking at some alternative solutions like mender.io and swupdate. |
Fix #124