#! /bin/sh /usr/share/dpatch/dpatch-run # --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by scripts/Create-CopyPatch. # # T2 SDE: package/.../arcload/15_config_in_etc.patch # Copyright (C) 2020 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- ## 15_config_in_etc.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Look for arc.cf in /etc, fallback to / otherwise to maintain ## DP: compatibility with upstream. @DPATCH@ diff -urNad arcload-0.5~/loader/config.c arcload-0.5/loader/config.c --- arcload-0.5~/loader/config.c 2007-11-25 19:01:37.000000000 +0000 +++ arcload-0.5/loader/config.c 2007-11-25 19:07:10.000000000 +0000 @@ -15,7 +15,8 @@ #define READBLOCK 256 #define STRING_LEN 1024 -#define CONFIG_FILE "/arc.cf" +#define CONFIG_FILE "/arc.cf" +#define ALT_CONFIG_FILE "/boot/arc.cf" #define DEFAULT_KERNEL "/vmlinux" #define T_NONE 0 @@ -369,10 +370,16 @@ strcat(str, CONFIG_FILE); if(bopen(&file, str)) { printf("Opening %s failed - using default configuration.\n\r", str); - strcpy(image, system); - strcat(image, DEFAULT_KERNEL); - return; + strcpy(str, system); + strcat(str, ALT_CONFIG_FILE); + + if (bopen(&file, str)) { + printf("Opening %s failed - using default configuration.\n\r", str); + strcpy(image, system); + strcat(image, DEFAULT_KERNEL); + return; + } } if(!*label)