diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 14:36:22 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 15:32:53 +0200 |
commit | f4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch) | |
tree | 487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-devtools/opkg/opkg | |
download | poky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz |
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/opkg/opkg')
3 files changed, 208 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/add-exclude.patch b/meta/recipes-devtools/opkg/opkg/add-exclude.patch new file mode 100644 index 0000000000..8d328d5b86 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/add-exclude.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | Add a way to exclude specific packages from the install | ||
2 | |||
3 | When an excluded package is required by another package an error | ||
4 | will be generated. If the excluded package is only recommended, | ||
5 | no error will be generated. | ||
6 | |||
7 | The lifespan of the exclude_list covers the execution of the process, | ||
8 | so there is no need to free the data. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
13 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
14 | |||
15 | Index: trunk/libopkg/opkg_conf.c | ||
16 | =================================================================== | ||
17 | --- trunk.orig/libopkg/opkg_conf.c | ||
18 | +++ trunk/libopkg/opkg_conf.c | ||
19 | @@ -442,6 +442,7 @@ opkg_conf_init(void) | ||
20 | pkg_dest_list_init(&conf->pkg_dest_list); | ||
21 | pkg_dest_list_init(&conf->tmp_dest_list); | ||
22 | nv_pair_list_init(&conf->arch_list); | ||
23 | + conf->exclude_list = NULL; | ||
24 | |||
25 | return 0; | ||
26 | } | ||
27 | Index: trunk/libopkg/opkg_conf.h | ||
28 | =================================================================== | ||
29 | --- trunk.orig/libopkg/opkg_conf.h | ||
30 | +++ trunk/libopkg/opkg_conf.h | ||
31 | @@ -49,6 +49,8 @@ struct opkg_conf | ||
32 | pkg_dest_list_t pkg_dest_list; | ||
33 | pkg_dest_list_t tmp_dest_list; | ||
34 | nv_pair_list_t arch_list; | ||
35 | + size_t exclude_count; | ||
36 | + char ** exclude_list; | ||
37 | |||
38 | int restrict_to_default_dest; | ||
39 | pkg_dest_t *default_dest; | ||
40 | Index: trunk/libopkg/pkg_depends.c | ||
41 | =================================================================== | ||
42 | --- trunk.orig/libopkg/pkg_depends.c | ||
43 | +++ trunk/libopkg/pkg_depends.c | ||
44 | @@ -212,6 +212,22 @@ pkg_hash_fetch_unsatisfied_dependencies( | ||
45 | continue; | ||
46 | } | ||
47 | |||
48 | + /* Check for excluded packages */ | ||
49 | + if (satisfying_pkg != NULL && conf->exclude_list) { | ||
50 | + int i, exclude = 0; | ||
51 | + for (i = 0; i < conf->exclude_count; i++) { | ||
52 | + if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) { | ||
53 | + opkg_msg(NOTICE, "%s: exclude required package %s" | ||
54 | + "at users request\n", | ||
55 | + pkg->name, satisfying_pkg->name); | ||
56 | + exclude = 1; | ||
57 | + break; | ||
58 | + } | ||
59 | + } | ||
60 | + if (exclude) | ||
61 | + continue; | ||
62 | + } | ||
63 | + | ||
64 | opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg); | ||
65 | if (satisfying_pkg != NULL) { | ||
66 | satisfier_entry_pkg = satisfying_pkg; | ||
67 | Index: trunk/src/opkg-cl.c | ||
68 | =================================================================== | ||
69 | --- trunk.orig/src/opkg-cl.c | ||
70 | +++ trunk/src/opkg-cl.c | ||
71 | @@ -45,6 +45,7 @@ enum { | ||
72 | ARGS_OPT_PREFER_ARCH_TO_VERSION, | ||
73 | ARGS_OPT_ADD_ARCH, | ||
74 | ARGS_OPT_ADD_DEST, | ||
75 | + ARGS_OPT_ADD_EXCLUDE, | ||
76 | ARGS_OPT_NOACTION, | ||
77 | ARGS_OPT_DOWNLOAD_ONLY, | ||
78 | ARGS_OPT_NODEPS, | ||
79 | @@ -95,6 +96,7 @@ static struct option long_options[] = { | ||
80 | {"offline-root", 1, 0, 'o'}, | ||
81 | {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH}, | ||
82 | {"add-dest", 1, 0, ARGS_OPT_ADD_DEST}, | ||
83 | + {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE}, | ||
84 | {"test", 0, 0, ARGS_OPT_NOACTION}, | ||
85 | {"tmp-dir", 1, 0, 't'}, | ||
86 | {"tmp_dir", 1, 0, 't'}, | ||
87 | @@ -198,6 +200,18 @@ args_parse(int argc, char *argv[]) | ||
88 | } | ||
89 | free(tuple); | ||
90 | break; | ||
91 | + case ARGS_OPT_ADD_EXCLUDE: | ||
92 | + tuple = xstrdup(optarg); | ||
93 | + if (!conf->exclude_list) { | ||
94 | + conf->exclude_count = 1; | ||
95 | + conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count); | ||
96 | + conf->exclude_list[conf->exclude_count - 1] = tuple; | ||
97 | + } else { | ||
98 | + conf->exclude_count++; | ||
99 | + conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) * conf->exclude_count); | ||
100 | + conf->exclude_list[conf->exclude_count - 1] = tuple; | ||
101 | + } | ||
102 | + break; | ||
103 | case ARGS_OPT_NOACTION: | ||
104 | conf->noaction = 1; | ||
105 | break; | ||
106 | @@ -282,6 +296,7 @@ usage() | ||
107 | printf("\t--offline-root <dir> offline installation of packages.\n"); | ||
108 | printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n"); | ||
109 | printf("\t--add-dest <name>:<path> Register destination with given path\n"); | ||
110 | + printf("\t--add-exclude <name> Register package to be excluded from install\n"); | ||
111 | printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n"); | ||
112 | printf("\t than the higher version one if more\n"); | ||
113 | printf("\t than one candidate is found.\n"); | ||
diff --git a/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch b/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch new file mode 100644 index 0000000000..6d1ccecbf4 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | Add the ability to not install ANY recommended packages. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
6 | |||
7 | Index: trunk/libopkg/opkg_conf.h | ||
8 | =================================================================== | ||
9 | --- trunk.orig/libopkg/opkg_conf.h | ||
10 | +++ trunk/libopkg/opkg_conf.h | ||
11 | @@ -80,6 +80,7 @@ struct opkg_conf | ||
12 | int prefer_arch_to_version; | ||
13 | int check_signature; | ||
14 | int nodeps; /* do not follow dependencies */ | ||
15 | + int noinstall_recommends; | ||
16 | char *offline_root; | ||
17 | char *overlay_root; | ||
18 | int query_all; | ||
19 | Index: trunk/libopkg/pkg_depends.c | ||
20 | =================================================================== | ||
21 | --- trunk.orig/libopkg/pkg_depends.c | ||
22 | +++ trunk/libopkg/pkg_depends.c | ||
23 | @@ -19,6 +19,7 @@ | ||
24 | #include <ctype.h> | ||
25 | |||
26 | #include "pkg.h" | ||
27 | +#include "opkg_conf.h" | ||
28 | #include "opkg_utils.h" | ||
29 | #include "pkg_hash.h" | ||
30 | #include "opkg_message.h" | ||
31 | @@ -204,7 +205,7 @@ pkg_hash_fetch_unsatisfied_dependencies( | ||
32 | /* user request overrides package recommendation */ | ||
33 | if (satisfying_pkg != NULL | ||
34 | && (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST) | ||
35 | - && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) { | ||
36 | + && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE || conf->noinstall_recommends)) { | ||
37 | opkg_msg(NOTICE, "%s: ignoring recommendation for " | ||
38 | "%s at user request\n", | ||
39 | pkg->name, satisfying_pkg->name); | ||
40 | Index: trunk/src/opkg-cl.c | ||
41 | =================================================================== | ||
42 | --- trunk.orig/src/opkg-cl.c | ||
43 | +++ trunk/src/opkg-cl.c | ||
44 | @@ -50,6 +50,7 @@ enum { | ||
45 | ARGS_OPT_NODEPS, | ||
46 | ARGS_OPT_AUTOREMOVE, | ||
47 | ARGS_OPT_CACHE, | ||
48 | + ARGS_OPT_NOINSTALL_RECOMMENDS, | ||
49 | }; | ||
50 | |||
51 | static struct option long_options[] = { | ||
52 | @@ -89,6 +90,7 @@ static struct option long_options[] = { | ||
53 | {"noaction", 0, 0, ARGS_OPT_NOACTION}, | ||
54 | {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY}, | ||
55 | {"nodeps", 0, 0, ARGS_OPT_NODEPS}, | ||
56 | + {"no-install-recommends", 0, 0, ARGS_OPT_NOINSTALL_RECOMMENDS}, | ||
57 | {"offline", 1, 0, 'o'}, | ||
58 | {"offline-root", 1, 0, 'o'}, | ||
59 | {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH}, | ||
60 | @@ -199,6 +201,9 @@ args_parse(int argc, char *argv[]) | ||
61 | case ARGS_OPT_NOACTION: | ||
62 | conf->noaction = 1; | ||
63 | break; | ||
64 | + case ARGS_OPT_NOINSTALL_RECOMMENDS: | ||
65 | + conf->noinstall_recommends = 1; | ||
66 | + break; | ||
67 | case ARGS_OPT_DOWNLOAD_ONLY: | ||
68 | conf->download_only = 1; | ||
69 | break; | ||
70 | @@ -293,6 +298,8 @@ usage() | ||
71 | printf("\t--noaction No action -- test only\n"); | ||
72 | printf("\t--download-only No action -- download only\n"); | ||
73 | printf("\t--nodeps Do not follow dependencies\n"); | ||
74 | + printf("\t--no-install-recommends\n"); | ||
75 | + printf("\t Do not install any recommended packages\n"); | ||
76 | printf("\t--force-removal-of-dependent-packages\n"); | ||
77 | printf("\t Remove package and all dependencies\n"); | ||
78 | printf("\t--autoremove Remove packages that were installed\n"); | ||
diff --git a/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/meta/recipes-devtools/opkg/opkg/opkg-configure.service new file mode 100644 index 0000000000..b18295b45e --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/opkg-configure.service | |||
@@ -0,0 +1,17 @@ | |||
1 | [Unit] | ||
2 | Description=Opkg first boot configure | ||
3 | DefaultDependencies=no | ||
4 | After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount | ||
5 | Before=sysinit.target | ||
6 | |||
7 | [Service] | ||
8 | Type=oneshot | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/postinst | ||
10 | ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg-cl configure > $LOGFILE 2>&1; else @BINDIR@/opkg-cl configure; fi" | ||
11 | ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service | ||
12 | StandardOutput=syslog | ||
13 | RemainAfterExit=No | ||
14 | |||
15 | [Install] | ||
16 | WantedBy=basic.target | ||
17 | WantedBy=sysinit.target | ||