OBS User unknown 2008-09-29 17:30:42 +00:00 committed by Git OBS Bridge
parent f74119dea6
commit 7059a58fae
3 changed files with 197 additions and 1 deletions

View File

@ -0,0 +1,187 @@
Index: e2fsprogs-1.41.1/e2fsck/splash.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ e2fsprogs-1.41.1/e2fsck/splash.c 2008-09-29 16:42:50.000000000 +0200
@@ -0,0 +1,101 @@
+/*
+ * add support for switching the splash screen on boot
+ */
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include "splash.h"
+
+static int verbose = 0;
+
+/* nop implementation
+ */
+static void nop(void)
+{
+}
+
+static struct splash_ops nop_ops = {
+ .splash_on = nop,
+ .splash_off = nop
+};
+
+/*
+ * bootsplash implementation
+ */
+#define BOOTSPLASH_CTL "/proc/splash"
+
+static int bootsplash_exists(void)
+{
+ struct stat sb;
+
+ if (stat(BOOTSPLASH_CTL, &sb) == -1)
+ return 0;
+
+ if (S_ISREG(sb.st_mode))
+ return 1;
+
+ return 0;
+}
+
+/* write msg to splash control, must be \0 terminated */
+static void bootsplash_msg(const char *msg, size_t size)
+{
+ int fd;
+ size_t written;
+
+ fd = open(BOOTSPLASH_CTL, O_WRONLY);
+ if (fd == -1) {
+ if (verbose)
+ printf("cannot open %s\n", BOOTSPLASH_CTL);
+ return;
+ }
+
+ written = write(fd, msg, size);
+ if (written != size) {
+ if (verbose)
+ printf("size = %i, written = %i\n", size, written);
+ }
+ (void)write(fd, "\n", 1);
+
+ close(fd);
+}
+
+static void bootsplash_on(void)
+{
+ if (verbose)
+ printf("setting bootsplash silent\n");
+ bootsplash_msg("silent", 6);
+}
+
+static void bootsplash_off(void)
+{
+ if (verbose)
+ printf("setting bootsplash verbose\n");
+ bootsplash_msg("verbose", 7);
+}
+
+static struct splash_ops bootsplash_ops = {
+ .splash_on = bootsplash_on,
+ .splash_off = bootsplash_off
+};
+
+/*
+ * Initialisation
+ */
+void splash_init(struct splash_ops **ops)
+{
+ if (bootsplash_exists())
+ *ops = &bootsplash_ops;
+ else
+ *ops = &nop_ops;
+}
+
+void splash_set_verbose(void)
+{
+ verbose = 1;
+}
+
Index: e2fsprogs-1.41.1/e2fsck/splash.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ e2fsprogs-1.41.1/e2fsck/splash.h 2008-09-29 16:42:23.000000000 +0200
@@ -0,0 +1,13 @@
+#ifndef _SPLASH_H
+#define _SPLASH_H
+
+struct splash_ops {
+ void (*splash_on)(void);
+ void (*splash_off)(void);
+};
+
+void splash_init(struct splash_ops **ops);
+void splash_set_verbose(void);
+
+#endif /* _SPLASH_H */
+
Index: e2fsprogs-1.41.1/e2fsck/Makefile.in
===================================================================
--- e2fsprogs-1.41.1.orig/e2fsck/Makefile.in 2008-09-29 16:28:15.000000000 +0200
+++ e2fsprogs-1.41.1/e2fsck/Makefile.in 2008-09-29 16:37:41.000000000 +0200
@@ -63,7 +63,7 @@ COMPILE_ET=$(top_builddir)/lib/et/compil
OBJS= crc32.o dict.o unix.o e2fsck.o super.o pass1.o pass1b.o pass2.o \
pass3.o pass4.o pass5.o journal.o badblocks.o util.o dirinfo.o \
dx_dirinfo.o ehandler.o problem.o message.o recovery.o region.o \
- revoke.o ea_refcount.o rehash.o profile.o prof_err.o $(MTRACE_OBJ)
+ revoke.o ea_refcount.o rehash.o profile.o prof_err.o splash.o $(MTRACE_OBJ)
PROFILED_OBJS= profiled/dict.o profiled/unix.o profiled/e2fsck.o \
profiled/super.o profiled/pass1.o profiled/pass1b.o \
@@ -101,6 +101,7 @@ SRCS= $(srcdir)/e2fsck.c \
$(srcdir)/rehash.c \
$(srcdir)/region.c \
$(srcdir)/profile.c \
+ $(srcdir)/splash.c \
prof_err.c \
$(MTRACE_SRC)
@@ -470,3 +471,5 @@ region.o: $(srcdir)/region.c $(srcdir)/e
profile.o: $(srcdir)/profile.c $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/profile.h prof_err.h
prof_err.o: prof_err.c
+splash.o: splash.c splash.h
+
Index: e2fsprogs-1.41.1/e2fsck/unix.c
===================================================================
--- e2fsprogs-1.41.1.orig/e2fsck/unix.c 2008-09-01 17:34:28.000000000 +0200
+++ e2fsprogs-1.41.1/e2fsck/unix.c 2008-09-29 16:28:15.000000000 +0200
@@ -53,6 +53,7 @@ extern int optind;
#include "e2p/e2p.h"
#include "e2fsck.h"
#include "problem.h"
+#include "splash.h"
#include "../version.h"
/* Command line options */
@@ -895,6 +896,7 @@ int main (int argc, char *argv[])
int sysval, sys_page_size = 4096;
__u32 features[3];
char *cp;
+ struct splash_ops *sops;
clear_problem_context(&pctx);
#ifdef MTRACE
@@ -924,6 +926,7 @@ int main (int argc, char *argv[])
exit(FSCK_ERROR);
}
reserve_stdio_fds();
+ splash_init(&sops);
#ifdef RESOURCE_TRACK
init_resource_track(&ctx->global_rtrack, NULL);
@@ -1242,6 +1245,7 @@ print_unsupp_features:
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
fatal_error(ctx, 0);
check_if_skip(ctx);
+ sops->splash_off();
if (bad_blocks_file)
read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);
else if (cflag)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Sep 29 18:28:40 CEST 2008 - mkoenig@suse.de
- e2fsck: shut off splash screen when check is needed [bnc#237283]
-------------------------------------------------------------------
Mon Sep 15 15:23:43 CEST 2008 - mkoenig@suse.de

View File

@ -27,7 +27,7 @@ Supplements: filesystem(ext2) filesystem(ext3)
PreReq: %install_info_prereq
AutoReqProv: on
Version: 1.41.1
Release: 8
Release: 9
Summary: Utilities for the Second Extended File System
Url: http://e2fsprogs.sourceforge.net
Source: %{name}-%{version}.tar.bz2
@ -43,6 +43,7 @@ Patch2: e2fsprogs-base_devt.patch
Patch3: e2fsprogs-libvolume_id-support.patch
Patch5: e2fsprogs-1.40.4-uuidd_pid_path.patch
Patch6: e2fsprogs-1.41.1-link_fix.patch
Patch7: e2fsprogs-1.41.1-splash_support.patch
# libcom_err patches
# 66534 - [SL 10.0] et_list handling of krb5 and libcom_err.so.2 conflict
Patch31: libcom_err-no-init_error_table.patch
@ -245,6 +246,7 @@ Authors:
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# libcom_err patches
%patch31 -p1
%patch32 -p1
@ -466,6 +468,8 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/com_err.3.gz
%changelog
* Mon Sep 29 2008 mkoenig@suse.de
- e2fsck: shut off splash screen when check is needed [bnc#237283]
* Mon Sep 15 2008 mkoenig@suse.de
- remove recommends of uuid-runtime from libuuid [bnc#426278]
- move uuid hints README.SUSE.uuidd to uuid-runtime package