Finally, support for splashy itself. Index: splashy_funcs.c =================================================================== --- splashy_funcs.c (revision 0) +++ splashy_funcs.c (revision 169) @@ -0,0 +1,71 @@ +/* + * splashy.c + * + * Splashy (userspace splash) splash method support + * + * Copyright (C) 2006 Tim Dijkstra <[EMAIL PROTECTED]> + * + * This file is released under the GPLv2. + * + */ + +#ifdef CONFIG_SPLASHY +#include <string.h> + +#include <splashy.h> + +#include "encrypt.h" +#include "splashy_funcs.h" + +int splashy_open() //char *mode) +{ + char * mode="suspend"; + /* Do some detecting logic here ... */ + if (!splashy_init (NULL,mode)) + return -1; + + if (splashy_start_splash () < 0) + return -1; + + return 0; +} + + +inline int splashy_finish(void) +{ + + splashy_stop_splash(); + + return 0; +} + +inline int splashy_progress(int p) +{ + + splashy_update_progressbar (p); + + return 0; +} + +void splashy_read_password (char *buf, int vrfy) +{ +#if CONFIG_ENCRYPT + char *vrfy_buf = vrfy ? buf + PASS_SIZE : buf; + + do { + while (splashy_get_password(buf,PASS_SIZE, + "Passphrase please (must be non-empty): ") <= 0); + + if (vrfy) + while (splashy_get_password(vrfy_buf,PASS_SIZE, + "Verify passphrase: ") <= 0); + + } while (vrfy && strncmp(buf, vrfy_buf, PASS_SIZE)); +#endif +} + +void splashy_print(const char *str) { + splashy_printline(str); +} + +#endif Index: splashy_funcs.h =================================================================== --- splashy_funcs.h (revision 0) +++ splashy_funcs.h (revision 169) @@ -0,0 +1,25 @@ +/* + * splashy.h + * + * Boot splash related definitions for splashy method + * + * Copyright (C) 2006 Tim Dijkstra <[EMAIL PROTECTED]> + * + * This file is released under the GPLv2. + * + */ + +#ifndef SPLASHY_FUNCS_H +#define SPLASHY_FUNCS_H +#ifdef CONFIG_SPLASHY + +int splashy_open(void); +int splashy_finish(void); +int splashy_progress(int p); +void splashy_read_password(char *, int); +int splashy_getchar(void); +void splashy_print(const char *); + +#endif +#endif /* SPLASHY_FUNCS_H */ + Index: splash.c =================================================================== --- splash.c (revision 164) +++ splash.c (revision 169) @@ -14,6 +14,7 @@ #include "splash.h" #include "bootsplash.h" +#include "splashy_funcs.h" #include "encrypt.h" /** @@ -52,6 +53,14 @@ splash->switch_to = bootsplash_switch_to; splash->getchar = bootsplash_getchar; splash->read_password = bootsplash_read_password; +#ifdef CONFIG_SPLASHY + } else if (!splashy_open()) { + splash->finish = splashy_finish; + splash->progress = splashy_progress; + splash->getchar = splashy_getchar; + splash->read_password = splashy_read_password; + +#endif } else if (0) { /* add another splash system here */ } else { Index: Makefile =================================================================== --- Makefile 2006-09-11 21:05:07.000000000 +0200 +++ Makefile 2006-09-11 23:27:36.000000000 +0200 @@ -1,5 +1,6 @@ #CONFIG_COMPRESS=yes #CONFIG_ENCRYPT=yes +CONFIG_SPLASHY=yes ARCH:=$(shell uname -m) @@ -41,7 +42,20 @@ S2RAMOBJ=vt.o vbetool/thunk.o vbetool/x86-common.o vbetool/vbetool.o vbetool/x86emu/libx86emu.a radeontool.o dmidecode.o endif -SPLASHOBJ = splash.o bootsplash.o +SPLASHOBJ = splash.o bootsplash.o + +ifdef CONFIG_SPLASHY +CC_FLAGS += -DCONFIG_SPLASHY +LD_FLAGS += -lsplashy +SPLASHOBJ += splashy_funcs.o +STATIC_LD_FLAGS= -lsplashycnf \ + $(shell directfb-config --libs --input=keyboard \ + --imageprovider=jpeg,gif,png\ + --font=ft2,default) \ + $(shell pkg-config --static --libs glib-2.0) +STATIC_CC_FLAGS=$(shell directfb-config --cflags)\ + $(shell pkg-config --static --cflags glib-2.0) +endif clean: rm -f $(S2DISK) suspend-keygen suspend.keys resume s2ram *.o vbetool/*.o vbetool/x86emu/*.o vbetool/x86emu/*.a @@ -85,9 +99,12 @@ bootsplash.o: bootsplash.h bootsplash.c $(CC) -g $(CFLAGS) $(CC_FLAGS) -c bootsplash.c -o bootsplash.o -splash.o: splash.h splash.c bootsplash.o vt.o +splash.o: splash.h splash.c bootsplash.o vt.o splashy_funcs.o $(CC) -g $(CFLAGS) $(CC_FLAGS) -c splash.c -o splash.o +splashy_funcs.o: splashy_funcs.c splashy_funcs.h + $(CC) -g $(CFLAGS) $(CC_FLAGS) -c $< -o $@ + $(S2DISK): vt.o md5.o encrypt.o config.o suspend.c swsusp.h config.h encrypt.h md5.h $(SPLASHOBJ) $(CC) -g $(CFLAGS) $(CC_FLAGS) vt.o md5.o encrypt.o config.o suspend.c -o $@ $(SPLASHOBJ) $(LD_FLAGS) @@ -95,7 +112,7 @@ $(CC) -g $(CFLAGS) -DCONFIG_BOTH $(CC_FLAGS) md5.o encrypt.o config.o suspend.c s2ram.c -o $@ $(S2RAMOBJ) $(SPLASHOBJ) $(LD_FLAGS) -lpci resume: md5.o encrypt.o config.o resume.c swsusp.h config.h encrypt.h md5.h $(SPLASHOBJ) - $(CC) $(CFLAGS) $(CC_FLAGS) md5.o encrypt.o config.o vt.o resume.c $(SPLASHOBJ) -static -o resume $(LD_FLAGS) + $(CC) $(CFLAGS) $(CC_FLAGS) $(STATIC_CC_FLAGS) md5.o encrypt.o config.o vt.o resume.c $(SPLASHOBJ) -static -o resume $(LD_FLAGS) $(STATIC_LD_FLAGS) ifdef CONFIG_ENCRYPT suspend-keygen: md5.o keygen.c encrypt.h md5.h
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel