aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /usr
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'usr')
-rw-r--r--usr/Kconfig10
-rw-r--r--usr/gen_init_cpio.c44
2 files changed, 26 insertions, 28 deletions
diff --git a/usr/Kconfig b/usr/Kconfig
index 085872bb2bb..65b845bd4e3 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -134,7 +134,7 @@ config INITRAMFS_COMPRESSION_BZIP2
134 depends on RD_BZIP2 134 depends on RD_BZIP2
135 help 135 help
136 Its compression ratio and speed is intermediate. 136 Its compression ratio and speed is intermediate.
137 Decompression speed is slowest among the choices. The initramfs 137 Decompression speed is slowest among the four. The initramfs
138 size is about 10% smaller with bzip2, in comparison to gzip. 138 size is about 10% smaller with bzip2, in comparison to gzip.
139 Bzip2 uses a large amount of memory. For modern kernels you 139 Bzip2 uses a large amount of memory. For modern kernels you
140 will need at least 8MB RAM or more for booting. 140 will need at least 8MB RAM or more for booting.
@@ -143,9 +143,9 @@ config INITRAMFS_COMPRESSION_LZMA
143 bool "LZMA" 143 bool "LZMA"
144 depends on RD_LZMA 144 depends on RD_LZMA
145 help 145 help
146 This algorithm's compression ratio is best. 146 The most recent compression algorithm.
147 Decompression speed is between the other choices. 147 Its ratio is best, decompression speed is between the other
148 Compression is slowest. The initramfs size is about 33% 148 three. Compression is slowest. The initramfs size is about 33%
149 smaller with LZMA in comparison to gzip. 149 smaller with LZMA in comparison to gzip.
150 150
151config INITRAMFS_COMPRESSION_XZ 151config INITRAMFS_COMPRESSION_XZ
@@ -161,7 +161,7 @@ config INITRAMFS_COMPRESSION_LZO
161 bool "LZO" 161 bool "LZO"
162 depends on RD_LZO 162 depends on RD_LZO
163 help 163 help
164 Its compression ratio is the poorest among the choices. The kernel 164 Its compression ratio is the poorest among the four. The kernel
165 size is about 10% bigger than gzip; however its speed 165 size is about 10% bigger than gzip; however its speed
166 (both compression and decompression) is the fastest. 166 (both compression and decompression) is the fastest.
167 167
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index af8c925e93e..af0f22fb1ef 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name, const char *location,
303 int retval; 303 int retval;
304 int rc = -1; 304 int rc = -1;
305 int namesize; 305 int namesize;
306 unsigned int i; 306 int i;
307 307
308 mode |= S_IFREG; 308 mode |= S_IFREG;
309 309
@@ -381,30 +381,28 @@ error:
381 381
382static char *cpio_replace_env(char *new_location) 382static char *cpio_replace_env(char *new_location)
383{ 383{
384 char expanded[PATH_MAX + 1]; 384 char expanded[PATH_MAX + 1];
385 char env_var[PATH_MAX + 1]; 385 char env_var[PATH_MAX + 1];
386 char *start; 386 char *start;
387 char *end; 387 char *end;
388 388
389 for (start = NULL; (start = strstr(new_location, "${")); ) { 389 for (start = NULL; (start = strstr(new_location, "${")); ) {
390 end = strchr(start, '}'); 390 end = strchr(start, '}');
391 if (start < end) { 391 if (start < end) {
392 *env_var = *expanded = '\0'; 392 *env_var = *expanded = '\0';
393 strncat(env_var, start + 2, end - start - 2); 393 strncat(env_var, start + 2, end - start - 2);
394 strncat(expanded, new_location, start - new_location); 394 strncat(expanded, new_location, start - new_location);
395 strncat(expanded, getenv(env_var), 395 strncat(expanded, getenv(env_var), PATH_MAX);
396 PATH_MAX - strlen(expanded)); 396 strncat(expanded, end + 1, PATH_MAX);
397 strncat(expanded, end + 1, 397 strncpy(new_location, expanded, PATH_MAX);
398 PATH_MAX - strlen(expanded)); 398 } else
399 strncpy(new_location, expanded, PATH_MAX); 399 break;
400 new_location[PATH_MAX] = 0; 400 }
401 } else 401
402 break; 402 return new_location;
403 }
404
405 return new_location;
406} 403}
407 404
405
408static int cpio_mkfile_line(const char *line) 406static int cpio_mkfile_line(const char *line)
409{ 407{
410 char name[PATH_MAX + 1]; 408 char name[PATH_MAX + 1];