-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce SONiC migration partition from 8G to 1G. (#1343)
* Reduce SONiC migration partition from 8G to 1G. * Changes to create 1G partition with ability to resize post migration. * Remove redundant changes in varlog * Use findfs to interpret root. Move resize in case cmdline params are reordered
- Loading branch information
1 parent
4925d48
commit 0d0752e
Showing
5 changed files
with
47 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
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
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,39 @@ | ||
#!/bin/sh | ||
|
||
case $1 in | ||
prereqs) | ||
exit 0 | ||
;; | ||
esac | ||
|
||
# Extract kernel parameters | ||
set -- $(cat /proc/cmdline) | ||
for x in "$@"; do | ||
case "$x" in | ||
root=*) | ||
root_val="${x#root=}" | ||
;; | ||
resize-rootfs) | ||
need_resize=1 | ||
;; | ||
esac | ||
done | ||
|
||
if [ -n "$need_resize" ]; then | ||
if [ -z "$root_val" ]; then | ||
echo "ERROR: resize required but unable to get root location from command line" | ||
exit 1 | ||
fi | ||
|
||
root_dev=$(findfs $root_val) | ||
if [ $? != 0 ]; then | ||
echo "ERROR: resize required but findfs failed" | ||
exit 1 | ||
fi | ||
|
||
resize2fs -f $root_dev | ||
if [ $? != 0 ]; then | ||
echo "ERROR: Unable to resize the root file system. Manual intervention needed to fix the issue." | ||
exit 1 | ||
fi | ||
fi |
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