mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Add Metalshark's patches:
*) Add -march=pentium-m if compiling finit or finit-mod (as the target will be an eeepc). *) Add a -DNO_HCTOSYS make option that omits the first /sbin/hwclock if the user has enabled CONFIG_RTC_HCTOSYS in the kernel. *) Add a -DDIRECTISA make option to append –directisa to /sbin/hwclock lines if the user has disabled CONFIG_GENRTC and enabled CONFIG_RTC but not enabled CONFIG_HPET_TIMER and CONFIG_HPET_RTC_IRQ. Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
@@ -1,9 +1,30 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Os -Wall -DDEBUG
|
||||
CFLAGS = -Os -Wall
|
||||
LD = gcc
|
||||
LDFLAGS =
|
||||
LIBS =
|
||||
|
||||
|
||||
#### Configurable parameters
|
||||
|
||||
# Add -DDEBUG to build with debug messages, also drops to terminal after X
|
||||
#CFLAGS += -DDEBUG
|
||||
|
||||
# Parameters added by Metalshark
|
||||
|
||||
# Use -march=pentium-m to build for Eeepc
|
||||
CFLAGS += -march=pentium-m
|
||||
|
||||
# Omit the first /sbin/hwclock if CONFIG_RTC_HCTOSYS is enabled in the kernel
|
||||
CFLAGS += -DNO_HCTOSYS
|
||||
|
||||
# Append –directisa to /sbin/hwclock lines if the user has disabled
|
||||
# CONFIG_GENRTC and enabled CONFIG_RTC but not enabled CONFIG_HPET_TIMER
|
||||
# and CONFIG_HPET_RTC_IRQ.
|
||||
#CFLAGS += -DDIRECTISA
|
||||
|
||||
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) -o $*.o $<
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ finit-alt.c is a fixed/improved version of finit.c for alternative Linux
|
||||
distributions running on the Eeepc (previously ffinit.c). Currently able
|
||||
to boot unmodified Mandriva Linux.
|
||||
|
||||
See Makefile for configurable parameters to better suit your system.
|
||||
|
||||
|
||||
* Eeepc boot process
|
||||
|
||||
|
||||
+10
-2
@@ -70,6 +70,12 @@ THE SOFTWARE.
|
||||
#define TOUCH_ETC_NETWORK_RUN_IFSTATE
|
||||
#endif
|
||||
|
||||
#ifdef DIRECTISA
|
||||
#define HWCLOCK_DIRECTISA " --directisa"
|
||||
#else
|
||||
#define HWCLOCK_DIRECTISA
|
||||
#endif
|
||||
|
||||
|
||||
/* From sysvinit */
|
||||
/* Set a signal handler. */
|
||||
@@ -212,7 +218,9 @@ int main()
|
||||
write(fd, "0.0 0 0.0\n", 10);
|
||||
close(fd);
|
||||
}
|
||||
system("/sbin/hwclock --hctosys --localtime");
|
||||
#ifndef NO_HCTOSYS
|
||||
system("/sbin/hwclock --hctosys --localtime" HWCLOCK_DIRECTISA);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Network stuff
|
||||
@@ -353,7 +361,7 @@ void shutdown(int sig)
|
||||
sleep(1);
|
||||
|
||||
system("/usr/sbin/alsactl store > /dev/null 2>&1");
|
||||
system("/sbin/hwclock --systohc --localtime");
|
||||
system("/sbin/hwclock --systohc --localtime" HWCLOCK_DIRECTISA);
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
kill(-1, SIGKILL);
|
||||
|
||||
+13
-2
@@ -30,6 +30,9 @@ Changelog from the original Eeepc fastinit:
|
||||
- Fix random seed initialization
|
||||
- Don't try to handle signal 0, SIGKILL or SIGSTOP
|
||||
- Implement makepath() to avoid system("mkdir -p")
|
||||
- Omit first hwclock if user has CONFIG_RTC_HCTOSYS in kernel (by Metalshark)
|
||||
- Add –directisa to hwclock if user has disabled CONFIG_GENRTC and enabled
|
||||
CONFIG_RTC but not CONFIG_HPET_TIMER and CONFIG_HPET_RTC_IRQ (by Metalshark)
|
||||
|
||||
*/
|
||||
|
||||
@@ -49,6 +52,12 @@ Changelog from the original Eeepc fastinit:
|
||||
#include <sys/wait.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#ifdef DIRECTISA
|
||||
#define HWCLOCK_DIRECTISA " --directisa"
|
||||
#else
|
||||
#define HWCLOCK_DIRECTISA
|
||||
#endif
|
||||
|
||||
|
||||
/* From sysvinit */
|
||||
/* Set a signal handler. */
|
||||
@@ -157,7 +166,9 @@ int main()
|
||||
write(fd, "0.0 0 0.0\n", 10);
|
||||
close(fd);
|
||||
}
|
||||
system("/sbin/hwclock --hctosys --localtime");
|
||||
#ifndef NO_HCTOSYS
|
||||
system("/sbin/hwclock --hctosys --localtime" HWCLOCK_DIRECTISA);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Network stuff
|
||||
@@ -284,7 +295,7 @@ void shutdown(int sig)
|
||||
sleep(1);
|
||||
|
||||
system("/usr/sbin/alsactl store > /dev/null 2>&1");
|
||||
system("/sbin/hwclock --systohc --localtime");
|
||||
system("/sbin/hwclock --systohc --localtime" HWCLOCK_DIRECTISA);
|
||||
system("/sbin/unionctl.static / --remove / > /dev/null 2>&1");
|
||||
|
||||
kill(-1, SIGKILL);
|
||||
|
||||
Reference in New Issue
Block a user