Date:2012-02-26 00:35:09 (7 years 3 months ago)
Author:Werner Almesberger
Commit:fe7a33480882f704b0bbd0fa59d05424b20def5c
Message:M1 build process update

- synchronized patch set with
http://www.milkymist.org/wiki/index.php?title=Pending_RTEMS_PRs

- switched from using RTEMS CVS to git

- commented out patches already applied in git

- updated softusb-input.h update process
Files: m1/patches/rtems/bootp-dhcp-cleanup.patch (1 diff)
m1/patches/rtems/export-shell-fns.patch (1 diff)
m1/patches/rtems/fix-dns-in-dhcp.patch (1 diff)
m1/patches/rtems/series (1 diff)

Change Details

m1/patches/rtems/bootp-dhcp-cleanup.patch
1commit c4fc8e1f7ebc16926a7b2c64cb433bf03408a04f
2Author: Sebastien Bourdeauducq <sebastien@milkymist.org>
3Date: Fri Feb 24 21:57:21 2012 +0100
4
5    BOOTP/DHCP header cleanup
6
7diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
8index 4021bc6..df8b0c5 100644
9--- a/cpukit/libnetworking/nfs/bootp_subr.c
10@@ -71,9 +71,12 @@
11 #include <fcntl.h>
12 #include <rtems/mkrootfs.h>
13 #include <rtems/rtems_bsdnet.h>
14+#include <rtems/rtems_bsdnet_internal.h>
15 #include <rtems/bsdnet/servers.h>
16 #include <inttypes.h>
17
18+#include "rtems/bootp.h"
19+
20 #define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
21
22 /*
23@@ -138,20 +141,6 @@ void bootpboot_p_rtlist(void);
24 void bootpboot_p_iflist(void);
25 #endif
26
27-int bootpc_call(struct bootp_packet *call,
28- struct bootp_packet *reply,
29- struct proc *procp);
30-
31-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
32- struct proc *procp);
33-
34-int
35-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
36- struct sockaddr_in *myaddr,
37- struct sockaddr_in *netmask,
38- struct sockaddr_in *gw,
39- struct proc *procp);
40-
41 #ifdef BOOTP_DEBUG
42 void
43 bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma)
44@@ -271,7 +260,7 @@ bootpboot_p_iflist(void)
45  * - allocate or reallocate dst, so that string fits in
46  * - copy string from src to dest
47  */
48-static void *bootp_strdup_realloc(char *dst,const char *src)
49+void *bootp_strdup_realloc(char *dst,const char *src)
50 {
51   size_t len;
52
53diff --git a/cpukit/libnetworking/rtems/bootp.h b/cpukit/libnetworking/rtems/bootp.h
54new file mode 100644
55index 0000000..21bdb79
56--- /dev/null
57@@ -0,0 +1,39 @@
58+/* Subroutines from c/src/libnetworking/nfs/bootp_subr.c */
59+
60+#if !defined (__RTEMS_BOOTP_H__)
61+#define __RTEMS_BOOTP_H__
62+
63+#if __cplusplus
64+extern "C"
65+{
66+#endif
67+
68+struct bootp_packet;
69+struct proc;
70+struct ifreq;
71+struct socket;
72+struct sockaddr_in;
73+
74+bool bootpc_init(bool, bool);
75+
76+int bootpc_call(
77+ struct bootp_packet *call,
78+ struct bootp_packet *reply,
79+ struct proc *procp);
80+int bootpc_fakeup_interface(struct ifreq *ireq,
81+ struct socket *so,
82+ struct proc *procp);
83+int bootpc_adjust_interface(struct ifreq *ireq,
84+ struct socket *so,
85+ struct sockaddr_in *myaddr,
86+ struct sockaddr_in *netmask,
87+ struct sockaddr_in *gw,
88+ struct proc *procp);
89+
90+void *bootp_strdup_realloc(char *dst, const char *src);
91+
92+#if __cplusplus
93+}
94+#endif
95+
96+#endif
97diff --git a/cpukit/libnetworking/rtems/rtems_bootp.c b/cpukit/libnetworking/rtems/rtems_bootp.c
98index caf2faa..6a644a4 100644
99--- a/cpukit/libnetworking/rtems/rtems_bootp.c
100@@ -12,6 +12,8 @@
101 #include <rtems/rtems_bsdnet.h>
102 #include <rtems/rtems_bsdnet_internal.h>
103
104+#include "rtems/bootp.h"
105+
106 /*
107  * Perform a BOOTP request
108  */
109diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
110index c8bdfd4..9721e1c 100644
111--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
112@@ -179,7 +179,6 @@ void domaininit (void *);
113 void ifinit (void *);
114 void ipintr (void);
115 void arpintr (void);
116-bool bootpc_init(bool, bool);
117 int socket (int, int, int);
118 int ioctl (int, ioctl_command_t, ...);
119
120diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
121index e01846e..285ce1e 100644
122--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
123@@ -99,6 +99,7 @@
124 #include <rtems/mkrootfs.h>
125
126 #include "rtems/dhcp.h"
127+#include "rtems/bootp.h"
128
129 #ifndef EALEN
130 #define EALEN 6
131@@ -167,25 +168,6 @@ struct dhcp_packet
132 };
133
134 /*
135- * External Declarations for Functions found in
136- * rtems/c/src/libnetworking/nfs/
137- */
138-extern int bootpc_call (struct dhcp_packet *call,
139- struct dhcp_packet *reply,
140- struct proc *procp);
141-extern int bootpc_fakeup_interface (struct ifreq *ireq,
142- struct socket *so,
143- struct proc *procp);
144-extern int bootpc_adjust_interface (struct ifreq *ireq,
145- struct socket *so,
146- struct sockaddr_in *myaddr,
147- struct sockaddr_in *netmask,
148- struct sockaddr_in *gw,
149- struct proc *procp);
150-extern void *bootp_strdup_realloc (char *dst,
151- const char *src);
152-
153-/*
154  * Variables
155  */
156 static int dhcp_option_overload = 0;
157@@ -724,7 +706,7 @@ dhcp_task (rtems_task_argument _sdl)
158       /*
159        * Send the Request.
160        */
161- error = bootpc_call (&call, &dhcp_req, procp);
162+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&dhcp_req, procp);
163       if (error) {
164         rtems_bsdnet_semaphore_release ();
165         printf ("DHCP call failed -- error %d", error);
166@@ -918,7 +900,7 @@ dhcp_init (int update_files)
167   /*
168    * Send the Discover.
169    */
170- error = bootpc_call (&call, &reply, procp);
171+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&reply, procp);
172   if (error) {
173     printf ("BOOTP call failed -- %s\n", strerror(error));
174     soclose (so);
175@@ -947,7 +929,7 @@ dhcp_init (int update_files)
176    */
177   dhcp_request_req (&call, &reply, sdl, true);
178
179- error = bootpc_call (&call, &reply, procp);
180+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&reply, procp);
181   if (error) {
182     printf ("BOOTP call failed -- %s\n", strerror(error));
183     soclose (so);
m1/patches/rtems/export-shell-fns.patch
1commit 27f66fa6a8ea83283b05dcdfa4d70c9048adf448
2Author: Sebastien Bourdeauducq <sebastien@milkymist.org>
3Date: Fri Feb 24 21:58:20 2012 +0100
4
5    Export rtems_shell_init_env, rtems_shell_env_free, rtems_shell_main_mv, rtems_shell_main_cp and rtems_shell_main_rm
6
7diff --git a/cpukit/libmisc/shell/main_mv.c b/cpukit/libmisc/shell/main_mv.c
8index 7e3db0f..5cfddc9 100644
9--- a/cpukit/libmisc/shell/main_mv.c
10@@ -116,7 +116,7 @@ rtems_shell_mv_exit (rtems_shell_mv_globals* globals, int code)
11 const char *user_from_uid(uid_t uid, int nouser);
12 char *group_from_gid(gid_t gid, int nogroup);
13
14-static int
15+int
16 rtems_shell_main_mv(int argc, char *argv[])
17 {
18   rtems_shell_mv_globals mv_globals;
19diff --git a/cpukit/libmisc/shell/shell.c b/cpukit/libmisc/shell/shell.c
20index 14b609b..9c4b1d5 100644
21--- a/cpukit/libmisc/shell/shell.c
22@@ -61,7 +61,7 @@ rtems_shell_env_t *rtems_current_shell_env = &rtems_global_shell_env;
23 /*
24  * Initialize the shell user/process environment information
25  */
26-static rtems_shell_env_t *rtems_shell_init_env(
27+rtems_shell_env_t *rtems_shell_init_env(
28   rtems_shell_env_t *shell_env_p
29 )
30 {
31@@ -83,7 +83,7 @@ static rtems_shell_env_t *rtems_shell_init_env(
32 /*
33  * Completely free a shell_env_t and all associated memory
34  */
35-static void rtems_shell_env_free(
36+void rtems_shell_env_free(
37   void *ptr
38 )
39 {
40diff --git a/cpukit/libmisc/shell/shell.h b/cpukit/libmisc/shell/shell.h
41index f71cadd..a3abd3e 100644
42--- a/cpukit/libmisc/shell/shell.h
43@@ -207,6 +207,13 @@ bool rtems_shell_main_loop(
44   rtems_shell_env_t *rtems_shell_env
45 );
46
47+rtems_shell_env_t *rtems_shell_init_env(
48+ rtems_shell_env_t *shell_env_p
49+);
50+void rtems_shell_env_free(
51+ void *ptr
52+);
53+
54 extern rtems_shell_env_t rtems_global_shell_env;
55 extern rtems_shell_env_t *rtems_current_shell_env;
56
57@@ -307,6 +314,13 @@ extern rtems_status_code rtems_shell_wait_for_input(
58
59 extern int rtems_shell_main_monitor(int argc, char **argv);
60
61+/*
62+ * Provide these commands for application use, as their implementation
63+ * is tedious.
64+ */
65+int rtems_shell_main_mv(int argc, char *argv[]);
66+int rtems_shell_main_cp(int argc, char *argv[]);
67+int rtems_shell_main_rm(int argc, char *argv[]);
68
69 #ifdef __cplusplus
70 }
m1/patches/rtems/fix-dns-in-dhcp.patch
1commit efedf0ad42d7d8989b62ec7c158b0a0a1f3b4197
2Author: Sebastien Bourdeauducq <sebastien@milkymist.org>
3Date: Fri Feb 24 23:04:56 2012 +0100
4
5    Fix incorrect processing of DNS info from DHCP (revised patch)
6
7diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
8index 285ce1e..4039a48 100644
9--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
10@@ -187,6 +187,35 @@ static const char dhcp_request_parameters[5] = { DHCP_SUBNET,
11                                                          DHCP_DNS,
12                                                          DHCP_HOST,
13                                                          DHCP_DOMAIN_NAME };
14+#define NUM_NAMESERVERS \
15+ (sizeof rtems_bsdnet_config.name_server / sizeof rtems_bsdnet_config.name_server[0])
16+static struct in_addr rtems_dhcpd_nameserver[NUM_NAMESERVERS];
17+static int rtems_dhcpd_nameserver_count = 0;
18+
19+/*
20+ * Clean any DNS entries add by a DHCP request.
21+ */
22+static void
23+clean_dns_entries (void)
24+{
25+ int e;
26+ for (e = 0; e < rtems_dhcpd_nameserver_count; ++e)
27+ {
28+ int n;
29+ for (n = 0; n < rtems_bsdnet_nameserver_count; ++ n)
30+ {
31+ if (memcmp (&rtems_dhcpd_nameserver[e], &rtems_bsdnet_nameserver[n], 4) == 0)
32+ {
33+ if (n < (NUM_NAMESERVERS - 1))
34+ memmove (&rtems_bsdnet_nameserver[n],
35+ &rtems_bsdnet_nameserver[n + 1],
36+ (NUM_NAMESERVERS - n - 1) * 4);
37+ --rtems_bsdnet_nameserver_count;
38+ }
39+ }
40+ }
41+ rtems_dhcpd_nameserver_count = 0;
42+}
43
44 /*
45  * Format an IP address in dotted decimal.
46@@ -345,10 +374,12 @@ process_options (unsigned char *optbuf, int optbufSize)
47         {
48           int dlen = 0;
49           while ((dlen < len) &&
50- (rtems_bsdnet_nameserver_count <
51- sizeof rtems_bsdnet_config.name_server /
52- sizeof rtems_bsdnet_config.name_server[0]))
53+ (rtems_dhcpd_nameserver_count < NUM_NAMESERVERS) &&
54+ (rtems_bsdnet_nameserver_count < NUM_NAMESERVERS))
55           {
56+ memcpy (&rtems_dhcpd_nameserver
57+ [rtems_dhcpd_nameserver_count], p + dlen, 4);
58+ rtems_dhcpd_nameserver_count++;
59             memcpy (&rtems_bsdnet_nameserver
60                     [rtems_bsdnet_nameserver_count], p + dlen, 4);
61             rtems_bsdnet_nameserver_count++;
62@@ -725,6 +756,15 @@ dhcp_task (rtems_task_argument _sdl)
63         continue;
64       }
65
66+ /*
67+ * We have an ack. Clear the DNS entries that have been assigned by a previous
68+ * DHCP request.
69+ */
70+ clean_dns_entries ();
71+
72+ /*
73+ * Process this requests options.
74+ */
75       process_options (&dhcp_req.vend[4], sizeof (dhcp_req.vend) - 4);
76
77       if (dhcp_message_type != DHCP_ACK)
78@@ -839,6 +879,8 @@ dhcp_init (int update_files)
79   struct sockaddr_dl *sdl = NULL;
80   struct proc *procp = NULL;
81
82+ clean_dns_entries();
83+
84   /*
85    * If we are to update the files create the root
86    * file structure.
m1/patches/rtems/series
1414# milkymist-map-sysfreq.patch - applied 2011-11-27
1515# milkymist-videoformat.patch - applied 2011-11-27
1616#fix-timer-includes.patch
17milkymist-usb-midi.patch
18milkymist-midi-opt.patch # - applied 2011-12-06
19fix-ftpd-root.patch # - applied 2012-02-02 796bb3f51cc2a1f7789a3371
20mem-fixes.patch # - fixed 2012-02-02
17milkymist-usb-midi.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2028
18#milkymist-midi-opt.patch # - applied 2011-12-06
19#fix-ftpd-root.patch # - applied 2012-02-02 796bb3f51cc2a1f7789a3371
20#mem-fixes.patch # - fixed 2012-02-02
2121fix-the-vga-vsync-pulses.patch
22# https://www.rtems.org/bugzilla/show_bug.cgi?id=2029
23fix-dns-in-dhcp.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=1841
24export-shell-fns.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2030
25bootp-dhcp-cleanup.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2031

Archive Download the corresponding diff file

Branches:
master



interactive