From b8712a0f912fc47f028378d18a3e213804489da4 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 25 Jun 2007 16:51:17 +0000 Subject: [PATCH 01/27] 8.54.1-1 Resolves: bug #245595 --- .cvsignore | 2 +- initscripts.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index bc34768..226cfb7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -initscripts-8.54.tar.bz2 +initscripts-8.54.1.tar.bz2 diff --git a/initscripts.spec b/initscripts.spec index 8f218eb..5b94f9e 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -1,6 +1,6 @@ Summary: The inittab file and the /etc/init.d scripts Name: initscripts -Version: 8.54 +Version: 8.54.1 License: GPL Group: System Environment/Base Release: 1 @@ -203,6 +203,9 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0664,root,utmp) /var/run/utmp %changelog +* Mon Jun 25 2007 Bill Nottingham 8.54.1-1 +- netfs: check for rpcbind, not portmap (#245595) + * Tue May 15 2007 Bill Nottingham 8.54-1 - translation updates: as, bg, cs, ja, ms - redirect bogus errors from cryptsetup to /dev/null diff --git a/sources b/sources index f4858e6..9f430fd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ad2b468d14646c1630e8be8f8943f8ca initscripts-8.54.tar.bz2 +c1b2f090197c6c391f0233a6089b9dcd initscripts-8.54.1.tar.bz2 From 05788534bcb1790690896ea682823f8670f7a9cb Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Wed, 8 Aug 2007 20:22:41 +0000 Subject: [PATCH 02/27] Initialize branch OLPC-2 for initscripts --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..a62db9e --- /dev/null +++ b/branch @@ -0,0 +1 @@ +OLPC-2 From b1a6a3729ba72c6c2ac050eb34d6b91c9a08e559 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 9 Aug 2007 21:26:12 +0000 Subject: [PATCH 03/27] - branch and optimize for olpc - add olpc-dm the new display manager for olpc - don't start netfs, network or netconsole anymore --- initscripts-8.54.1-olpc.patch | 651 ++++++++++++++++++++++++++++++++++ initscripts.spec | 14 +- 2 files changed, 660 insertions(+), 5 deletions(-) create mode 100644 initscripts-8.54.1-olpc.patch diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch new file mode 100644 index 0000000..83487b5 --- /dev/null +++ b/initscripts-8.54.1-olpc.patch @@ -0,0 +1,651 @@ +--- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-08-08 18:50:45.000000000 -0400 +@@ -15,7 +15,7 @@ + # 5 - X11 + # 6 - reboot (Do NOT set initdefault to this) + # +-id:3:initdefault: ++id:5:initdefault: + + # System initialization. + si::sysinit:/etc/rc.d/rc.sysinit +@@ -44,10 +44,7 @@ pr:12345:powerokwait:/sbin/shutdown -c " + # Run gettys in standard runlevels + 1:2345:respawn:/sbin/mingetty tty1 + 2:2345:respawn:/sbin/mingetty tty2 +-3:2345:respawn:/sbin/mingetty tty3 +-4:2345:respawn:/sbin/mingetty tty4 +-5:2345:respawn:/sbin/mingetty tty5 +-6:2345:respawn:/sbin/mingetty tty6 ++3:2345:respawn:/sbin/agetty ttyS0 115200 vt100 + + # Run xdm in runlevel 5 +-x:5:respawn:/etc/X11/prefdm -nodaemon ++x:5:respawn:/sbin/olpc-dm +--- /dev/null 2007-08-06 13:44:09.062126627 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-08-09 17:22:01.000000000 -0400 +@@ -0,0 +1,595 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define OLPC_USER "olpc" ++ ++#define TTY_MODE 0620 ++#define TTYGRPNAME "tty" ++#define _PATH_HUSHLOGIN ".hushlogin" ++ ++# include ++# include ++# define PAM_MAX_LOGIN_TRIES 3 ++# define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \ ++ fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \ ++ syslog(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \ ++ pam_end(pamh, retcode); exit(1); \ ++ } ++# define PAM_END { \ ++ pam_setcred(pamh, PAM_DELETE_CRED); \ ++ retcode = pam_close_session(pamh,0); \ ++ pam_end(pamh,retcode); \ ++} ++ ++int timeout = 60; ++ ++struct passwd *pwd; ++ ++static struct passwd pwdcopy; ++char hostaddress[16]; /* used in checktty.c */ ++char *hostname; /* idem */ ++static char *username, *tty_name, *tty_number; ++static char thishost[100]; ++static pid_t pid; ++ ++static inline void xstrncpy(char *dest, const char *src, size_t n) { ++ strncpy(dest, src, n-1); ++ dest[n-1] = 0; ++} ++ ++static int childPid = 0; ++static volatile int got_sig = 0; ++ ++ ++ ++static void ++parent_sig_handler(int signal) ++{ ++ if(childPid) ++ kill(-childPid, signal); ++ else ++ got_sig = 1; ++ if(signal == SIGTERM) ++ kill(-childPid, SIGHUP); /* because the shell often ignores SIGTERM */ ++} ++ ++/* Nice and simple code provided by Linus Torvalds 16-Feb-93 */ ++/* Nonblocking stuff by Maciej W. Rozycki, macro@ds2.pg.gda.pl, 1999. ++ He writes: "Login performs open() on a tty in a blocking mode. ++ In some cases it may make login wait in open() for carrier infinitely, ++ for example if the line is a simplistic case of a three-wire serial ++ connection. I believe login should open the line in the non-blocking mode ++ leaving the decision to make a connection to getty (where it actually ++ belongs). */ ++static void ++opentty(const char * tty) ++{ ++ int i, fd, flags; ++ ++ fd = open(tty, O_RDWR | O_NONBLOCK); ++ if (fd == -1) ++ { ++ syslog(LOG_ERR, "FATAL: can't reopen tty: %s", ++ strerror(errno)); ++ sleep(1); ++ exit(1); ++ } ++ ++ flags = fcntl(fd, F_GETFL); ++ flags &= ~O_NONBLOCK; ++ fcntl(fd, F_SETFL, flags); ++ ++ for (i = 0; i < fd; i++) ++ close(i); ++ for (i = 0; i < 3; i++) ++ if (fd != i) ++ dup2(fd, i); ++ if (fd >= 3) ++ close(fd); ++} ++ ++/* true if the filedescriptor fd is a console tty, very Linux specific */ ++static int ++consoletty(int fd) ++{ ++ struct stat stb; ++ ++ if ((fstat(fd, &stb) >= 0) ++ && (major(stb.st_rdev) == TTY_MAJOR) ++ && (minor(stb.st_rdev) < 64)) ++ { ++ return 1; ++ } ++ ++ return 0; ++} ++ ++void ++olpc_login(void) ++{ ++ extern int optind; ++ extern char *optarg, **environ; ++ struct group *gr; ++ int fflag, hflag, pflag, cnt; ++ int quietlog; ++ char *domain, *ttyn; ++ char tbuf[MAXPATHLEN + 2]; ++ char *termenv; ++ int retcode; ++ pam_handle_t *pamh = NULL; ++ struct pam_conv conv = { misc_conv, NULL }; ++ struct sigaction sa, oldsa_hup, oldsa_term; ++ char vcsn[20], vcsan[20]; ++ pid = getpid(); ++ ++ signal(SIGQUIT, SIG_IGN); ++ signal(SIGINT, SIG_IGN); ++ ++ setpriority(PRIO_PROCESS, 0, 0); ++ ++ gethostname(tbuf, sizeof(tbuf)); ++ xstrncpy(thishost, tbuf, sizeof(thishost)); ++ domain = index(tbuf, '.'); ++ ++ username = tty_name = hostname = NULL; ++ fflag = hflag = pflag = 0; ++ ++ for (cnt = getdtablesize(); cnt > 2; cnt--) ++ close(cnt); ++ ++ /* TODO: This is not right, we should open the display :0 but we need ++ * to start X first. Flow should go like this once we get rid of startx ++ * seteuid 0, setuid olpc -> start X -> start pam session -> fork -> ++ * seteuid olpc -> start clients ++ */ ++ ttyn = "/dev/tty2"; ++ ++ if (strncmp(ttyn, "/dev/", 5) == 0) ++ tty_name = ttyn+5; ++ else ++ tty_name = ttyn; ++ ++ if (strncmp(ttyn, "/dev/tty", 8) == 0) ++ tty_number = ttyn+8; ++ else ++ { ++ char *p = ttyn; ++ while (*p && !isdigit(*p)) p++; ++ tty_number = p; ++ } ++ ++ printf("TTY: %s\n", tty_name); ++ ++ /* find names of Virtual Console devices, for later mode change */ ++ snprintf(vcsn, sizeof(vcsn), "/dev/vcs%s", tty_number); ++ snprintf(vcsan, sizeof(vcsan), "/dev/vcsa%s", tty_number); ++ ++ /* set pgid to pid */ ++ setpgrp(); ++ /* this means that setsid() will fail */ ++ ++ { ++ struct termios tt, ttt; ++ ++ tcgetattr(0, &tt); ++ ttt = tt; ++ ttt.c_cflag &= ~HUPCL; ++ ++ /* These can fail, e.g. with ttyn on a read-only filesystem */ ++ chown(ttyn, 0, 0); ++ chmod(ttyn, TTY_MODE); ++ ++ /* Kill processes left on this tty */ ++ tcsetattr(0,TCSAFLUSH,&ttt); ++ signal(SIGHUP, SIG_IGN); /* so vhangup() wont kill us */ ++ vhangup(); ++ signal(SIGHUP, SIG_DFL); ++ ++ /* open stdin,stdout,stderr to the tty */ ++ opentty(ttyn); ++ ++ /* restore tty modes */ ++ tcsetattr(0,TCSAFLUSH,&tt); ++ } ++ ++ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); ++ ++ retcode = pam_start("login", OLPC_USER, &conv, &pamh); ++ if(retcode != PAM_SUCCESS) ++ { ++ fprintf(stderr, "login: PAM Failure, aborting: %s\n", ++ pam_strerror(pamh, retcode)); ++ syslog(LOG_ERR, "Couldn't initialize PAM: %s", ++ pam_strerror(pamh, retcode)); ++ exit(99); ++ } ++ /* hostname & tty are either set to NULL or their correct values, ++ depending on how much we know */ ++ retcode = pam_set_item(pamh, PAM_RHOST, hostname); ++ PAM_FAIL_CHECK; ++ retcode = pam_set_item(pamh, PAM_TTY, tty_name); ++ PAM_FAIL_CHECK; ++ retcode = pam_set_item(pamh, PAM_USER_PROMPT, "You shouldn't see this login prompt"); ++ PAM_FAIL_CHECK; ++ ++ /* ++ * Authentication may be skipped (for example, during krlogin, rlogin, etc...), ++ * but it doesn't mean that we can skip other account checks. The account ++ * could be disabled or password expired (althought kerberos ticket is valid). ++ * -- kzak@redhat.com (22-Feb-2006) ++ */ ++ retcode = pam_acct_mgmt(pamh, 0); ++ ++ if(retcode == PAM_NEW_AUTHTOK_REQD) ++ retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK); ++ ++ PAM_FAIL_CHECK; ++ ++ /* ++ * Grab the user information out of the password file for future usage ++ * First get the username that we are actually using, though. ++ */ ++ retcode = pam_get_item(pamh, PAM_USER, (const void **) &username); ++ PAM_FAIL_CHECK; ++ ++ if (!username || !*username) ++ { ++ fprintf(stderr, "\nSession setup problem, abort.\n"); ++ syslog(LOG_ERR, "NULL user name in %s:%d. Abort.", ++ __FUNCTION__, __LINE__); ++ pam_end(pamh, PAM_SYSTEM_ERR); ++ exit(1); ++ } ++ ++ if (!(pwd = getpwnam(username))) ++ { ++ fprintf(stderr, "\nSession setup problem, abort.\n"); ++ syslog(LOG_ERR, "Invalid user name \"%s\" in %s:%d. Abort.", ++ username, __FUNCTION__, __LINE__); ++ pam_end(pamh, PAM_SYSTEM_ERR); ++ exit(1); ++ } ++ ++ /* ++ * Create a copy of the pwd struct - otherwise it may get ++ * clobbered by PAM ++ */ ++ memcpy(&pwdcopy, pwd, sizeof(*pwd)); ++ pwd = &pwdcopy; ++ pwd->pw_name = strdup(pwd->pw_name); ++ pwd->pw_passwd = strdup(pwd->pw_passwd); ++ pwd->pw_gecos = strdup(pwd->pw_gecos); ++ pwd->pw_dir = strdup(pwd->pw_dir); ++ pwd->pw_shell = strdup(pwd->pw_shell); ++ if (!pwd->pw_name || !pwd->pw_passwd || !pwd->pw_gecos || ++ !pwd->pw_dir || !pwd->pw_shell) ++ { ++ fprintf(stderr, "login: Out of memory\n"); ++ syslog(LOG_ERR, "Out of memory"); ++ pam_end(pamh, PAM_SYSTEM_ERR); ++ exit(1); ++ } ++ username = pwd->pw_name; ++ ++ /* ++ * Initialize the supplementary group list. ++ * This should be done before pam_setcred because ++ * the PAM modules might add groups during pam_setcred. ++ */ ++ if (initgroups(username, pwd->pw_gid) < 0) ++ { ++ syslog(LOG_ERR, "initgroups: %m"); ++ fprintf(stderr, "\nSession setup problem, abort.\n"); ++ pam_end(pamh, PAM_SYSTEM_ERR); ++ exit(1); ++ } ++ ++ retcode = pam_open_session(pamh, 0); ++ PAM_FAIL_CHECK; ++ ++ retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED); ++ if (retcode != PAM_SUCCESS) ++ pam_close_session(pamh, 0); ++ PAM_FAIL_CHECK; ++ ++ /* committed to login -- turn off timeout */ ++ alarm((unsigned int)0); ++ ++ endpwent(); ++ ++ /* This requires some explanation: As root we may not be able to ++ read the directory of the user if it is on an NFS mounted ++ filesystem. We temporarily set our effective uid to the user-uid ++ making sure that we keep root privs. in the real uid. ++ ++ A portable solution would require a fork(), but we rely on Linux ++ having the BSD setreuid() */ ++ ++ { ++ char tmpstr[MAXPATHLEN]; ++ uid_t ruid = getuid(); ++ gid_t egid = getegid(); ++ ++ /* avoid snprintf - old systems do not have it, or worse, ++ have a libc in which snprintf is the same as sprintf */ ++ if (strlen(pwd->pw_dir) + sizeof(_PATH_HUSHLOGIN) + 2 > MAXPATHLEN) ++ quietlog = 0; ++ else ++ { ++ sprintf(tmpstr, "%s/%s", pwd->pw_dir, _PATH_HUSHLOGIN); ++ setregid(-1, pwd->pw_gid); ++ setreuid(0, pwd->pw_uid); ++ quietlog = (access(tmpstr, R_OK) == 0); ++ setuid(0); /* setreuid doesn't do it alone! */ ++ setreuid(ruid, 0); ++ setregid(-1, egid); ++ } ++ } ++ ++ /* for linux, write entries in utmp and wtmp */ ++ { ++ struct utmp ut; ++ struct utmp *utp; ++ struct timeval tv; ++ ++ utmpname(_PATH_UTMP); ++ setutent(); ++ ++ /* Find pid in utmp. ++ login sometimes overwrites the runlevel entry in /var/run/utmp, ++ confusing sysvinit. I added a test for the entry type, and the problem ++ was gone. (In a runlevel entry, st_pid is not really a pid but some number ++ calculated from the previous and current runlevel). ++ Michael Riepe ++ */ ++ while ((utp = getutent())) ++ if (utp->ut_pid == pid ++ && utp->ut_type >= INIT_PROCESS ++ && utp->ut_type <= DEAD_PROCESS) ++ break; ++ ++ /* If we can't find a pre-existing entry by pid, try by line. ++ BSD network daemons may rely on this. (anonymous) */ ++ if (utp == NULL) ++ { ++ setutent(); ++ ut.ut_type = LOGIN_PROCESS; ++ strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); ++ utp = getutline(&ut); ++ } ++ ++ if (utp) ++ { ++ memcpy(&ut, utp, sizeof(ut)); ++ } ++ else ++ { ++ /* some gettys/telnetds don't initialize utmp... */ ++ memset(&ut, 0, sizeof(ut)); ++ } ++ ++ if (ut.ut_id[0] == 0) ++ strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id)); ++ ++ strncpy(ut.ut_user, username, sizeof(ut.ut_user)); ++ xstrncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); ++ gettimeofday(&tv, NULL); ++ ut.ut_tv.tv_sec = tv.tv_sec; ++ ut.ut_tv.tv_usec = tv.tv_usec; ++ ut.ut_type = USER_PROCESS; ++ ut.ut_pid = pid; ++ if (hostname) ++ { ++ xstrncpy(ut.ut_host, hostname, sizeof(ut.ut_host)); ++ if (hostaddress[0]) ++ memcpy(&ut.ut_addr_v6, hostaddress, sizeof(ut.ut_addr_v6)); ++ } ++ ++ pututline(&ut); ++ endutent(); ++ ++ updwtmp(_PATH_WTMP, &ut); ++ } ++ ++ chown(ttyn, pwd->pw_uid, ++ (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid); ++ chmod(ttyn, TTY_MODE); ++ ++ /* if tty is one of the VC's then change owner and mode of the ++ special /dev/vcs devices as well */ ++ if (consoletty(0)) ++ { ++ chown(vcsn, pwd->pw_uid, (gr ? gr->gr_gid : pwd->pw_gid)); ++ chown(vcsan, pwd->pw_uid, (gr ? gr->gr_gid : pwd->pw_gid)); ++ chmod(vcsn, TTY_MODE); ++ chmod(vcsan, TTY_MODE); ++ } ++ ++ ++ setgid(pwd->pw_gid); ++ ++ if (*pwd->pw_shell == '\0') ++ pwd->pw_shell = _PATH_BSHELL; ++ ++ { ++ char *ep; ++ ++ if(!((ep = getenv("TERM")) && (termenv = strdup(ep)))) ++ termenv = "dumb"; ++ } ++ ++ ++ environ = (char**)malloc(sizeof(char*)); ++ memset(environ, 0, sizeof(char*)); ++ ++ setenv("HOME", pwd->pw_dir, 0); /* legal to override */ ++ setenv("PATH", _PATH_DEFPATH, 1); ++ ++ setenv("SHELL", pwd->pw_shell, 1); ++ setenv("TERM", termenv, 1); ++ ++ /* mailx will give a funny error msg if you forget this one */ ++ { ++ char tmp[MAXPATHLEN]; ++ /* avoid snprintf */ ++ if (sizeof(_PATH_MAILDIR) + strlen(pwd->pw_name) + 1 < MAXPATHLEN) ++ { ++ sprintf(tmp, "%s/%s", _PATH_MAILDIR, pwd->pw_name); ++ setenv("MAIL",tmp,0); ++ } ++ } ++ ++ /* LOGNAME is not documented in login(1) but ++ HP-UX 6.5 does it. We'll not allow modifying it. ++ */ ++ setenv("LOGNAME", pwd->pw_name, 1); ++ ++ { ++ int i; ++ char ** env = pam_getenvlist(pamh); ++ ++ if (env != NULL) ++ { ++ for (i=0; env[i]; i++) ++ putenv(env[i]); ++ } ++ } ++ ++ if (!strncmp(tty_name, "ttyS", 4)) ++ syslog(LOG_INFO, "DIALUP AT %s BY %s", tty_name, pwd->pw_name); ++ ++ /* allow tracking of good logins. ++ -steve philp (sphilp@mail.alliance.net) */ ++ ++ if (hostname) ++ syslog(LOG_INFO, "LOGIN ON %s BY %s FROM %s", tty_name, ++ pwd->pw_name, hostname); ++ else ++ syslog(LOG_INFO, "LOGIN ON %s BY %s", tty_name, ++ pwd->pw_name); ++ ++ signal(SIGALRM, SIG_DFL); ++ signal(SIGQUIT, SIG_DFL); ++ signal(SIGTSTP, SIG_IGN); ++ ++ /* ++ * We must fork before setuid() because we need to call ++ * pam_close_session() as root. ++ */ ++ memset(&sa, 0, sizeof(sa)); ++ sa.sa_handler = SIG_IGN; ++ sigaction(SIGINT, &sa, NULL); ++ ++ sigaction(SIGHUP, &sa, &oldsa_hup); /* ignore while we detach from the tty */ ++ ioctl(0, TIOCNOTTY, NULL); ++ ++ sa.sa_handler = parent_sig_handler; ++ sigaction(SIGHUP, &sa, NULL); ++ sigaction(SIGTERM, &sa, &oldsa_term); ++ ++ closelog(); ++ childPid = fork(); ++ if (childPid < 0) ++ { ++ int errsv = errno; ++ /* error in fork() */ ++ fprintf(stderr, "login: failure forking: %s", strerror(errsv)); ++ PAM_END; ++ exit(0); ++ } ++ ++ if (childPid) ++ { ++ close(0); close(1); close(2); ++ sa.sa_handler = SIG_IGN; ++ sigaction(SIGQUIT, &sa, NULL); ++ sigaction(SIGINT, &sa, NULL); ++ while(wait(NULL) == -1 && errno == EINTR) /**/ ; ++ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); ++ PAM_END; ++ exit(0); ++ } ++ ++ sigaction(SIGHUP, &oldsa_hup, NULL); ++ sigaction(SIGTERM, &oldsa_term, NULL); ++ if(got_sig) exit(1); ++ ++ /* child */ ++ /* ++ * Problem: if the user's shell is a shell like ash that doesnt do ++ * setsid() or setpgrp(), then a ctrl-\, sending SIGQUIT to every ++ * process in the pgrp, will kill us. ++ */ ++ ++ /* start new session */ ++ setsid(); ++ ++ /* make sure we have a controlling tty */ ++ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */ ++ ++ /* ++ * TIOCSCTTY: steal tty from other process group. ++ */ ++ if (ioctl(0, TIOCSCTTY, (char *)1)) ++ { ++ syslog(LOG_ERR, "Couldn't set controlling terminal: %s", strerror(errno)); ++ exit(1); ++ } ++ ++ signal(SIGINT, SIG_DFL); ++ ++ /* discard permissions last so can't get killed and drop core */ ++ if(setuid(pwd->pw_uid) < 0 && pwd->pw_uid) ++ { ++ syslog(LOG_ALERT, "setuid() failed"); ++ exit(1); ++ } ++ ++ /* wait until here to change directory! */ ++ if (chdir(pwd->pw_dir) < 0) ++ { ++ printf("No directory %s!\n", pwd->pw_dir); ++ if (chdir("/")) ++ exit(0); ++ pwd->pw_dir = "/"; ++ printf("Logging in with home = \"/\".\n"); ++ } ++ ++ /* fork and exec startx. wait on child to cleanup */ ++ execl("/usr/bin/startx", "startx", "--", "-fp", "built-ins", "-wr", NULL); ++ exit(0); ++} ++ ++int ++main (int argc, ++ char **argv) ++{ ++ /* Use PAM to login as user*/ ++ olpc_login (); ++ ++ /* fork and exec startx. wait on child to cleanup */ ++ execl("/usr/bin/startx", "startx", "--", "-fp", "built-ins", "-wr", NULL); ++ ++ return 0; ++} +--- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-08-09 13:50:38.000000000 -0400 +@@ -1,7 +1,8 @@ + CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE + + PROGS=usernetctl doexec netreport testd usleep ipcalc initlog \ +- fstab-decode getkey ppp-watch consoletype genhostid rename_device ++ fstab-decode getkey ppp-watch consoletype genhostid rename_device \ ++ olpc-dm + PPPWATCH_OBJS=ppp-watch.o shvar.o + INITLOG_OBJS=initlog.o process.o + USLEEP_OBJS=usleep.o +@@ -28,6 +29,7 @@ install: + install -m 755 consoletype $(ROOT)/sbin/consoletype + install -m 755 rename_device $(ROOT)/lib/udev/rename_device + install -m 755 ccw_init $(ROOT)/lib/udev/ccw_init ++ install -m 755 olpc-dm $(ROOT)/sbin/olpc-dm + install -m 644 initlog.1 $(ROOT)$(mandir)/man1 + install -m 644 genhostid.1 $(ROOT)$(mandir)/man1 + install -m 644 doexec.1 $(ROOT)$(mandir)/man1 +@@ -77,5 +79,8 @@ ppp-watch.o: ppp-watch.c + rename_device: rename_device.c + $(CC) $(CFLAGS) `pkg-config glib-2.0 --cflags` -o $@ $< `pkg-config glib-2.0 --libs` + ++olpc-dm: olpc-dm.c ++ $(CC) $(CFLAGS) olpc-dm.c -o $@ -I/usr/include -lpam -lpam_misc ++ + kmodule: kmodule.o + $(CC) $(LDFLAGS) -o $@ $< -Wl,-Bstatic -lpopt -Wl,-Bdynamic -lkudzu -lpci diff --git a/initscripts.spec b/initscripts.spec index 5b94f9e..663fc78 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,8 +3,9 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 1 +Release: 2 Source: initscripts-%{version}.tar.bz2 +Patch0: initscripts-8.54.1-olpc.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root Requires: mingetty, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15 Requires: /sbin/sysctl, syslog @@ -35,6 +36,7 @@ deactivate most network interfaces. %prep %setup -q +%patch0 -p1 -b .olpc %build make @@ -66,10 +68,6 @@ chown root:utmp /var/log/wtmp /var/run/utmp /var/log/btmp chmod 664 /var/log/wtmp /var/run/utmp chmod 600 /var/log/btmp -/sbin/chkconfig --add netfs -/sbin/chkconfig --add network -/sbin/chkconfig --add netconsole - # Handle converting prefdm back to respawn if fgrep -q "x:5:once:/etc/X11/prefdm -nodaemon" /etc/inittab ; then sed --in-place=.rpmsave 's|^x:5:once:/etc/X11/prefdm -nodaemon|x:5:respawn:/etc/X11/prefdm -nodaemon|g' /etc/inittab @@ -201,8 +199,14 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0600,root,utmp) /var/log/btmp %ghost %attr(0664,root,utmp) /var/log/wtmp %ghost %attr(0664,root,utmp) /var/run/utmp +/sbin/olpc-dm %changelog +* Thu Aug 09 2007 John (J5) Palmieri 8.54.1-2 +- branch and optimize for olpc +- add olpc-dm the new display manager for olpc +- don't start netfs, network or netconsole anymore + * Mon Jun 25 2007 Bill Nottingham 8.54.1-1 - netfs: check for rpcbind, not portmap (#245595) From d2357a5c597d17a740924885ff455d4ebb771c9f Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Mon, 13 Aug 2007 19:43:42 +0000 Subject: [PATCH 04/27] - fix rwtab to not have resolv.conf which screws up NetworkManager --- initscripts-8.54.1-olpc.patch | 18 ++++++++++++++---- initscripts.spec | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 83487b5..a52136d 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,5 +1,15 @@ +--- initscripts-8.54.1/rwtab.olpc 2007-08-13 15:31:05.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-08-13 15:32:57.000000000 -0400 +@@ -27,7 +27,6 @@ files /etc/adjtime + files /etc/fstab + files /etc/mtab + files /etc/ntp.conf +-files /etc/resolv.conf + files /etc/lvm/.cache + files /etc/lvm/archive + files /etc/lvm/backup --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 -+++ initscripts-8.54.1/inittab 2007-08-08 18:50:45.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-08-09 18:15:11.000000000 -0400 @@ -15,7 +15,7 @@ # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) @@ -22,8 +32,8 @@ # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm ---- /dev/null 2007-08-06 13:44:09.062126627 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-08-09 17:22:01.000000000 -0400 +--- /dev/null 2007-08-09 20:48:29.426751273 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-08-09 18:15:11.000000000 -0400 @@ -0,0 +1,595 @@ +#include +#include @@ -621,7 +631,7 @@ + return 0; +} --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-08-09 13:50:38.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-08-09 18:15:11.000000000 -0400 @@ -1,7 +1,8 @@ CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE diff --git a/initscripts.spec b/initscripts.spec index 663fc78..80926a8 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 2 +Release: 3 Source: initscripts-%{version}.tar.bz2 Patch0: initscripts-8.54.1-olpc.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT /sbin/olpc-dm %changelog +* Mon Aug 13 2007 John (J5) Palmieri 8.54.1-3 +- fix rwtab to not have resolv.conf which screws up NetworkManager + * Thu Aug 09 2007 John (J5) Palmieri 8.54.1-2 - branch and optimize for olpc - add olpc-dm the new display manager for olpc From 5f7e20b45017e652e7fde98cd9395acbc372cdee Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Mon, 13 Aug 2007 19:49:37 +0000 Subject: [PATCH 05/27] - don't print out tty in olpc-dm anymore --- initscripts-8.54.1-olpc.patch | 2 +- initscripts.spec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index a52136d..85b1353 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -216,7 +216,7 @@ + tty_number = p; + } + -+ printf("TTY: %s\n", tty_name); ++ + + /* find names of Virtual Console devices, for later mode change */ + snprintf(vcsn, sizeof(vcsn), "/dev/vcs%s", tty_number); diff --git a/initscripts.spec b/initscripts.spec index 80926a8..f65f15d 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -204,6 +204,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Mon Aug 13 2007 John (J5) Palmieri 8.54.1-3 - fix rwtab to not have resolv.conf which screws up NetworkManager +- don't print out tty in olpc-dm anymore * Thu Aug 09 2007 John (J5) Palmieri 8.54.1-2 - branch and optimize for olpc From a9815330921aadd739fb229c671b1b442d33cb74 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Mon, 13 Aug 2007 21:48:54 +0000 Subject: [PATCH 06/27] - add BR on pam-devel --- initscripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initscripts.spec b/initscripts.spec index f65f15d..85c9806 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -26,7 +26,7 @@ Conflicts: alsa-utils < 1.0.14-0.5.rc2.fc7 Obsoletes: rhsound sapinit Obsoletes: hotplug Prereq: /sbin/chkconfig, /usr/sbin/groupadd, /bin/sed, coreutils -BuildRequires: glib2-devel popt gettext pkgconfig +BuildRequires: glib2-devel popt gettext pkgconfig pam-devel %description The initscripts package contains the basic system scripts used to boot From 4a305578eae4acfa424374a7e375d599f1e02d0c Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Mon, 20 Aug 2007 20:17:09 +0000 Subject: [PATCH 07/27] - update the olpc patch to include /home/olpc/.Xauthority in rwtab --- initscripts-8.54.1-olpc.patch | 13 +++++++++++-- initscripts.spec | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 85b1353..bf7b5e1 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,5 +1,6 @@ +diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab --- initscripts-8.54.1/rwtab.olpc 2007-08-13 15:31:05.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-08-13 15:32:57.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-08-20 16:15:21.000000000 -0400 @@ -27,7 +27,6 @@ files /etc/adjtime files /etc/fstab files /etc/mtab @@ -8,6 +9,12 @@ files /etc/lvm/.cache files /etc/lvm/archive files /etc/lvm/backup +@@ -38,3 +37,4 @@ files /var/lib/iscsi + files /var/lib/logrotate.status + files /var/lib/ntp + files /var/lib/xen ++files /home/olpc/.Xauthority +diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 +++ initscripts-8.54.1/inittab 2007-08-09 18:15:11.000000000 -0400 @@ -15,7 +15,7 @@ @@ -32,6 +39,7 @@ # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm +diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c --- /dev/null 2007-08-09 20:48:29.426751273 -0400 +++ initscripts-8.54.1/src/olpc-dm.c 2007-08-09 18:15:11.000000000 -0400 @@ -0,0 +1,595 @@ @@ -216,7 +224,7 @@ + tty_number = p; + } + -+ ++ printf("TTY: %s\n", tty_name); + + /* find names of Virtual Console devices, for later mode change */ + snprintf(vcsn, sizeof(vcsn), "/dev/vcs%s", tty_number); @@ -630,6 +638,7 @@ + + return 0; +} +diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 +++ initscripts-8.54.1/src/Makefile 2007-08-09 18:15:11.000000000 -0400 @@ -1,7 +1,8 @@ diff --git a/initscripts.spec b/initscripts.spec index 85c9806..5e78821 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 3 +Release: 4 Source: initscripts-%{version}.tar.bz2 Patch0: initscripts-8.54.1-olpc.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT /sbin/olpc-dm %changelog +* Mon Aug 13 2007 John (J5) Palmieri 8.54.1-4 +- update the olpc patch to include /home/olpc/.Xauthority in rwtab + * Mon Aug 13 2007 John (J5) Palmieri 8.54.1-3 - fix rwtab to not have resolv.conf which screws up NetworkManager - don't print out tty in olpc-dm anymore From b647a0577304ceea3ea12700acd87b8dda4c0b2f Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 30 Aug 2007 22:37:18 +0000 Subject: [PATCH 08/27] - remove /etc/mtab and /etc/fstab from /etc/rwtab --- initscripts-8.54.1-olpc.patch | 23 +++++++++++++---------- initscripts.spec | 5 ++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index bf7b5e1..bafeeec 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,22 +1,25 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab ---- initscripts-8.54.1/rwtab.olpc 2007-08-13 15:31:05.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-08-20 16:15:21.000000000 -0400 -@@ -27,7 +27,6 @@ files /etc/adjtime - files /etc/fstab - files /etc/mtab +--- initscripts-8.54.1/rwtab.olpc 2007-04-13 18:44:55.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-08-30 18:34:28.000000000 -0400 +@@ -24,10 +24,7 @@ empty /var/tux + empty /media + + files /etc/adjtime +-files /etc/fstab +-files /etc/mtab files /etc/ntp.conf -files /etc/resolv.conf files /etc/lvm/.cache files /etc/lvm/archive files /etc/lvm/backup -@@ -38,3 +37,4 @@ files /var/lib/iscsi +@@ -38,3 +35,4 @@ files /var/lib/iscsi files /var/lib/logrotate.status files /var/lib/ntp files /var/lib/xen +files /home/olpc/.Xauthority diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 -+++ initscripts-8.54.1/inittab 2007-08-09 18:15:11.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-08-30 18:33:15.000000000 -0400 @@ -15,7 +15,7 @@ # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) @@ -40,8 +43,8 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c ---- /dev/null 2007-08-09 20:48:29.426751273 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-08-09 18:15:11.000000000 -0400 +--- /dev/null 2007-08-29 13:13:59.090486248 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-08-30 18:33:15.000000000 -0400 @@ -0,0 +1,595 @@ +#include +#include @@ -640,7 +643,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c +} diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-08-09 18:15:11.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-08-30 18:33:15.000000000 -0400 @@ -1,7 +1,8 @@ CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE diff --git a/initscripts.spec b/initscripts.spec index 5e78821..52fac46 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 4 +Release: 5 Source: initscripts-%{version}.tar.bz2 Patch0: initscripts-8.54.1-olpc.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root @@ -202,6 +202,9 @@ rm -rf $RPM_BUILD_ROOT /sbin/olpc-dm %changelog +* Thu Aug 30 2007 John (J5) Palmieri 8.54.1-5 +- remove /etc/mtab and /etc/fstab from /etc/rwtab + * Mon Aug 13 2007 John (J5) Palmieri 8.54.1-4 - update the olpc patch to include /home/olpc/.Xauthority in rwtab From 1e432894f7077a1741acccf763010c4ef3be34b5 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Tue, 11 Sep 2007 22:35:50 +0000 Subject: [PATCH 09/27] - clean up olpc-dm - make sure olpc-dm sources /etc/sysconfig/i18n - add an olpc-login pam control file to avoid unneeded checks --- initscripts-8.54.1-olpc.patch | 189 +++++++++++++++------------------- initscripts.spec | 12 ++- olpc-login | 11 ++ 3 files changed, 103 insertions(+), 109 deletions(-) create mode 100644 olpc-login diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index bafeeec..25d59c5 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,6 +1,6 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab --- initscripts-8.54.1/rwtab.olpc 2007-04-13 18:44:55.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-08-30 18:34:28.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-09-11 18:23:52.000000000 -0400 @@ -24,10 +24,7 @@ empty /var/tux empty /media @@ -19,7 +19,7 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab +files /home/olpc/.Xauthority diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 -+++ initscripts-8.54.1/inittab 2007-08-30 18:33:15.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-09-11 18:23:52.000000000 -0400 @@ -15,7 +15,7 @@ # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) @@ -43,9 +43,9 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c ---- /dev/null 2007-08-29 13:13:59.090486248 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-08-30 18:33:15.000000000 -0400 -@@ -0,0 +1,595 @@ +--- /dev/null 2007-09-11 11:59:20.755757520 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-09-11 18:29:19.000000000 -0400 +@@ -0,0 +1,568 @@ +#include +#include +#include @@ -173,6 +173,69 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + return 0; +} + ++/* strip comments and leading white space*/ ++char * ++strip(char *src) ++{ ++ int tpos=0; ++ int len; ++ int i; ++ int first_char_found=0; ++ char *result; ++ ++ len = strlen(src); ++ result = (char *)malloc(len); ++ ++ for (i=0; i < len; i++) ++ { ++ if (!first_char_found && !isblank((int)src[i])) ++ first_char_found = 1; ++ ++ if (first_char_found) ++ { ++ if (src[i] == (int)'#') ++ break; ++ ++ result[tpos] = src[i]; ++ tpos++; ++ } ++ } ++ ++ if (tpos == 0) ++ { ++ /* blank line */ ++ free(result); ++ result = NULL; ++ } ++ else ++ result[tpos]='\0'; ++ ++ return result; ++} ++ ++void ++source_i18n(void) ++{ ++ FILE *f; ++ char *line; ++ ++ f = fopen("/etc/sysconfig/i18n", "r"); ++ while(fscanf(f, "%as", &line)==1) ++ { ++ char *sline; ++ ++ sline = strip(line); ++ if (sline == NULL) ++ continue; ++ ++ putenv(sline); ++ ++ free(line); ++ } ++ ++ fclose(f); ++} ++ +void +olpc_login(void) +{ @@ -212,74 +275,25 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + * seteuid olpc -> start clients + */ + ttyn = "/dev/tty2"; -+ -+ if (strncmp(ttyn, "/dev/", 5) == 0) -+ tty_name = ttyn+5; -+ else -+ tty_name = ttyn; -+ -+ if (strncmp(ttyn, "/dev/tty", 8) == 0) -+ tty_number = ttyn+8; -+ else -+ { -+ char *p = ttyn; -+ while (*p && !isdigit(*p)) p++; -+ tty_number = p; -+ } -+ -+ printf("TTY: %s\n", tty_name); -+ -+ /* find names of Virtual Console devices, for later mode change */ -+ snprintf(vcsn, sizeof(vcsn), "/dev/vcs%s", tty_number); -+ snprintf(vcsan, sizeof(vcsan), "/dev/vcsa%s", tty_number); ++ tty_number = "2"; + + /* set pgid to pid */ + setpgrp(); + /* this means that setsid() will fail */ + -+ { -+ struct termios tt, ttt; -+ -+ tcgetattr(0, &tt); -+ ttt = tt; -+ ttt.c_cflag &= ~HUPCL; ++ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); + -+ /* These can fail, e.g. with ttyn on a read-only filesystem */ -+ chown(ttyn, 0, 0); -+ chmod(ttyn, TTY_MODE); -+ -+ /* Kill processes left on this tty */ -+ tcsetattr(0,TCSAFLUSH,&ttt); -+ signal(SIGHUP, SIG_IGN); /* so vhangup() wont kill us */ -+ vhangup(); -+ signal(SIGHUP, SIG_DFL); -+ -+ /* open stdin,stdout,stderr to the tty */ -+ opentty(ttyn); -+ -+ /* restore tty modes */ -+ tcsetattr(0,TCSAFLUSH,&tt); -+ } -+ -+ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); -+ -+ retcode = pam_start("login", OLPC_USER, &conv, &pamh); ++ retcode = pam_start("olpc-login", OLPC_USER, &conv, &pamh); + if(retcode != PAM_SUCCESS) + { -+ fprintf(stderr, "login: PAM Failure, aborting: %s\n", ++ fprintf(stderr, "olpc-login: PAM Failure, aborting: %s\n", + pam_strerror(pamh, retcode)); + syslog(LOG_ERR, "Couldn't initialize PAM: %s", + pam_strerror(pamh, retcode)); + exit(99); + } -+ /* hostname & tty are either set to NULL or their correct values, -+ depending on how much we know */ -+ retcode = pam_set_item(pamh, PAM_RHOST, hostname); -+ PAM_FAIL_CHECK; + retcode = pam_set_item(pamh, PAM_TTY, tty_name); + PAM_FAIL_CHECK; -+ retcode = pam_set_item(pamh, PAM_USER_PROMPT, "You shouldn't see this login prompt"); -+ PAM_FAIL_CHECK; + + /* + * Authentication may be skipped (for example, during krlogin, rlogin, etc...), @@ -333,7 +347,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + if (!pwd->pw_name || !pwd->pw_passwd || !pwd->pw_gecos || + !pwd->pw_dir || !pwd->pw_shell) + { -+ fprintf(stderr, "login: Out of memory\n"); ++ fprintf(stderr, "olpc-login: Out of memory\n"); + syslog(LOG_ERR, "Out of memory"); + pam_end(pamh, PAM_SYSTEM_ERR); + exit(1); @@ -460,53 +474,18 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + updwtmp(_PATH_WTMP, &ut); + } + -+ chown(ttyn, pwd->pw_uid, -+ (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid); -+ chmod(ttyn, TTY_MODE); -+ -+ /* if tty is one of the VC's then change owner and mode of the -+ special /dev/vcs devices as well */ -+ if (consoletty(0)) -+ { -+ chown(vcsn, pwd->pw_uid, (gr ? gr->gr_gid : pwd->pw_gid)); -+ chown(vcsan, pwd->pw_uid, (gr ? gr->gr_gid : pwd->pw_gid)); -+ chmod(vcsn, TTY_MODE); -+ chmod(vcsan, TTY_MODE); -+ } -+ -+ + setgid(pwd->pw_gid); + -+ if (*pwd->pw_shell == '\0') -+ pwd->pw_shell = _PATH_BSHELL; -+ -+ { -+ char *ep; -+ -+ if(!((ep = getenv("TERM")) && (termenv = strdup(ep)))) -+ termenv = "dumb"; -+ } -+ -+ + environ = (char**)malloc(sizeof(char*)); + memset(environ, 0, sizeof(char*)); -+ ++ ++ source_i18n(); ++ + setenv("HOME", pwd->pw_dir, 0); /* legal to override */ + setenv("PATH", _PATH_DEFPATH, 1); + + setenv("SHELL", pwd->pw_shell, 1); -+ setenv("TERM", termenv, 1); -+ -+ /* mailx will give a funny error msg if you forget this one */ -+ { -+ char tmp[MAXPATHLEN]; -+ /* avoid snprintf */ -+ if (sizeof(_PATH_MAILDIR) + strlen(pwd->pw_name) + 1 < MAXPATHLEN) -+ { -+ sprintf(tmp, "%s/%s", _PATH_MAILDIR, pwd->pw_name); -+ setenv("MAIL",tmp,0); -+ } -+ } ++ /*setenv("TERM", termenv, 1);*/ + + /* LOGNAME is not documented in login(1) but + HP-UX 6.5 does it. We'll not allow modifying it. @@ -524,9 +503,6 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + } + } + -+ if (!strncmp(tty_name, "ttyS", 4)) -+ syslog(LOG_INFO, "DIALUP AT %s BY %s", tty_name, pwd->pw_name); -+ + /* allow tracking of good logins. + -steve philp (sphilp@mail.alliance.net) */ + @@ -562,7 +538,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + { + int errsv = errno; + /* error in fork() */ -+ fprintf(stderr, "login: failure forking: %s", strerror(errsv)); ++ fprintf(stderr, "olpc-login: failure forking: %s", strerror(errsv)); + PAM_END; + exit(0); + } @@ -574,7 +550,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + sigaction(SIGQUIT, &sa, NULL); + sigaction(SIGINT, &sa, NULL); + while(wait(NULL) == -1 && errno == EINTR) /**/ ; -+ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); ++ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); + PAM_END; + exit(0); + } @@ -594,7 +570,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + setsid(); + + /* make sure we have a controlling tty */ -+ openlog("login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */ ++ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */ + + /* + * TIOCSCTTY: steal tty from other process group. @@ -636,14 +612,11 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + /* Use PAM to login as user*/ + olpc_login (); + -+ /* fork and exec startx. wait on child to cleanup */ -+ execl("/usr/bin/startx", "startx", "--", "-fp", "built-ins", "-wr", NULL); -+ + return 0; +} diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-08-30 18:33:15.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-09-11 18:23:52.000000000 -0400 @@ -1,7 +1,8 @@ CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE diff --git a/initscripts.spec b/initscripts.spec index 52fac46..fedd88b 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,8 +3,9 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 5 +Release: 6%{?dist} Source: initscripts-%{version}.tar.bz2 +Source1: olpc-login Patch0: initscripts-8.54.1-olpc.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root Requires: mingetty, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15 @@ -45,6 +46,9 @@ make rm -rf $RPM_BUILD_ROOT make ROOT=$RPM_BUILD_ROOT SUPERUSER=`id -un` SUPERGROUP=`id -gn` mandir=%{_mandir} install +mkdir -p $RPM_BUILD_ROOT/etc/pam.d/ +cp -f %{SOURCE1} $RPM_BUILD_ROOT/etc/pam.d/ + %find_lang %{name} %ifnarch s390 s390x @@ -200,8 +204,14 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0664,root,utmp) /var/log/wtmp %ghost %attr(0664,root,utmp) /var/run/utmp /sbin/olpc-dm +%{_sysconfdir}/pam.d/olpc-login %changelog +* Tue Sep 11 2007 John (J5) Palmieri 8.54.1-6 +- clean up olpc-dm +- make sure olpc-dm sources /etc/sysconfig/i18n +- add an olpc-login pam control file to avoid unneeded checks + * Thu Aug 30 2007 John (J5) Palmieri 8.54.1-5 - remove /etc/mtab and /etc/fstab from /etc/rwtab diff --git a/olpc-login b/olpc-login new file mode 100644 index 0000000..bb32a67 --- /dev/null +++ b/olpc-login @@ -0,0 +1,11 @@ +#%PAM-1.0 +auth required pam_env.so +auth required pam_permit.so +account required pam_nologin.so +account include system-auth +password include system-auth +session optional pam_keyinit.so force revoke +session include system-auth +session required pam_loginuid.so +session optional pam_console.so + From 1f7f0dd5e8136f353db680acfcc446ec4c3db1c4 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 13 Sep 2007 17:38:58 +0000 Subject: [PATCH 10/27] - fix crasher bug in olpc-dm --- initscripts-8.54.1-olpc.patch | 12 ++++++------ initscripts.spec | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 25d59c5..8d5f81f 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,6 +1,6 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab --- initscripts-8.54.1/rwtab.olpc 2007-04-13 18:44:55.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-09-11 18:23:52.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-09-11 18:33:31.000000000 -0400 @@ -24,10 +24,7 @@ empty /var/tux empty /media @@ -19,7 +19,7 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab +files /home/olpc/.Xauthority diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 -+++ initscripts-8.54.1/inittab 2007-09-11 18:23:52.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-09-11 18:33:31.000000000 -0400 @@ -15,7 +15,7 @@ # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) @@ -43,8 +43,8 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c ---- /dev/null 2007-09-11 11:59:20.755757520 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-09-11 18:29:19.000000000 -0400 +--- /dev/null 2007-09-13 09:21:47.113128415 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-09-13 13:29:21.000000000 -0400 @@ -0,0 +1,568 @@ +#include +#include @@ -274,7 +274,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + * seteuid 0, setuid olpc -> start X -> start pam session -> fork -> + * seteuid olpc -> start clients + */ -+ ttyn = "/dev/tty2"; ++ tty_name = "tty2"; + tty_number = "2"; + + /* set pgid to pid */ @@ -616,7 +616,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c +} diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-09-11 18:23:52.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-09-11 18:33:31.000000000 -0400 @@ -1,7 +1,8 @@ CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE diff --git a/initscripts.spec b/initscripts.spec index fedd88b..02582f7 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 6%{?dist} +Release: 7%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-olpc.patch @@ -207,6 +207,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Thu Sep 11 2007 John (J5) Palmieri 8.54.1-7 +- fix crasher bug in olpc-dm + * Tue Sep 11 2007 John (J5) Palmieri 8.54.1-6 - clean up olpc-dm - make sure olpc-dm sources /etc/sysconfig/i18n From 441ec69380cabb6991701c5d15bec09e4e25d3a8 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Tue, 18 Sep 2007 15:33:15 +0000 Subject: [PATCH 11/27] - don't crash if /etc/sysconfig/i18n does not exist --- initscripts-8.54.1-olpc.patch | 15 +++++++++------ initscripts.spec | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 8d5f81f..df0993b 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,6 +1,6 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab --- initscripts-8.54.1/rwtab.olpc 2007-04-13 18:44:55.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-09-11 18:33:31.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-09-13 13:31:32.000000000 -0400 @@ -24,10 +24,7 @@ empty /var/tux empty /media @@ -19,7 +19,7 @@ diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab +files /home/olpc/.Xauthority diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 -+++ initscripts-8.54.1/inittab 2007-09-11 18:33:31.000000000 -0400 ++++ initscripts-8.54.1/inittab 2007-09-13 13:31:32.000000000 -0400 @@ -15,7 +15,7 @@ # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) @@ -43,9 +43,9 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -x:5:respawn:/etc/X11/prefdm -nodaemon +x:5:respawn:/sbin/olpc-dm diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c ---- /dev/null 2007-09-13 09:21:47.113128415 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-09-13 13:29:21.000000000 -0400 -@@ -0,0 +1,568 @@ +--- /dev/null 2007-09-18 09:50:57.766542723 -0400 ++++ initscripts-8.54.1/src/olpc-dm.c 2007-09-18 11:30:44.000000000 -0400 +@@ -0,0 +1,571 @@ +#include +#include +#include @@ -220,6 +220,9 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c + char *line; + + f = fopen("/etc/sysconfig/i18n", "r"); ++ if (!f) ++ return; ++ + while(fscanf(f, "%as", &line)==1) + { + char *sline; @@ -616,7 +619,7 @@ diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c +} diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile --- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-09-11 18:33:31.000000000 -0400 ++++ initscripts-8.54.1/src/Makefile 2007-09-13 13:31:32.000000000 -0400 @@ -1,7 +1,8 @@ CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE diff --git a/initscripts.spec b/initscripts.spec index 02582f7..f67a819 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 7%{?dist} +Release: 8%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-olpc.patch @@ -207,6 +207,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Tue Sep 18 2007 John (J5) Palmieri 8.54.1-8 +- don't crash if /etc/sysconfig/i18n does not exist + * Thu Sep 11 2007 John (J5) Palmieri 8.54.1-7 - fix crasher bug in olpc-dm From 6efc69b65df6878565877e6d10289923c522aed8 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Mon, 1 Oct 2007 20:42:58 +0000 Subject: [PATCH 12/27] OLPC-specific improvements: Improve Makefile so that we don't install the original versions of patched files in /etc/rc.d and /etc/sysconfig. Split "readonly rootfs / tmpfs" parts of olpc patch into new 'readonly' patch; plus add additional support for preserving changes to /etc/ssh, /etc/sysconfig/i18n, /etc/timezone, /var/lib/dbus/machine-id, and /var/lib/random-seed. Add "pretty boot" support: bring up localhost before rhgb-client is invoked; some additional calls to rhgb-client; move setsysfont from rc.sysinit to z-boot-anim-stop (after animation has finished and DCON is frozen); make sure that we cleanly exit pretty boot if interactive boot mode is invoked. --- initscripts-8.54.1-dont-install-orig.patch | 26 ++++++++++ initscripts-8.54.1-olpc.patch | 19 ------- initscripts-8.54.1-prettyboot.patch | 58 ++++++++++++++++++++++ initscripts-8.54.1-readonly.patch | 51 +++++++++++++++++++ initscripts.spec | 12 +++-- 5 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 initscripts-8.54.1-dont-install-orig.patch create mode 100644 initscripts-8.54.1-prettyboot.patch create mode 100644 initscripts-8.54.1-readonly.patch diff --git a/initscripts-8.54.1-dont-install-orig.patch b/initscripts-8.54.1-dont-install-orig.patch new file mode 100644 index 0000000..131f5e4 --- /dev/null +++ b/initscripts-8.54.1-dont-install-orig.patch @@ -0,0 +1,26 @@ +diff -up initscripts-8.54.1/Makefile.dont-install-orig initscripts-8.54.1/Makefile +--- initscripts-8.54.1/Makefile.dont-install-orig 2006-11-28 18:58:26.000000000 -0500 ++++ initscripts-8.54.1/Makefile 2007-09-27 15:01:47.000000000 -0400 +@@ -39,7 +39,12 @@ install: + mkdir -p $(ROOT)/etc/X11 + install -m755 prefdm $(ROOT)/etc/X11/prefdm + +- cp -af rc.d sysconfig ppp udev $(ROOT)/etc ++ install -m755 -d $(ROOT)/etc/rc.d $(ROOT)/etc/sysconfig ++ install -m755 rc.d/rc rc.d/rc.local rc.d/rc.sysinit $(ROOT)/etc/rc.d/ ++ cp -af rc.d/init.d $(ROOT)/etc/rc.d/ ++ install -m755 sysconfig/init sysconfig/netconsole sysconfig/readonly-root $(ROOT)/etc/sysconfig/ ++ cp -af sysconfig/network-scripts $(ROOT)/etc/sysconfig/ ++ cp -af ppp udev $(ROOT)/etc + mkdir -p $(ROOT)/etc/ppp/peers + chmod 755 $(ROOT)/etc/rc.d/* $(ROOT)/etc/rc.d/init.d/* + chmod 755 $(ROOT)/etc/ppp/peers +@@ -60,8 +65,6 @@ install: + mkdir -p $(ROOT)/etc/sysconfig/console + if uname -m | grep -q s390 ; then \ + install -m644 sysconfig/init.s390 $(ROOT)/etc/sysconfig/init ; \ +- else \ +- rm -f $(ROOT)/etc/sysconfig/init.s390 ; \ + fi + + mv $(ROOT)/etc/sysconfig/network-scripts/ifup $(ROOT)/sbin diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index df0993b..2d5c70d 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -1,22 +1,3 @@ -diff -up initscripts-8.54.1/rwtab.olpc initscripts-8.54.1/rwtab ---- initscripts-8.54.1/rwtab.olpc 2007-04-13 18:44:55.000000000 -0400 -+++ initscripts-8.54.1/rwtab 2007-09-13 13:31:32.000000000 -0400 -@@ -24,10 +24,7 @@ empty /var/tux - empty /media - - files /etc/adjtime --files /etc/fstab --files /etc/mtab - files /etc/ntp.conf --files /etc/resolv.conf - files /etc/lvm/.cache - files /etc/lvm/archive - files /etc/lvm/backup -@@ -38,3 +35,4 @@ files /var/lib/iscsi - files /var/lib/logrotate.status - files /var/lib/ntp - files /var/lib/xen -+files /home/olpc/.Xauthority diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab --- initscripts-8.54.1/inittab.olpc 2006-10-12 13:51:04.000000000 -0400 +++ initscripts-8.54.1/inittab 2007-09-13 13:31:32.000000000 -0400 diff --git a/initscripts-8.54.1-prettyboot.patch b/initscripts-8.54.1-prettyboot.patch new file mode 100644 index 0000000..961e591 --- /dev/null +++ b/initscripts-8.54.1-prettyboot.patch @@ -0,0 +1,58 @@ +diff -up initscripts-8.54.1/rc.d/rc.sysinit.prettyboot initscripts-8.54.1/rc.d/rc.sysinit +--- initscripts-8.54.1/rc.d/rc.sysinit.prettyboot 2007-05-08 08:21:47.000000000 -0400 ++++ initscripts-8.54.1/rc.d/rc.sysinit 2007-09-27 14:40:46.000000000 -0400 +@@ -11,6 +11,14 @@ unamer=`uname -r` + + set -m + ++if [ -x /usr/bin/rhgb-client ] ; then ++ # OLPC's rhgb-client depends on localhost being up ++ /sbin/ip addr add 127.0.0.1/8 dev lo ++ /sbin/ip addr add ::1/128 dev lo ++ /sbin/ip link set lo up ++ /usr/bin/rhgb-client --update=sysinit-top # early "we're alive" indication ++fi ++ + if [ -f /etc/sysconfig/network ]; then + . /etc/sysconfig/network + fi +@@ -228,9 +236,10 @@ init_crypto() { + return $ret + } + +-if [ -x /sbin/setsysfont -a -c /dev/tty1 ]; then +- /sbin/setsysfont < /dev/tty1 > /dev/tty1 2>/dev/null +-fi ++# OLPC does the setsysfont later, in z-boot-anim-stop after DCON is frozen. ++#if [ -x /sbin/setsysfont -a -c /dev/tty1 ]; then ++# /sbin/setsysfont < /dev/tty1 > /dev/tty1 2>/dev/null ++#fi + + # Print a text banner. + echo -en $"\t\tWelcome to " +@@ -327,10 +336,13 @@ if [ -x /bin/taskset ]; then + fi + fi + ++update_boot_stage udev ++( sleep 3 ; update_boot_stage udev_mid ) & + nashpid=$(pidof nash 2>/dev/null) + [ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1 + unset nashpid + /sbin/start_udev ++update_boot_stage udev_post + + # Load other user-defined modules + for file in /etc/sysconfig/modules/*.modules ; do +diff -up initscripts-8.54.1/rc.d/rc.prettyboot initscripts-8.54.1/rc.d/rc +--- initscripts-8.54.1/rc.d/rc.prettyboot 2007-09-27 14:38:55.000000000 -0400 ++++ initscripts-8.54.1/rc.d/rc 2007-09-27 14:40:10.000000000 -0400 +@@ -31,6 +31,8 @@ export runlevel previous + if [ "$previous" = "N" ]; then + if [ -f /var/run/confirm ]; then + echo $"Entering interactive startup" ++ # bail out of pretty boot ++ chvt 1 + else + echo $"Entering non-interactive startup" + fi diff --git a/initscripts-8.54.1-readonly.patch b/initscripts-8.54.1-readonly.patch new file mode 100644 index 0000000..a9659f0 --- /dev/null +++ b/initscripts-8.54.1-readonly.patch @@ -0,0 +1,51 @@ +diff -up initscripts-8.54.1/rwtab.readonly initscripts-8.54.1/rwtab +--- initscripts-8.54.1/rwtab.readonly 2007-04-13 18:44:55.000000000 -0400 ++++ initscripts-8.54.1/rwtab 2007-09-27 13:57:37.000000000 -0400 +@@ -24,10 +24,7 @@ empty /var/tux + empty /media + + files /etc/adjtime +-files /etc/fstab +-files /etc/mtab + files /etc/ntp.conf +-files /etc/resolv.conf + files /etc/lvm/.cache + files /etc/lvm/archive + files /etc/lvm/backup +@@ -38,3 +35,4 @@ files /var/lib/iscsi + files /var/lib/logrotate.status + files /var/lib/ntp + files /var/lib/xen ++files /home/olpc/.Xauthority +diff -up initscripts-8.54.1/statetab.readonly initscripts-8.54.1/statetab +--- initscripts-8.54.1/statetab.readonly 2006-10-27 13:02:22.000000000 -0400 ++++ initscripts-8.54.1/statetab 2007-09-27 14:20:11.000000000 -0400 +@@ -10,3 +10,8 @@ + # /etc/ssh + # /var/spool/mail + # ++/etc/ssh ++/etc/sysconfig/i18n ++/etc/timezone ++/var/lib/dbus ++/var/lib/random-seed +diff -up initscripts-8.54.1/sysconfig/readonly-root.readonly initscripts-8.54.1/sysconfig/readonly-root +--- initscripts-8.54.1/sysconfig/readonly-root.readonly 2007-04-13 18:48:20.000000000 -0400 ++++ initscripts-8.54.1/sysconfig/readonly-root 2007-09-27 14:17:39.000000000 -0400 +@@ -2,7 +2,7 @@ + READONLY=no + # Set to 'yes' to mount various temporary state as either tmpfs + # or on the block device labelled RW_LABEL. Implied by READONLY +-TEMPORARY_STATE=no ++TEMPORARY_STATE=yes + # Place to put a tmpfs for temporary scratch writable space + RW_MOUNT=/var/lib/stateless/writable + # Label on local filesystem which can be used for temporary scratch space +@@ -12,6 +12,6 @@ RW_OPTIONS= + # Label for partition with persistent data + STATE_LABEL=stateless-state + # Where to mount to the persistent data +-STATE_MOUNT=/var/lib/stateless/state ++STATE_MOUNT=/security/state + # Options to use for peristent mount + STATE_OPTIONS= diff --git a/initscripts.spec b/initscripts.spec index f67a819..d0a4be3 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,10 +3,13 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 8%{?dist} +Release: 9%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login -Patch0: initscripts-8.54.1-olpc.patch +Patch0: initscripts-8.54.1-dont-install-orig.patch +Patch1: initscripts-8.54.1-olpc.patch +Patch2: initscripts-8.54.1-readonly.patch +Patch3: initscripts-8.54.1-prettyboot.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root Requires: mingetty, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15 Requires: /sbin/sysctl, syslog @@ -37,7 +40,10 @@ deactivate most network interfaces. %prep %setup -q -%patch0 -p1 -b .olpc +%patch0 -p1 -b .dont-install-orig +%patch1 -p1 -b .olpc +%patch2 -p1 -b .readonly +%patch3 -p1 -b .prettyboot %build make From 49a9e7a62821a60e3107f8a8365d6af48942fc4c Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Mon, 1 Oct 2007 20:57:04 +0000 Subject: [PATCH 13/27] Add missing spec changelog entry. --- initscripts.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/initscripts.spec b/initscripts.spec index d0a4be3..bef7f74 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -213,6 +213,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Mon Oct 1 2007 - 8.54.1-9 +- Create /etc/statetab; pretty boot improvements. + * Tue Sep 18 2007 John (J5) Palmieri 8.54.1-8 - don't crash if /etc/sysconfig/i18n does not exist From 167c1e2e4a80a7be3a34c2e692f1cfec20c3c9c7 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sat, 13 Oct 2007 01:29:52 +0000 Subject: [PATCH 14/27] - Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot --- initscripts-8.54.1-readonly.patch | 5 ----- initscripts.spec | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/initscripts-8.54.1-readonly.patch b/initscripts-8.54.1-readonly.patch index a9659f0..0366ef1 100644 --- a/initscripts-8.54.1-readonly.patch +++ b/initscripts-8.54.1-readonly.patch @@ -12,11 +12,6 @@ diff -up initscripts-8.54.1/rwtab.readonly initscripts-8.54.1/rwtab files /etc/lvm/.cache files /etc/lvm/archive files /etc/lvm/backup -@@ -38,3 +35,4 @@ files /var/lib/iscsi - files /var/lib/logrotate.status - files /var/lib/ntp - files /var/lib/xen -+files /home/olpc/.Xauthority diff -up initscripts-8.54.1/statetab.readonly initscripts-8.54.1/statetab --- initscripts-8.54.1/statetab.readonly 2006-10-27 13:02:22.000000000 -0400 +++ initscripts-8.54.1/statetab 2007-09-27 14:20:11.000000000 -0400 diff --git a/initscripts.spec b/initscripts.spec index bef7f74..0a2225f 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 9%{?dist} +Release: 10%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -213,6 +213,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Fri Oct 12 2007 - 8.54.1-10 +- Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot + * Mon Oct 1 2007 - 8.54.1-9 - Create /etc/statetab; pretty boot improvements. From 92da2bd673982a80addfd21556640c56092ae206 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 15 Oct 2007 19:07:57 +0000 Subject: [PATCH 15/27] - Drop olpc-dm: it is now in olpc-dm. --- initscripts-8.54.1-olpc.patch | 610 +--------------------------------- initscripts.spec | 6 +- 2 files changed, 7 insertions(+), 609 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 2d5c70d..a30e853 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -12,7 +12,8 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab si::sysinit:/etc/rc.d/rc.sysinit @@ -44,10 +44,7 @@ pr:12345:powerokwait:/sbin/shutdown -c " # Run gettys in standard runlevels - 1:2345:respawn:/sbin/mingetty tty1 +-1:2345:respawn:/sbin/mingetty tty1 ++1:2345:respawn:/sbin/mingetty --noclear tty1 2:2345:respawn:/sbin/mingetty tty2 -3:2345:respawn:/sbin/mingetty tty3 -4:2345:respawn:/sbin/mingetty tty4 @@ -22,609 +23,4 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon -+x:5:respawn:/sbin/olpc-dm -diff -up /dev/null initscripts-8.54.1/src/olpc-dm.c ---- /dev/null 2007-09-18 09:50:57.766542723 -0400 -+++ initscripts-8.54.1/src/olpc-dm.c 2007-09-18 11:30:44.000000000 -0400 -@@ -0,0 +1,571 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define OLPC_USER "olpc" -+ -+#define TTY_MODE 0620 -+#define TTYGRPNAME "tty" -+#define _PATH_HUSHLOGIN ".hushlogin" -+ -+# include -+# include -+# define PAM_MAX_LOGIN_TRIES 3 -+# define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \ -+ fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \ -+ syslog(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \ -+ pam_end(pamh, retcode); exit(1); \ -+ } -+# define PAM_END { \ -+ pam_setcred(pamh, PAM_DELETE_CRED); \ -+ retcode = pam_close_session(pamh,0); \ -+ pam_end(pamh,retcode); \ -+} -+ -+int timeout = 60; -+ -+struct passwd *pwd; -+ -+static struct passwd pwdcopy; -+char hostaddress[16]; /* used in checktty.c */ -+char *hostname; /* idem */ -+static char *username, *tty_name, *tty_number; -+static char thishost[100]; -+static pid_t pid; -+ -+static inline void xstrncpy(char *dest, const char *src, size_t n) { -+ strncpy(dest, src, n-1); -+ dest[n-1] = 0; -+} -+ -+static int childPid = 0; -+static volatile int got_sig = 0; -+ -+ -+ -+static void -+parent_sig_handler(int signal) -+{ -+ if(childPid) -+ kill(-childPid, signal); -+ else -+ got_sig = 1; -+ if(signal == SIGTERM) -+ kill(-childPid, SIGHUP); /* because the shell often ignores SIGTERM */ -+} -+ -+/* Nice and simple code provided by Linus Torvalds 16-Feb-93 */ -+/* Nonblocking stuff by Maciej W. Rozycki, macro@ds2.pg.gda.pl, 1999. -+ He writes: "Login performs open() on a tty in a blocking mode. -+ In some cases it may make login wait in open() for carrier infinitely, -+ for example if the line is a simplistic case of a three-wire serial -+ connection. I believe login should open the line in the non-blocking mode -+ leaving the decision to make a connection to getty (where it actually -+ belongs). */ -+static void -+opentty(const char * tty) -+{ -+ int i, fd, flags; -+ -+ fd = open(tty, O_RDWR | O_NONBLOCK); -+ if (fd == -1) -+ { -+ syslog(LOG_ERR, "FATAL: can't reopen tty: %s", -+ strerror(errno)); -+ sleep(1); -+ exit(1); -+ } -+ -+ flags = fcntl(fd, F_GETFL); -+ flags &= ~O_NONBLOCK; -+ fcntl(fd, F_SETFL, flags); -+ -+ for (i = 0; i < fd; i++) -+ close(i); -+ for (i = 0; i < 3; i++) -+ if (fd != i) -+ dup2(fd, i); -+ if (fd >= 3) -+ close(fd); -+} -+ -+/* true if the filedescriptor fd is a console tty, very Linux specific */ -+static int -+consoletty(int fd) -+{ -+ struct stat stb; -+ -+ if ((fstat(fd, &stb) >= 0) -+ && (major(stb.st_rdev) == TTY_MAJOR) -+ && (minor(stb.st_rdev) < 64)) -+ { -+ return 1; -+ } -+ -+ return 0; -+} -+ -+/* strip comments and leading white space*/ -+char * -+strip(char *src) -+{ -+ int tpos=0; -+ int len; -+ int i; -+ int first_char_found=0; -+ char *result; -+ -+ len = strlen(src); -+ result = (char *)malloc(len); -+ -+ for (i=0; i < len; i++) -+ { -+ if (!first_char_found && !isblank((int)src[i])) -+ first_char_found = 1; -+ -+ if (first_char_found) -+ { -+ if (src[i] == (int)'#') -+ break; -+ -+ result[tpos] = src[i]; -+ tpos++; -+ } -+ } -+ -+ if (tpos == 0) -+ { -+ /* blank line */ -+ free(result); -+ result = NULL; -+ } -+ else -+ result[tpos]='\0'; -+ -+ return result; -+} -+ -+void -+source_i18n(void) -+{ -+ FILE *f; -+ char *line; -+ -+ f = fopen("/etc/sysconfig/i18n", "r"); -+ if (!f) -+ return; -+ -+ while(fscanf(f, "%as", &line)==1) -+ { -+ char *sline; -+ -+ sline = strip(line); -+ if (sline == NULL) -+ continue; -+ -+ putenv(sline); -+ -+ free(line); -+ } -+ -+ fclose(f); -+} -+ -+void -+olpc_login(void) -+{ -+ extern int optind; -+ extern char *optarg, **environ; -+ struct group *gr; -+ int fflag, hflag, pflag, cnt; -+ int quietlog; -+ char *domain, *ttyn; -+ char tbuf[MAXPATHLEN + 2]; -+ char *termenv; -+ int retcode; -+ pam_handle_t *pamh = NULL; -+ struct pam_conv conv = { misc_conv, NULL }; -+ struct sigaction sa, oldsa_hup, oldsa_term; -+ char vcsn[20], vcsan[20]; -+ pid = getpid(); -+ -+ signal(SIGQUIT, SIG_IGN); -+ signal(SIGINT, SIG_IGN); -+ -+ setpriority(PRIO_PROCESS, 0, 0); -+ -+ gethostname(tbuf, sizeof(tbuf)); -+ xstrncpy(thishost, tbuf, sizeof(thishost)); -+ domain = index(tbuf, '.'); -+ -+ username = tty_name = hostname = NULL; -+ fflag = hflag = pflag = 0; -+ -+ for (cnt = getdtablesize(); cnt > 2; cnt--) -+ close(cnt); -+ -+ /* TODO: This is not right, we should open the display :0 but we need -+ * to start X first. Flow should go like this once we get rid of startx -+ * seteuid 0, setuid olpc -> start X -> start pam session -> fork -> -+ * seteuid olpc -> start clients -+ */ -+ tty_name = "tty2"; -+ tty_number = "2"; -+ -+ /* set pgid to pid */ -+ setpgrp(); -+ /* this means that setsid() will fail */ -+ -+ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); -+ -+ retcode = pam_start("olpc-login", OLPC_USER, &conv, &pamh); -+ if(retcode != PAM_SUCCESS) -+ { -+ fprintf(stderr, "olpc-login: PAM Failure, aborting: %s\n", -+ pam_strerror(pamh, retcode)); -+ syslog(LOG_ERR, "Couldn't initialize PAM: %s", -+ pam_strerror(pamh, retcode)); -+ exit(99); -+ } -+ retcode = pam_set_item(pamh, PAM_TTY, tty_name); -+ PAM_FAIL_CHECK; -+ -+ /* -+ * Authentication may be skipped (for example, during krlogin, rlogin, etc...), -+ * but it doesn't mean that we can skip other account checks. The account -+ * could be disabled or password expired (althought kerberos ticket is valid). -+ * -- kzak@redhat.com (22-Feb-2006) -+ */ -+ retcode = pam_acct_mgmt(pamh, 0); -+ -+ if(retcode == PAM_NEW_AUTHTOK_REQD) -+ retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK); -+ -+ PAM_FAIL_CHECK; -+ -+ /* -+ * Grab the user information out of the password file for future usage -+ * First get the username that we are actually using, though. -+ */ -+ retcode = pam_get_item(pamh, PAM_USER, (const void **) &username); -+ PAM_FAIL_CHECK; -+ -+ if (!username || !*username) -+ { -+ fprintf(stderr, "\nSession setup problem, abort.\n"); -+ syslog(LOG_ERR, "NULL user name in %s:%d. Abort.", -+ __FUNCTION__, __LINE__); -+ pam_end(pamh, PAM_SYSTEM_ERR); -+ exit(1); -+ } -+ -+ if (!(pwd = getpwnam(username))) -+ { -+ fprintf(stderr, "\nSession setup problem, abort.\n"); -+ syslog(LOG_ERR, "Invalid user name \"%s\" in %s:%d. Abort.", -+ username, __FUNCTION__, __LINE__); -+ pam_end(pamh, PAM_SYSTEM_ERR); -+ exit(1); -+ } -+ -+ /* -+ * Create a copy of the pwd struct - otherwise it may get -+ * clobbered by PAM -+ */ -+ memcpy(&pwdcopy, pwd, sizeof(*pwd)); -+ pwd = &pwdcopy; -+ pwd->pw_name = strdup(pwd->pw_name); -+ pwd->pw_passwd = strdup(pwd->pw_passwd); -+ pwd->pw_gecos = strdup(pwd->pw_gecos); -+ pwd->pw_dir = strdup(pwd->pw_dir); -+ pwd->pw_shell = strdup(pwd->pw_shell); -+ if (!pwd->pw_name || !pwd->pw_passwd || !pwd->pw_gecos || -+ !pwd->pw_dir || !pwd->pw_shell) -+ { -+ fprintf(stderr, "olpc-login: Out of memory\n"); -+ syslog(LOG_ERR, "Out of memory"); -+ pam_end(pamh, PAM_SYSTEM_ERR); -+ exit(1); -+ } -+ username = pwd->pw_name; -+ -+ /* -+ * Initialize the supplementary group list. -+ * This should be done before pam_setcred because -+ * the PAM modules might add groups during pam_setcred. -+ */ -+ if (initgroups(username, pwd->pw_gid) < 0) -+ { -+ syslog(LOG_ERR, "initgroups: %m"); -+ fprintf(stderr, "\nSession setup problem, abort.\n"); -+ pam_end(pamh, PAM_SYSTEM_ERR); -+ exit(1); -+ } -+ -+ retcode = pam_open_session(pamh, 0); -+ PAM_FAIL_CHECK; -+ -+ retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED); -+ if (retcode != PAM_SUCCESS) -+ pam_close_session(pamh, 0); -+ PAM_FAIL_CHECK; -+ -+ /* committed to login -- turn off timeout */ -+ alarm((unsigned int)0); -+ -+ endpwent(); -+ -+ /* This requires some explanation: As root we may not be able to -+ read the directory of the user if it is on an NFS mounted -+ filesystem. We temporarily set our effective uid to the user-uid -+ making sure that we keep root privs. in the real uid. -+ -+ A portable solution would require a fork(), but we rely on Linux -+ having the BSD setreuid() */ -+ -+ { -+ char tmpstr[MAXPATHLEN]; -+ uid_t ruid = getuid(); -+ gid_t egid = getegid(); -+ -+ /* avoid snprintf - old systems do not have it, or worse, -+ have a libc in which snprintf is the same as sprintf */ -+ if (strlen(pwd->pw_dir) + sizeof(_PATH_HUSHLOGIN) + 2 > MAXPATHLEN) -+ quietlog = 0; -+ else -+ { -+ sprintf(tmpstr, "%s/%s", pwd->pw_dir, _PATH_HUSHLOGIN); -+ setregid(-1, pwd->pw_gid); -+ setreuid(0, pwd->pw_uid); -+ quietlog = (access(tmpstr, R_OK) == 0); -+ setuid(0); /* setreuid doesn't do it alone! */ -+ setreuid(ruid, 0); -+ setregid(-1, egid); -+ } -+ } -+ -+ /* for linux, write entries in utmp and wtmp */ -+ { -+ struct utmp ut; -+ struct utmp *utp; -+ struct timeval tv; -+ -+ utmpname(_PATH_UTMP); -+ setutent(); -+ -+ /* Find pid in utmp. -+ login sometimes overwrites the runlevel entry in /var/run/utmp, -+ confusing sysvinit. I added a test for the entry type, and the problem -+ was gone. (In a runlevel entry, st_pid is not really a pid but some number -+ calculated from the previous and current runlevel). -+ Michael Riepe -+ */ -+ while ((utp = getutent())) -+ if (utp->ut_pid == pid -+ && utp->ut_type >= INIT_PROCESS -+ && utp->ut_type <= DEAD_PROCESS) -+ break; -+ -+ /* If we can't find a pre-existing entry by pid, try by line. -+ BSD network daemons may rely on this. (anonymous) */ -+ if (utp == NULL) -+ { -+ setutent(); -+ ut.ut_type = LOGIN_PROCESS; -+ strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); -+ utp = getutline(&ut); -+ } -+ -+ if (utp) -+ { -+ memcpy(&ut, utp, sizeof(ut)); -+ } -+ else -+ { -+ /* some gettys/telnetds don't initialize utmp... */ -+ memset(&ut, 0, sizeof(ut)); -+ } -+ -+ if (ut.ut_id[0] == 0) -+ strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id)); -+ -+ strncpy(ut.ut_user, username, sizeof(ut.ut_user)); -+ xstrncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); -+ gettimeofday(&tv, NULL); -+ ut.ut_tv.tv_sec = tv.tv_sec; -+ ut.ut_tv.tv_usec = tv.tv_usec; -+ ut.ut_type = USER_PROCESS; -+ ut.ut_pid = pid; -+ if (hostname) -+ { -+ xstrncpy(ut.ut_host, hostname, sizeof(ut.ut_host)); -+ if (hostaddress[0]) -+ memcpy(&ut.ut_addr_v6, hostaddress, sizeof(ut.ut_addr_v6)); -+ } -+ -+ pututline(&ut); -+ endutent(); -+ -+ updwtmp(_PATH_WTMP, &ut); -+ } -+ -+ setgid(pwd->pw_gid); -+ -+ environ = (char**)malloc(sizeof(char*)); -+ memset(environ, 0, sizeof(char*)); -+ -+ source_i18n(); -+ -+ setenv("HOME", pwd->pw_dir, 0); /* legal to override */ -+ setenv("PATH", _PATH_DEFPATH, 1); -+ -+ setenv("SHELL", pwd->pw_shell, 1); -+ /*setenv("TERM", termenv, 1);*/ -+ -+ /* LOGNAME is not documented in login(1) but -+ HP-UX 6.5 does it. We'll not allow modifying it. -+ */ -+ setenv("LOGNAME", pwd->pw_name, 1); -+ -+ { -+ int i; -+ char ** env = pam_getenvlist(pamh); -+ -+ if (env != NULL) -+ { -+ for (i=0; env[i]; i++) -+ putenv(env[i]); -+ } -+ } -+ -+ /* allow tracking of good logins. -+ -steve philp (sphilp@mail.alliance.net) */ -+ -+ if (hostname) -+ syslog(LOG_INFO, "LOGIN ON %s BY %s FROM %s", tty_name, -+ pwd->pw_name, hostname); -+ else -+ syslog(LOG_INFO, "LOGIN ON %s BY %s", tty_name, -+ pwd->pw_name); -+ -+ signal(SIGALRM, SIG_DFL); -+ signal(SIGQUIT, SIG_DFL); -+ signal(SIGTSTP, SIG_IGN); -+ -+ /* -+ * We must fork before setuid() because we need to call -+ * pam_close_session() as root. -+ */ -+ memset(&sa, 0, sizeof(sa)); -+ sa.sa_handler = SIG_IGN; -+ sigaction(SIGINT, &sa, NULL); -+ -+ sigaction(SIGHUP, &sa, &oldsa_hup); /* ignore while we detach from the tty */ -+ ioctl(0, TIOCNOTTY, NULL); -+ -+ sa.sa_handler = parent_sig_handler; -+ sigaction(SIGHUP, &sa, NULL); -+ sigaction(SIGTERM, &sa, &oldsa_term); -+ -+ closelog(); -+ childPid = fork(); -+ if (childPid < 0) -+ { -+ int errsv = errno; -+ /* error in fork() */ -+ fprintf(stderr, "olpc-login: failure forking: %s", strerror(errsv)); -+ PAM_END; -+ exit(0); -+ } -+ -+ if (childPid) -+ { -+ close(0); close(1); close(2); -+ sa.sa_handler = SIG_IGN; -+ sigaction(SIGQUIT, &sa, NULL); -+ sigaction(SIGINT, &sa, NULL); -+ while(wait(NULL) == -1 && errno == EINTR) /**/ ; -+ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); -+ PAM_END; -+ exit(0); -+ } -+ -+ sigaction(SIGHUP, &oldsa_hup, NULL); -+ sigaction(SIGTERM, &oldsa_term, NULL); -+ if(got_sig) exit(1); -+ -+ /* child */ -+ /* -+ * Problem: if the user's shell is a shell like ash that doesnt do -+ * setsid() or setpgrp(), then a ctrl-\, sending SIGQUIT to every -+ * process in the pgrp, will kill us. -+ */ -+ -+ /* start new session */ -+ setsid(); -+ -+ /* make sure we have a controlling tty */ -+ openlog("olpc-login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */ -+ -+ /* -+ * TIOCSCTTY: steal tty from other process group. -+ */ -+ if (ioctl(0, TIOCSCTTY, (char *)1)) -+ { -+ syslog(LOG_ERR, "Couldn't set controlling terminal: %s", strerror(errno)); -+ exit(1); -+ } -+ -+ signal(SIGINT, SIG_DFL); -+ -+ /* discard permissions last so can't get killed and drop core */ -+ if(setuid(pwd->pw_uid) < 0 && pwd->pw_uid) -+ { -+ syslog(LOG_ALERT, "setuid() failed"); -+ exit(1); -+ } -+ -+ /* wait until here to change directory! */ -+ if (chdir(pwd->pw_dir) < 0) -+ { -+ printf("No directory %s!\n", pwd->pw_dir); -+ if (chdir("/")) -+ exit(0); -+ pwd->pw_dir = "/"; -+ printf("Logging in with home = \"/\".\n"); -+ } -+ -+ /* fork and exec startx. wait on child to cleanup */ -+ execl("/usr/bin/startx", "startx", "--", "-fp", "built-ins", "-wr", NULL); -+ exit(0); -+} -+ -+int -+main (int argc, -+ char **argv) -+{ -+ /* Use PAM to login as user*/ -+ olpc_login (); -+ -+ return 0; -+} -diff -up initscripts-8.54.1/src/Makefile.olpc initscripts-8.54.1/src/Makefile ---- initscripts-8.54.1/src/Makefile.olpc 2006-09-27 15:59:05.000000000 -0400 -+++ initscripts-8.54.1/src/Makefile 2007-09-13 13:31:32.000000000 -0400 -@@ -1,7 +1,8 @@ - CFLAGS+=$(RPM_OPT_FLAGS) -Wall -D_GNU_SOURCE - - PROGS=usernetctl doexec netreport testd usleep ipcalc initlog \ -- fstab-decode getkey ppp-watch consoletype genhostid rename_device -+ fstab-decode getkey ppp-watch consoletype genhostid rename_device \ -+ olpc-dm - PPPWATCH_OBJS=ppp-watch.o shvar.o - INITLOG_OBJS=initlog.o process.o - USLEEP_OBJS=usleep.o -@@ -28,6 +29,7 @@ install: - install -m 755 consoletype $(ROOT)/sbin/consoletype - install -m 755 rename_device $(ROOT)/lib/udev/rename_device - install -m 755 ccw_init $(ROOT)/lib/udev/ccw_init -+ install -m 755 olpc-dm $(ROOT)/sbin/olpc-dm - install -m 644 initlog.1 $(ROOT)$(mandir)/man1 - install -m 644 genhostid.1 $(ROOT)$(mandir)/man1 - install -m 644 doexec.1 $(ROOT)$(mandir)/man1 -@@ -77,5 +79,8 @@ ppp-watch.o: ppp-watch.c - rename_device: rename_device.c - $(CC) $(CFLAGS) `pkg-config glib-2.0 --cflags` -o $@ $< `pkg-config glib-2.0 --libs` - -+olpc-dm: olpc-dm.c -+ $(CC) $(CFLAGS) olpc-dm.c -o $@ -I/usr/include -lpam -lpam_misc -+ - kmodule: kmodule.o - $(CC) $(LDFLAGS) -o $@ $< -Wl,-Bstatic -lpopt -Wl,-Bdynamic -lkudzu -lpci ++x:5:once:/sbin/olpc-dm diff --git a/initscripts.spec b/initscripts.spec index 0a2225f..ca96189 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -209,11 +209,13 @@ rm -rf $RPM_BUILD_ROOT %ghost %attr(0600,root,utmp) /var/log/btmp %ghost %attr(0664,root,utmp) /var/log/wtmp %ghost %attr(0664,root,utmp) /var/run/utmp -/sbin/olpc-dm %{_sysconfdir}/pam.d/olpc-login %changelog -* Fri Oct 12 2007 - 8.54.1-10 +* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-11 +- Drop olpc-dm: it is now in olpc-dm. + +* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-10 - Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot * Mon Oct 1 2007 - 8.54.1-9 From 25e6403411987b08be10939b3528471e167a1f1c Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 15 Oct 2007 21:46:53 +0000 Subject: [PATCH 16/27] - Require olpc-utils for olpc-dm - olpc-dm now lives in /usr/sbin --- initscripts-8.54.1-olpc.patch | 2 +- initscripts.spec | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index a30e853..96263a6 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -23,4 +23,4 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon -+x:5:once:/sbin/olpc-dm ++x:5:once:/usr/sbin/olpc-dm diff --git a/initscripts.spec b/initscripts.spec index ca96189..fae0eaa 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -21,6 +21,7 @@ Requires: /sbin/ip, /sbin/arping, net-tools Requires: /etc/redhat-release, dev Requires: ethtool >= 1.8-2, /sbin/runuser Requires: udev >= 078-1 +Requires: olpc-utils >= 0.20 Conflicts: mkinitrd < 4.0, kernel < 2.6.12 Conflicts: ypbind < 1.6-12, psacct < 6.3.2-12, kbd < 1.06-19, lokkit < 0.50-14 Conflicts: dhclient < 3.0.3-7 @@ -212,8 +213,12 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-12 +- Require olpc-utils for olpc-dm +- olpc-dm now lives in /usr/sbin + * Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-11 -- Drop olpc-dm: it is now in olpc-dm. +- Drop olpc-dm: it is now in olpc-dm * Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-10 - Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot From 797d275ff017c5cd53bd3f327ece6deffaa83df2 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 15 Oct 2007 21:54:36 +0000 Subject: [PATCH 17/27] Bump revision --- initscripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initscripts.spec b/initscripts.spec index fae0eaa..ded1ad4 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 10%{?dist} +Release: 12%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch From 86b211317af085856b6a48deb02d4f938489713c Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Thu, 1 Nov 2007 11:14:43 +0000 Subject: [PATCH 18/27] - Re-enable olpc-dm respawn due to popular demand --- initscripts-8.54.1-olpc.patch | 2 +- initscripts.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 96263a6..64578a1 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -23,4 +23,4 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon -+x:5:once:/usr/sbin/olpc-dm ++x:5:respawn:/usr/sbin/olpc-dm diff --git a/initscripts.spec b/initscripts.spec index ded1ad4..59c17e2 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 12%{?dist} +Release: 13%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -213,6 +213,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Fri Nov 01 2007 Bernardo Innocenti - 8.54.1-13 +- Re-enable olpc-dm respawn due to popular demand + * Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-12 - Require olpc-utils for olpc-dm - olpc-dm now lives in /usr/sbin From 19657cadae0ad1e7896c246287632a9d730fe4c7 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 26 Dec 2007 02:55:47 +0000 Subject: [PATCH 19/27] - Update dependencies - Happy holidays! --- initscripts.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/initscripts.spec b/initscripts.spec index 59c17e2..2295ca8 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 13%{?dist} +Release: 14%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -17,11 +17,12 @@ Requires: /sbin/fuser, /bin/grep Requires: module-init-tools Requires: util-linux >= 2.10s-11, mount >= 2.11l Requires: bash >= 3.0, SysVinit >= 2.85-38 -Requires: /sbin/ip, /sbin/arping, net-tools +Requires: /sbin/ip, net-tools Requires: /etc/redhat-release, dev Requires: ethtool >= 1.8-2, /sbin/runuser Requires: udev >= 078-1 Requires: olpc-utils >= 0.20 +Requires: popt >= 1.12-2 Conflicts: mkinitrd < 4.0, kernel < 2.6.12 Conflicts: ypbind < 1.6-12, psacct < 6.3.2-12, kbd < 1.06-19, lokkit < 0.50-14 Conflicts: dhclient < 3.0.3-7 @@ -31,7 +32,7 @@ Conflicts: alsa-utils < 1.0.14-0.5.rc2.fc7 Obsoletes: rhsound sapinit Obsoletes: hotplug Prereq: /sbin/chkconfig, /usr/sbin/groupadd, /bin/sed, coreutils -BuildRequires: glib2-devel popt gettext pkgconfig pam-devel +BuildRequires: glib2-devel gettext pkgconfig %description The initscripts package contains the basic system scripts used to boot @@ -213,6 +214,10 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Tue Dec 25 2007 Bernardo Innocenti - 8.54.1-14 +- Update dependencies +- Happy holidays! + * Fri Nov 01 2007 Bernardo Innocenti - 8.54.1-13 - Re-enable olpc-dm respawn due to popular demand From 093fc07fba268e72fd8ecf1c6506b8265b3ec2df Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 2 Jan 2008 12:41:58 +0000 Subject: [PATCH 20/27] Add cpio, finutils for stateless --- initscripts.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/initscripts.spec b/initscripts.spec index 2295ca8..4d3fbb4 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -22,7 +22,9 @@ Requires: /etc/redhat-release, dev Requires: ethtool >= 1.8-2, /sbin/runuser Requires: udev >= 078-1 Requires: olpc-utils >= 0.20 -Requires: popt >= 1.12-2 +Requires: popt +# For stateless linux +Requires: cpio, findutils Conflicts: mkinitrd < 4.0, kernel < 2.6.12 Conflicts: ypbind < 1.6-12, psacct < 6.3.2-12, kbd < 1.06-19, lokkit < 0.50-14 Conflicts: dhclient < 3.0.3-7 From 6a6ff54cf654c0bcb84720dcc6f96d400aaccf1b Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 2 Jan 2008 13:00:03 +0000 Subject: [PATCH 21/27] 8.54.1-14.olpc2 --- initscripts.spec | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/initscripts.spec b/initscripts.spec index 4d3fbb4..e57d653 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 14%{?dist} +Release: 15%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -216,24 +216,27 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog -* Tue Dec 25 2007 Bernardo Innocenti - 8.54.1-14 +* Wed Jan 02 2007 Bernardo Innocenti 8.54.1-15 +- Rebuild + +* Tue Dec 25 2007 Bernardo Innocenti 8.54.1-14 - Update dependencies - Happy holidays! -* Fri Nov 01 2007 Bernardo Innocenti - 8.54.1-13 +* Fri Nov 01 2007 Bernardo Innocenti 8.54.1-13 - Re-enable olpc-dm respawn due to popular demand -* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-12 +* Fri Oct 12 2007 Bernardo Innocenti 8.54.1-12 - Require olpc-utils for olpc-dm - olpc-dm now lives in /usr/sbin -* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-11 +* Fri Oct 12 2007 Bernardo Innocenti 8.54.1-11 - Drop olpc-dm: it is now in olpc-dm -* Fri Oct 12 2007 Bernardo Innocenti - 8.54.1-10 +* Fri Oct 12 2007 Bernardo Innocenti 8.54.1-10 - Don't bind-mount /home/olpc/.Xauthority: unbreaks alternate boot -* Mon Oct 1 2007 - 8.54.1-9 +* Mon Oct 1 2007 8.54.1-9 - Create /etc/statetab; pretty boot improvements. * Tue Sep 18 2007 John (J5) Palmieri 8.54.1-8 From 7ab894a1d0003286a1665ae5e36f4762d5bb2a6c Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 2 Jan 2008 13:19:46 +0000 Subject: [PATCH 22/27] Oops :-) --- initscripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initscripts.spec b/initscripts.spec index e57d653..01f10d6 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -216,7 +216,7 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog -* Wed Jan 02 2007 Bernardo Innocenti 8.54.1-15 +* Wed Jan 02 2008 Bernardo Innocenti 8.54.1-15 - Rebuild * Tue Dec 25 2007 Bernardo Innocenti 8.54.1-14 From ef86a1a7743b52d3d7309a2a1c5bdacfdf3fcadd Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Thu, 10 Jan 2008 05:29:58 +0000 Subject: [PATCH 23/27] - dlo#5879, dlo#5705, dlo#5537, dlo#5058: Automatic root login in the console --- initscripts-8.54.1-olpc.patch | 7 ++++--- initscripts.spec | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 64578a1..91d885d 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -13,13 +13,14 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab @@ -44,10 +44,7 @@ pr:12345:powerokwait:/sbin/shutdown -c " # Run gettys in standard runlevels -1:2345:respawn:/sbin/mingetty tty1 -+1:2345:respawn:/sbin/mingetty --noclear tty1 - 2:2345:respawn:/sbin/mingetty tty2 +-2:2345:respawn:/sbin/mingetty tty2 -3:2345:respawn:/sbin/mingetty tty3 -4:2345:respawn:/sbin/mingetty tty4 -5:2345:respawn:/sbin/mingetty tty5 -6:2345:respawn:/sbin/mingetty tty6 -+3:2345:respawn:/sbin/agetty ttyS0 115200 vt100 ++1:2345:respawn:/sbin/mingetty --pauselogin --autologin root --noclear tty1 ++2:2345:respawn:/sbin/mingetty --pauselogin --autologin root --noclear tty2 ++3:2345:respawn:/sbin/agetty -w -n ttyS0 115200 vt100 # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon diff --git a/initscripts.spec b/initscripts.spec index 01f10d6..b9e9856 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -216,6 +216,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Wed Jan 10 2008 Bernardo Innocenti 8.54.1-16 +- dlo#5879, dlo#5705, dlo#5537, dlo#5058: Automatic root login in the console + * Wed Jan 02 2008 Bernardo Innocenti 8.54.1-15 - Rebuild From 348e691881c0abbb6c7c63b497c8dd567dbd9c0c Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Thu, 10 Jan 2008 05:34:28 +0000 Subject: [PATCH 24/27] Bump revision --- initscripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initscripts.spec b/initscripts.spec index b9e9856..af17692 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 15%{?dist} +Release: 16%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch From fa67d76bb5120492d9069bb090a416e3350b17dd Mon Sep 17 00:00:00 2001 From: Michael Stone Date: Fri, 11 Jan 2008 08:06:52 +0000 Subject: [PATCH 25/27] - Correct Bernie's '--pauselogin' typo - Depend on a more specific version of mingetty supporting --loginpause --- initscripts-8.54.1-olpc.patch | 4 ++-- initscripts.spec | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index 91d885d..a5fa841 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -18,8 +18,8 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -4:2345:respawn:/sbin/mingetty tty4 -5:2345:respawn:/sbin/mingetty tty5 -6:2345:respawn:/sbin/mingetty tty6 -+1:2345:respawn:/sbin/mingetty --pauselogin --autologin root --noclear tty1 -+2:2345:respawn:/sbin/mingetty --pauselogin --autologin root --noclear tty2 ++1:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty1 ++2:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty2 +3:2345:respawn:/sbin/agetty -w -n ttyS0 115200 vt100 # Run xdm in runlevel 5 diff --git a/initscripts.spec b/initscripts.spec index af17692..7344c07 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 16%{?dist} +Release: 17%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -11,7 +11,7 @@ Patch1: initscripts-8.54.1-olpc.patch Patch2: initscripts-8.54.1-readonly.patch Patch3: initscripts-8.54.1-prettyboot.patch BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root -Requires: mingetty, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15 +Requires: mingetty >= 1.0.7-9, /bin/awk, /bin/sed, mktemp, e2fsprogs >= 1.15 Requires: /sbin/sysctl, syslog Requires: /sbin/fuser, /bin/grep Requires: module-init-tools @@ -216,6 +216,10 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Thu Jan 10 2008 Michael Stone 8.54.1-17 +- Correct Bernie's '--pauselogin' typo +- Depend on a more specific version of mingetty supporting --loginpause + * Wed Jan 10 2008 Bernardo Innocenti 8.54.1-16 - dlo#5879, dlo#5705, dlo#5537, dlo#5058: Automatic root login in the console From 8f22aa3b24c9d2836f0f5dd894c2f0eec7277c0e Mon Sep 17 00:00:00 2001 From: Michael Stone Date: Tue, 1 Apr 2008 16:44:35 +0000 Subject: [PATCH 26/27] - Tell our agetty to login with /bin/bash now that we're locking the root account --- initscripts-8.54.1-olpc.patch | 2 +- initscripts.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/initscripts-8.54.1-olpc.patch b/initscripts-8.54.1-olpc.patch index a5fa841..eef5b11 100644 --- a/initscripts-8.54.1-olpc.patch +++ b/initscripts-8.54.1-olpc.patch @@ -20,7 +20,7 @@ diff -up initscripts-8.54.1/inittab.olpc initscripts-8.54.1/inittab -6:2345:respawn:/sbin/mingetty tty6 +1:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty1 +2:2345:respawn:/sbin/mingetty --loginpause --autologin root --noclear tty2 -+3:2345:respawn:/sbin/agetty -w -n ttyS0 115200 vt100 ++3:2345:respawn:/sbin/agetty -l /bin/bash -w -n ttyS0 115200 vt100 # Run xdm in runlevel 5 -x:5:respawn:/etc/X11/prefdm -nodaemon diff --git a/initscripts.spec b/initscripts.spec index 7344c07..1e33dab 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -3,7 +3,7 @@ Name: initscripts Version: 8.54.1 License: GPL Group: System Environment/Base -Release: 17%{?dist} +Release: 18%{?dist} Source: initscripts-%{version}.tar.bz2 Source1: olpc-login Patch0: initscripts-8.54.1-dont-install-orig.patch @@ -216,6 +216,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/pam.d/olpc-login %changelog +* Thu Apr 01 2008 Michael Stone 8.54.1-18 +- Tell our agetty to login with /bin/bash now that we're locking the root account + * Thu Jan 10 2008 Michael Stone 8.54.1-17 - Correct Bernie's '--pauselogin' typo - Depend on a more specific version of mingetty supporting --loginpause From 72283503dedab65f14062c924987f24beb230373 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 18:16:58 +0000 Subject: [PATCH 27/27] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 6 ------ branch | 1 - 3 files changed, 7 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index f6975f6..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Makefile for source rpm: initscripts -# $Id$ -NAME := initscripts -SPECFILE = $(firstword $(wildcard *.spec)) - -include ../common/Makefile.common diff --git a/branch b/branch deleted file mode 100644 index a62db9e..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -OLPC-2