Skip to content
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

[build_debian.sh]: Create loop device for /var/log #284

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

marian-pritsak
Copy link
Collaborator

/var/log size has to be limited to avoid eating up
all space on device

Signed-off-by: marian-pritsak [email protected]

build_debian.sh Outdated
@@ -260,6 +260,13 @@ sudo LANG=C chroot $FILESYSTEM_ROOT umount /proc
## Prepare empty directory to trigger mount move in initramfs-tools/mount_loop_root, implemented by patching
sudo mkdir $FILESYSTEM_ROOT/host

## Create loop device for /var/log to limit its size to 1000000*512=500MB
sudo mkdir -p $FILESYSTEM_ROOT/var/disk-img
sudo LANG=C chroot $FILESYSTEM_ROOT dd if=/dev/zero of=/var/disk-img/var-log.ext4 count=1000000
Copy link
Collaborator

@lguohan lguohan Feb 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this size configurable via rules/config for different platforms as different platform can have different disk size.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can
Didn't know we need it configurable
Is 500M good for default?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for a platform that has only 2G disk. after installation we use about 800M. If we do upgrade, we need to download another image which is about 400MB. We may be some space for further dockers. Perhaps 256M logs for those platforms. For a device with 16G or more disk, we would like allocate more disk for the logs. Perhaps 4G should be good. Maybe default is 4G and we need to specify values for some other platform.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is more complex if we consider the single image case. In this case, we have one image for different platforms. then, those platform have different disk, the loop device should be created at the installation time, not build time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably need to create per platform file under topdir/hwsku/$onie_platform/platform.conf

In that conf, we can specify the log disk size, and then at the installation time, based on the onie string, we create the log disk.

we may put some other things into the directory such as sensors.conf, pwmconfig.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about onie_platform.
Current build configuration requires only PLATFORM and SKU.
Aren't they the two keys that define a unique platform (in case of mellanox its enough)?
In that case conf file can be put under platform/$PLATFORM/sku/$SKU/

Do we have one image for different platforms in any vendor?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the question here is that say for mellanox platform you have 2700, 2100, and etc. on. are all the platforms to share a same one image or they have different images? It will be better for sonic to produce less images and each image can be shared by multiple hwskus. Then, in this case, the SKU is probably not useful at the build time now.

@marian-pritsak
Copy link
Collaborator Author

Moved creation of loop device to installer to make its size configurable through sourced platform file

@@ -51,6 +51,10 @@ CONSOLE_SPEED=9600

# Get platform specific linux kernel command line arguments
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=""

# Default var/log device size in MB
VAR_LOG_SIZE=4000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where to configure this? can you add the configuration? also, is there a way to disable this? For example, when var_log_size=0, then we can disable this feature.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4000->4096

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arbitrary sizre can be placed in corresponding platform file, e. g. installer/x86_64/platforms/x86_64-mlnx_x86-r5.0.1400
I don't think that we can disable it, because during build I have to create a mount entry in /etc/fstab
doesn''t configurable size cover all cases?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case on some platform, they are 128G ssd and have no reason to enable this feature?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is per platform you can put the max number

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable means no var-log.ext4 file and mount

@@ -401,6 +405,11 @@ if [ -f $demo_mnt/$FILESYSTEM_DOCKERFS ]; then
cd $demo_mnt && mkdir -p $DOCKERFS_DIR && tar xf $FILESYSTEM_DOCKERFS -C $DOCKERFS_DIR; cd $OLDPWD
fi

# Create loop device for /var/log to limit its size to $VAR_LOG_SIZE MB
mkdir -p $demo_mnt/disk-img
dd if=/dev/zero of=$demo_mnt/disk-img/var-log.ext4 count=$((2000*$VAR_LOG_SIZE))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each block is 512bytes, then 2048*512byte=1MB. can you change 2000->2048?

build_debian.sh Outdated
@@ -260,6 +260,10 @@ sudo LANG=C chroot $FILESYSTEM_ROOT umount /proc
## Prepare empty directory to trigger mount move in initramfs-tools/mount_loop_root, implemented by patching
sudo mkdir $FILESYSTEM_ROOT/host

## Add /var/log mount entry to fstab
## Loop device itself is created by onie installer
sudo LANG=C chroot $FILESYSTEM_ROOT bash -c 'echo "/host/disk-img/var-log.ext4 /var/log ext4 rw,loop 0 0" >> /etc/fstab'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the mount fails. Aboot image also uses this root filesystem, but currently only onie installer created this var-log.ext4 file, so probably we should generate this line during the image installation time too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot access files in root filesystem during installation, so I put it in build_debian

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need access to root filesystem, can you create a /host/rw/etc/fstab file?

Create loop device during installation of
size soecified in config file for machine

Signed-off-by: marian-pritsak <[email protected]>
@marian-pritsak
Copy link
Collaborator Author

Made limit optional

@lguohan lguohan merged commit f9f31ed into sonic-net:master Feb 17, 2017
stcheng pushed a commit that referenced this pull request Aug 11, 2017
- [fdborch]: Fix FdbOrch code to work upon SAI v1.0 (#284)
Kalimuthu-Velappan pushed a commit to Kalimuthu-Velappan/sonic-buildimage that referenced this pull request Sep 12, 2019
* new consutil package - includes helper functions, and show/clear/connect skeletons

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Added connect command skeleton, added show line and clear line skeletons

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Added connect and consutil packages to setup.py and to bash completion

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Added docstrings and "TODO Stub" comments to clear line, show line, and connect line

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Added clear line implementation and added "consutil clear line <linenum>" to clear/main.py

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Fixed "consutil clear" call in clear/main.py

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Changed "connecting" to "connected" in consutil clear line function

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Changed popenWrapper() name to run_command()

Signed-off-by: Cayla Wanderman-Milne <[email protected]>

* Update main.py

Remove SIGTERM magic number

Signed-off-by: Cayla Wanderman-Milne <[email protected]>
lguohan pushed a commit that referenced this pull request Oct 20, 2019
Sonic-swss-common:

aaa8133 - 2019-10-12 : Add VRF object table in state_db (#312) [Tyler Li]
91aceb1 - 2019-10-11 : [schema] Update schema to support debug counters (#308) [Danny Allen]
9bcd5ca - 2019-09-28 : [multi-DB] fix vs test, should NOT replace old DBConnector API with new DBConnector API since vs test docker has no database_config.josn (#311) [Dong Zhang]
599155a - 2019-09-25 : [multi-DB] Part 2: C++ interface API changes / swsscommon unit test / LOGLEVEL_DB apply new API (#301) [Dong Zhang]
379ac73 - 2019-09-20 : add bulkremove for consumer_table_pops.lua (#306) [Dong Zhang]
6b805d3 - 2019-09-19 : timerfd return 0 with errno =0 - handle as False alarm. (#302) [Renuka Manavalan]
e455891 - 2019-09-03 : Add VLAN_SUB_INTERFACE in CONFIG_DB schema (#284) [Wenda Ni]

Sonic-swss

731a8f5 - 2019-10-17 : [copporch]: fix the endless loop problem when removing copp table group. (#1038) [wangshengjun]
1623219 - 2019-10-14 : Enable C++ unit test during build (#1092) [Qi Luo]
629c9d3 - 2019-10-14 : [vstest]: Revert back to 2 sec, and check if we got more than expected number of syslogs (#1091) [Prince Sunny]
80b2ace - 2019-10-11 : sonic-swss/orchagent: Add new protocol trap name support (#1087) [jpxjlrldgit]
9f765f7 - 2019-10-11 : [aclorch]: Check for existing mirror table only when creating a new table (#1089) [Danny Allen]
4c10260 - 2019-10-11 : [vstest]: Update Route test to check for added entry (#1088) [Prince Sunny]
e658b64 - 2019-10-11 : [chassisorch]: Add everflow feature for chassis (#1024) [Ze Gan]
5b13387 - 2019-10-10 : [changelog]: Revert changelog that was done for passing VS test. (#1080) [Prince Sunny]
90a690d - 2019-10-10 : [aclorch]: Simplify the TCP flags matching code and support exact value match (#1072) [Shuotian Cheng]
3461710 - 2019-10-09 : Single VRF for ingress and egress flows, skip route replication (#1045) [Prince Sunny]
953474a - 2019-10-03 : [swss]: Do not use namespace in header files (#1081) [Wenda Ni]
bd36751 - 2019-10-03 : Change nexthop key to ip & ifname (#977) [tylerlinp]
fee1aaa - 2019-10-02 : [teamsyncd]: Check if LAG exists before removing (#1069) [Shuotian Cheng]
175f3de - 2019-09-30 : Update ECMP NHopGroup for Port Channel oper down (#1030) [Sumukha Tumkur Vani]
182940d - 2019-09-26 : [mirrororch]: Remove mirror session state after it is remvoed (#1066) [Shuotian Cheng]
d823dd1 - 2019-09-20 : [MirrorOrch]: Mirror Session Retention across Warm Reboot (#1054) [Shuotian Cheng]
a5b6e7c - 2019-09-19 : Ignore link local neighbors (#1065) [Prince Sunny]
0ddaba3 - 2019-09-19 : Adopt to signature change of Selectable::readData, which switched (#1061) [Renuka Manavalan]
543bd98 - 2019-09-18 : [aclorch]: Fix table name in counter table for mirror rules (#1060) [Shuotian Cheng]
12c29b4 - 2019-09-19 : Cannot ping to link-local ipv6 interface address of the switch. (#774) [Kiran Kumar Kella]
4d8e08d - 2019-09-18 : change in fpmsyncd to skip the lookup for the Master device name if the route object table value is zero (#1048) [Arvindsrinivasan Lakshmi narasimhan]
da514f5 - 2019-09-18 : Do not update lag mtu from teamsyncd (netlink) (#1053) [Prince Sunny]
3fb22e1 - 2019-09-16 : Check warmboot flag during initialization (#1057) [Prince Sunny]
d98d1e9 - 2019-09-16 : [aclorch]: Egress mirror action support and action ASIC support check (#963) [Stepan Blyshchak]
313ef5c - 2019-09-09 : Warmboot Vlan neigh restore fix (#1040) [Prince Sunny]
5841e06 - 2019-09-06 : Add dot1p to tc mapping support (#871) [Wenda Ni]
39fe568 - 2019-08-30 : [aclorch]: Revise ACL rule creation/removal logs (#1042) [Shuotian Cheng]
c461911 - 2019-08-27 : [copporch]: Fix the typo - mld_v1_done (#1037) [wangshengjun]
34915de - 2019-08-22 : [portsyncd]: Add default catch block in portsyncd (#1033) [SuvarnaMeenakshi]
dc81a21 - 2019-08-20 : [vnet]: Fix FDB related failure in "vnet_bitmap" virtual switch test (#1034) [Volodymyr Samotiy]
5ae4226 - 2019-08-19 : [test]: Adjust stale timer for warm-reboot neighborsync test cases (#1031) [zhenggen-xu]
65cbd55 - 2019-08-16 : [build]: Fix compiling warnings using ARM 32 bit compiler (#1015) [[email protected]]
b611808 - 2019-08-16 : [Orchagent]: Fixbug segmentfault at routeorch (#1025) [Ze Gan]
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
- FDB entry creation code update:
  Add switch_id, bridge_type, bridge_id to FDB entry
  Use bridge port ID as an attribute

- Simplify key tokenization

- Comment table modification code due to race condition issue
dmytroxshevchuk pushed a commit to dmytroxshevchuk/sonic-buildimage that referenced this pull request Aug 31, 2020
* [FlexCounter]: Use fine-grained locks.

Signed-off-by: Sihui Han <[email protected]>

* update comments
sg893052 pushed a commit to sg893052/sonic-buildimage that referenced this pull request Apr 25, 2022
autoneg: Update the implementation details
stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Jul 8, 2022
912797e Support get_port_or_cage_type (sonic-net#288)
d8abf47 Microsoft mandatory file (sonic-net#284)

Signed-off-by: Stephen Sun <[email protected]>
liat-grozovik pushed a commit that referenced this pull request Jul 11, 2022
912797e Support get_port_or_cage_type (#288)
d8abf47 Microsoft mandatory file (#284)

Signed-off-by: Stephen Sun <[email protected]>
yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Aug 19, 2022
linkmgrd:
* e20e402 2022-08-18 | Update `handleMuxConfigNotification` logic (sonic-net#125) (HEAD -> 202205) [Jing Zhang]
* 8a54c06 2022-08-17 | [active-active] post mux metrics events (sonic-net#123) [Jing Zhang]

platform-daemon:
* 1a833f6 2022-08-18 | [ycabled] enable telemetry for 'active-active'; fix gRPC portid ordering (sonic-net#284) (HEAD -> 202205) [vdahiya12]

utilities:
* 4bacc1c 2022-08-19 | Fix issue: exception in is_rj45_port in multi ASIC env (sonic-net#2313) (HEAD -> 202205) [Stephen Sun]

swss:
* 4085d3f 2022-07-25 | Revert hwinfo count change (sonic-net#2383) (HEAD -> 202205) [andywongarista]

Signed-off-by: Ying Xie <[email protected]>
yxieca added a commit that referenced this pull request Aug 20, 2022
)

linkmgrd:
* e20e402 2022-08-18 | Update `handleMuxConfigNotification` logic (#125) (HEAD -> 202205) [Jing Zhang]
* 8a54c06 2022-08-17 | [active-active] post mux metrics events (#123) [Jing Zhang]

platform-daemon:
* 1a833f6 2022-08-18 | [ycabled] enable telemetry for 'active-active'; fix gRPC portid ordering (#284) (HEAD -> 202205) [vdahiya12]

utilities:
* 4bacc1c 2022-08-19 | Fix issue: exception in is_rj45_port in multi ASIC env (#2313) (HEAD -> 202205) [Stephen Sun]

swss:
* 4085d3f 2022-07-25 | Revert hwinfo count change (#2383) (HEAD -> 202205) [andywongarista]

Signed-off-by: Ying Xie <[email protected]>

Signed-off-by: Ying Xie <[email protected]>
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Aug 29, 2022
Update sonic-platform-daemons submodule pointer to include the following:
* [ycabled] enable telemetry for 'active-active'; fix gRPC portid ordering ([sonic-net#284](sonic-net/sonic-platform-daemons#284))
* [ycabled] remove some spurious logs ([sonic-net#282](sonic-net/sonic-platform-daemons#282))
* Correct the peer forwarding state table ([sonic-net#281](sonic-net/sonic-platform-daemons#281))
* add psu input voltage and current ([sonic-net#276](sonic-net/sonic-platform-daemons#276))
* [ycabled] add capability to enable/disable telemetry ([sonic-net#279](sonic-net/sonic-platform-daemons#279))

Signed-off-by: dprital <[email protected]>
liat-grozovik pushed a commit that referenced this pull request Sep 4, 2022
- Why I did it
Update sonic-platform-daemons submodule pointer to include the following:

[ycabled] enable telemetry for 'active-active'; fix gRPC portid ordering (#284)
[ycabled] remove some spurious logs (#282)
Correct the peer forwarding state table (#281)
add psu input voltage and current (#276)
[ycabled] add capability to enable/disable telemetry (#279)

Signed-off-by: dprital <[email protected]>
mihirpat1 pushed a commit to mihirpat1/sonic-buildimage that referenced this pull request Feb 21, 2023
…ing (sonic-net#284)

* [ycabled] enable telemetry for 'active-active'; fix gRPC portid ordering

This PR fixes the portID sent for gRPC probing to the SoC/NIC-Simulator, and defaults it to [0,1].
This helps improve the logic and readibility of the logs as well for easier debug and response parsing is also improved
This PR also enables sonic-telemetry logging for active-active cable type

Description
Motivation and Context
How Has This Been Tested?
running the changes on testbed and UT

Signed-off-by: vaibhav-dahiya <[email protected]>
snider-nokia pushed a commit to snider-nokia/sonic-buildimage that referenced this pull request Apr 6, 2023
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
mlok-nokia pushed a commit to mlok-nokia/sonic-buildimage that referenced this pull request Jun 5, 2024
…ic-utilities

[submodule][202205] Update submodule sonic-utilities to the latest HEAD automatically
mssonicbld added a commit that referenced this pull request Sep 6, 2024
…lly (#20158)

#### Why I did it
src/sonic-gnmi
```
* 95f4400 - (HEAD -> master, origin/master, origin/HEAD) Revert "Replace PFC_WD_TABLE with PFC_WD (#173)" (#284) (2 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
vvolam pushed a commit to vvolam/sonic-buildimage that referenced this pull request Sep 12, 2024
…lly (sonic-net#20158)

#### Why I did it
src/sonic-gnmi
```
* 95f4400 - (HEAD -> master, origin/master, origin/HEAD) Revert "Replace PFC_WD_TABLE with PFC_WD (sonic-net#173)" (sonic-net#284) (2 hours ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants