1 Index: e2fsck/Makefile.in
2 ===================================================================
3 --- e2fsck/Makefile.in.orig 2012-06-04 18:49:33.000000000 +0200
4 +++ e2fsck/Makefile.in 2012-06-14 09:50:56.344425761 +0200
5 @@ -68,7 +68,7 @@ OBJS= crc32.o dict.o unix.o e2fsck.o sup
6 pass3.o pass4.o pass5.o journal.o badblocks.o util.o dirinfo.o \
7 dx_dirinfo.o ehandler.o problem.o message.o quota.o recovery.o \
8 region.o revoke.o ea_refcount.o rehash.o profile.o prof_err.o \
9 - logfile.o sigcatcher.o $(MTRACE_OBJ)
10 + logfile.o sigcatcher.o splash.o $(MTRACE_OBJ)
12 PROFILED_OBJS= profiled/dict.o profiled/unix.o profiled/e2fsck.o \
13 profiled/super.o profiled/pass1.o profiled/pass1b.o \
14 @@ -107,6 +107,7 @@ SRCS= $(srcdir)/e2fsck.c \
18 + $(srcdir)/splash.c \
19 $(srcdir)/sigcatcher.c \
22 @@ -539,6 +540,7 @@ region.o: $(srcdir)/region.c $(top_build
23 $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
24 $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
25 $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
26 +splash.o: $(srcdir)/splash.c $(srcdir)/splash.h
27 profile.o: $(srcdir)/profile.c $(top_builddir)/lib/config.h \
28 $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
29 $(srcdir)/profile.h prof_err.h
30 Index: e2fsck/splash.c
31 ===================================================================
32 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
33 +++ e2fsck/splash.c 2012-06-14 09:50:21.834048298 +0200
36 + * add support for switching the splash screen on boot
40 +#include <sys/types.h>
41 +#include <sys/stat.h>
47 +static int verbose = 0;
49 +/* nop implementation
51 +static void nop(void)
55 +static struct splash_ops nop_ops = {
61 + * bootsplash implementation
63 +#define BOOTSPLASH_CTL "/proc/splash"
65 +static int bootsplash_exists(void)
69 + if (stat(BOOTSPLASH_CTL, &sb) == -1)
72 + if (S_ISREG(sb.st_mode))
78 +/* write msg to splash control */
79 +static void bootsplash_msg(const char *msg, size_t size)
84 + fd = open(BOOTSPLASH_CTL, O_WRONLY);
87 + printf("cannot open %s\n", BOOTSPLASH_CTL);
91 + written = write(fd, msg, size);
92 + if (written != size) {
94 + printf("size = %i, written = %i\n", size, written);
100 +static void bootsplash_on(void)
103 + printf("setting bootsplash silent\n");
104 + bootsplash_msg("silent\n", 7);
107 +static void bootsplash_off(void)
110 + printf("setting bootsplash verbose\n");
111 + bootsplash_msg("verbose\n", 8);
114 +static struct splash_ops bootsplash_ops = {
115 + .splash_on = bootsplash_on,
116 + .splash_off = bootsplash_off
122 +void splash_init(struct splash_ops **ops)
124 + if (bootsplash_exists())
125 + *ops = &bootsplash_ops;
130 +void splash_set_verbose(void)
135 Index: e2fsck/splash.h
136 ===================================================================
137 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
138 +++ e2fsck/splash.h 2012-06-14 09:50:21.834048298 +0200
144 + void (*splash_on)(void);
145 + void (*splash_off)(void);
148 +void splash_init(struct splash_ops **ops);
149 +void splash_set_verbose(void);
151 +#endif /* _SPLASH_H */
154 ===================================================================
155 --- e2fsck/unix.c.orig 2012-06-12 04:12:50.000000000 +0200
156 +++ e2fsck/unix.c 2012-06-14 09:50:21.834048298 +0200
157 @@ -51,6 +51,7 @@ extern int optind;
162 #include "../version.h"
164 /* Command line options */
165 @@ -1141,6 +1142,7 @@ int main (int argc, char *argv[])
168 int qtype; /* quota type */
169 + struct splash_ops *sops;
171 clear_problem_context(&pctx);
173 @@ -1172,6 +1174,7 @@ int main (int argc, char *argv[])
177 + splash_init(&sops);
181 @@ -1548,6 +1551,7 @@ print_unsupp_features:
184 check_resize_inode(ctx);
185 + sops->splash_off();
187 read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);