Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion files/Aboot/boot0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,12 @@ get_eeprom_value() {
write_kdump_cmdline() {
local sid="$(cmdline_get sid | sed 's/Ssd$//')"
case "$sid" in
Wolverine*|Clearwater2*|OtterLake*|QuartzDd*|Redstart8Mk2Quartz4*|CitrineDd*)
OtterLake*)
if ! cmdline_has crashkernel; then
cmdline_add crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-16G:448M,16G-32G:768M,32G-:1G@960M
fi
;;
Wolverine*|Clearwater2*|QuartzDd*|Redstart8Mk2Quartz4*|CitrineDd*)
if ! cmdline_has crashkernel; then
cmdline_add crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-16G:448M,16G-32G:768M,32G-:1G
fi
Expand Down
10 changes: 10 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/kdump.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"KDUMP_WITH_VALID_VALUES_4": {
"desc": "Configuring the kdump with valid values."
},
"KDUMP_WITH_VALID_MEM_OFFSET": {
"desc": "Configuring the kdump with valid values and memory offset."
},
"KDUMP_WITH_VALID_MEM_OFFSET_2": {
"desc": "Configuring the kdump with valid values and memory offset."
},
"KDUMP_WITH_INVALID_NUM_DUMPS": {
"desc": "Configuring kdump config with a invalid number of allowed kdumps.",
"eStrKey": "Range"
Expand All @@ -19,6 +25,10 @@
"desc": "Configuring kdump config with invalid memory config.",
"eStrKey": "Pattern"
},
"KDUMP_WITH_INVALID_MEM_OFFSET": {
"desc": "Configuring kdump config with invalid memory offset.",
"eStrKey": "Pattern"
},
"KDUMP_WITH_VALID_REMOTE_VALUES": {
"desc": "Configuring the kdump with valid remote ssh values."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,34 @@
}
}
},
"KDUMP_WITH_VALID_MEM_OFFSET": {
"sonic-kdump:sonic-kdump": {
"sonic-kdump:KDUMP": {
"config": {
"enabled": "true",
"num_dumps": "3",
"memory": "512-4G:37M,4G-8G:41M,8G-:59M@960M",
"remote": "true",
"ssh_string" : "[email protected]",
"ssh_path": "/home/ali/.ssh/id_rsa"
}
}
}
},
"KDUMP_WITH_VALID_MEM_OFFSET_2": {
"sonic-kdump:sonic-kdump": {
"sonic-kdump:KDUMP": {
"config": {
"enabled": "true",
"num_dumps": "3",
"memory": "512-4G:37M,4G-8G:41M,8G-:59M@1G",
"remote": "true",
"ssh_string" : "[email protected]",
"ssh_path": "/home/ali/.ssh/id_rsa"
}
}
}
},

"KDUMP_WITH_INVALID_NUM_DUMPS": {
"sonic-kdump:sonic-kdump": {
Expand Down Expand Up @@ -84,6 +112,20 @@
}
}
},
"KDUMP_WITH_INVALID_MEM_OFFSET": {
"sonic-kdump:sonic-kdump": {
"sonic-kdump:KDUMP": {
"config": {
"enabled": "true",
"num_dumps": "3",
"memory": "512-4G:37M,4G-8G:41M,8G-:59M@100",
"remote": "true",
"ssh_string" : "[email protected]",
"ssh_path": "/home/ali/.ssh/id_rsa"
}
}
}
},

"KDUMP_WITH_VALID_REMOTE_VALUES": {
"sonic-kdump:sonic-kdump": {
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-kdump.yang
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module sonic-kdump {

leaf memory {
type string {
pattern "(((([0-9]+[MG]?)?(-([0-9]+[MG])?):)?[0-9]+[MG],?)+)";
pattern "(((([0-9]+[MG]?)?(-([0-9]+[MG])?):)?[0-9]+[MG],?)+(@[0-9]+[MG])?)";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should have this optional offset inside the big pattern group(currently this regex only will support offset at the end).. What if in future we want to add offsets at other ranges too..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. Updated the change.

}
description
"Memory reserved for loading the crash handler kernel. The amount
Expand Down
Loading