-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support for updating tmpfs size according to Image size #7484
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
33bc329
Support for updating tmpfs size according to Image size
lkunjumon 25d32a1
Add support to get actual size of compressed image.
lkunjumon 3c6c399
Updating tmpfs size according to Image size
lkunjumon 53e8c97
Updated review comments and added extra 32MB free space for mount size.
lkunjumon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -25,13 +25,19 @@ fi | |
|
|
||
| echo " OK." | ||
|
|
||
| image_size=$(du "$0" | awk '{print $1}') | ||
| # Untar and launch install script in a tmpfs | ||
| cur_wd=$(pwd) | ||
| export cur_wd | ||
| archive_path=$(realpath "$0") | ||
| tmp_dir=$(mktemp -d) | ||
| if [ "$(id -u)" = "0" ] ; then | ||
| mount -t tmpfs tmpfs-installer $tmp_dir || exit 1 | ||
| mount_size=$(df $tmp_dir | tail -1 | tr -s ' ' | cut -d' ' -f4) | ||
| if [ "$mount_size" -lt "$((image_size*3))" ]; then | ||
|
||
| mount_size=$((((image_size*3)/1024/1024)+1)) | ||
| mount -o remount,size="${mount_size}G" -t tmpfs tmpfs-installer $tmp_dir || exit 1 | ||
| fi | ||
| fi | ||
| cd $tmp_dir | ||
| echo -n "Preparing image archive ..." | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This seems an estimation. How do you know *3 is enough? Could you get the accurate required size? #Closed
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.
that must be generated from the build process.
Uh oh!
There was an error while loading. Please reload this page.
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.
use this to get the original size?
Uh oh!
There was an error while loading. Please reload this page.
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.
This script untars sonic-platform.bin, which is a ONIE image. We cannot use gzip command.
Will update the logic by getting image size from the "tar" command, excluding the ONIE installer script