Skip to content

Instantly share code, notes, and snippets.

@Fohdeesha
Fohdeesha / ICX7150 u-boot factory reset source
Created September 4, 2021 08:57
ICX7150 u-boot factory default routine
+int do_factory_default(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ int ret = 1;
+ char ch;
+
+ switch (argc) {
+ case 2:
+ if(strcmp(argv[1],"set-default") == 0) {
+ printf("Execution of \"factory set-default\" will remove all user data like config, keys etc.\n\n");
+ printf("Do you want to continue? (Y/N) ");
@Fohdeesha
Fohdeesha / FI 8080b fipsreset
Created September 4, 2021 08:51
FI 8080b fips_reset routine (from /etc/init.sh)
#if fips_reset is set in uboot cleanup the startup-config files
cat /proc/cmdline | grep "fipsreset" 1>/dev/null 2>&1
if [ $? -eq 0 ]
then
fnLog "FIPS reset is enable."
fnLog "Removing startup config & backup"
rm -rf /fast_iron/startup-* 1>/dev/null 2>&1
fnLog "Removing stacking.boot"
rm -rf '/fast_iron/stacking.boot' 1>/dev/null 2>&1
fnLog "Removing SSL_CERT_FILE"