Dash:
[t2.git] / package / boot / arcload / 15_config_in_etc.patch
blob3d8dca2a88cb1b12d3386c008bd8073961349e41
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 #
5 # T2 SDE: package/.../arcload/15_config_in_etc.patch
6 # Copyright (C) 2020 The T2 SDE Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
10 # This patch file is dual-licensed. It is available under the license the
11 # patched project is licensed under, as long as it is an OpenSource license
12 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
13 # of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 ## 15_config_in_etc.dpatch by <jblache@debian.org>
20 ## All lines beginning with `## DP:' are a description of the patch.
21 ## DP: Look for arc.cf in /etc, fallback to / otherwise to maintain
22 ## DP: compatibility with upstream.
24 @DPATCH@
25 diff -urNad arcload-0.5~/loader/config.c arcload-0.5/loader/config.c
26 --- arcload-0.5~/loader/config.c 2007-11-25 19:01:37.000000000 +0000
27 +++ arcload-0.5/loader/config.c 2007-11-25 19:07:10.000000000 +0000
28 @@ -15,7 +15,8 @@
29 #define READBLOCK 256
31 #define STRING_LEN 1024
32 -#define CONFIG_FILE "/arc.cf"
33 +#define CONFIG_FILE "/arc.cf"
34 +#define ALT_CONFIG_FILE "/boot/arc.cf"
35 #define DEFAULT_KERNEL "/vmlinux"
37 #define T_NONE 0
38 @@ -369,10 +370,16 @@
39 strcat(str, CONFIG_FILE);
41 if(bopen(&file, str)) {
42 printf("Opening %s failed - using default configuration.\n\r", str);
43 - strcpy(image, system);
44 - strcat(image, DEFAULT_KERNEL);
45 - return;
46 + strcpy(str, system);
47 + strcat(str, ALT_CONFIG_FILE);
49 + if (bopen(&file, str)) {
50 + printf("Opening %s failed - using default configuration.\n\r", str);
51 + strcpy(image, system);
52 + strcat(image, DEFAULT_KERNEL);
53 + return;
54 + }
57 if(!*label)