This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cédric Verstraeten
committed
Mar 11, 2016
1 parent
35d196b
commit cc75df3
Showing
2 changed files
with
2 additions
and
2 deletions.
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 |
---|---|---|
@@ -1 +1 @@ | ||
dwc_otg.fiq_fix_enable=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ro rootflags=noload panic=10 quiet loglevel=1 | ||
dwc_otg.fiq_fix_enable=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw rootflags=noload panic=10 quiet loglevel=1 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
dwc_otg.fiq_fix_enable=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ro rootflags=noload panic=10 quiet loglevel=1 | ||
dwc_otg.fiq_fix_enable=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw rootflags=noload panic=10 quiet loglevel=1 |
cc75df3
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 sure you want to mount the root filesystem read-write?
cc75df3
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.
I enabled this because the images and configuration files are located at /etc/opt by default. Maybe it will be better to move them to the /data directory, and revert it to ro. What do you think?
cc75df3
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.
I moved all /etc stuff that needs updating to /data/etc. In fact the only writable partition is /data. / and /boot are always read/only to prevent corruption and to allow automatic updates which overwrite the entire partition (similar to android in a way).
cc75df3
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.
Ok I see good point, how and where in the project do perform a kernel update?
cc75df3
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 kernel is updated along with the entire OS image.
cc75df3
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.
Maybe a stupid question, but I don't see where you create or move specific files to the /data file. I only see the cleanup and postbuild scripts.
cc75df3
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.
It's not a stupid question at all. It's part of the motionEye package in fact (due to some legacy-related reasons).
But the procedure can be implemented in whatever language/script you think it's best:
boot.img
,root.img
)/boot/config.txt
file so that board-level settings can be preserved across updatesdd
to write theboot.img
file to/dev/mmcblk0p1
/boot/config.txt
from backup/boot/config.txt
so that the root partition is upgraded at next bootfwupdater.gz
initramfs image will usedd
to write theroot.img
file to/dev/mmcblk0p2
/boot/config.txt
so that the system will boot normally/usr/share/post-upgrade
cc75df3
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.
System is now read-only again, all files that need to be modified are moved to the data directory
cc75df3
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.
@ccrisan I have reviewed the update process, and I must say congrats :) I will try to put it in a simple bash script (or did you already do that?) so I can call it from the webinterface.
I see (and understand) what you're doing but you've lost me at point 10 untill 13. Where can I see the functionality of those last four steps.
cc75df3
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.
It's all embedded into fwupdater.gz. Download it, unpack it, enter the rootfs.cpio archive and you'll see the
/init
script. In fact the kernel normally executes the/init
binary found in the root of the root partition unless otherwise told. This script will simply do what points 10, 11 and 12 say.cc75df3
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.
Thanks that makes sense 👍
cc75df3
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.
@ccrisan I have a question regarding: 13. execute any post-upgrade scripts from /usr/share/post-upgrade
Does it really executes every script in the directory or does it search for a script with the same name of the version to which it is upgraded?
cc75df3
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.
It does what you would normally expect it to do: it executes all scripts from the former version to the newly updated version, in order.
cc75df3
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.
As you mark your releases with dates it sounds logical However I tag the version with 1.0.0, what will happen then? Does it do an integer comparison?
cc75df3
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.
It should work well with versions of format x.y.z: https://github.com/kerberos-io/kios/blob/master/board/common/overlay/etc/init.d/S14postupgrade#L14.
cc75df3
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.
great 👍 thanks @ccrisan