5 ms·
Shit, I did that years ago: --- main.c Sun Jun 3 22:02:34 2001 +++ main.c~ Tue Jul 10 16:05:26 2001 @@ -789,9 +789,9 @@ if (execute_command) exe
by influx 12y ago
Shit, I did that years ago:
--- main.c Sun Jun 3 22:02:34 2001
+++ main.c~ Tue Jul 10 16:05:26 2001
@@ -789,9 +789,9 @@
if (execute_command)
execve(execute_command,argv_init,envp_init);
- execve("/sbin/init",argv_init,envp_init);
- execve("/etc/init",argv_init,envp_init);
- execve("/bin/init",argv_init,envp_init);
- execve("/bin/sh",argv_init,envp_init);
- panic("No init found. Try passing init= option to kernel.");
+ execve("/usr/bin/emacs",argv_init,envp_init);
+ execve("/usr/local/bin/emacs",argv_init,envp_init) ;
+ execve("/bin/emacs",argv_init,envp_init);
+ execve("/usr/bin/xemacs",argv_init,envp_init);
+ panic("No emacs found. Are you sure this is GNU/Linux?");
}
- mike_ivanov 12y agoln -sf /usr/bin/emacs /sbin/init
- scott_karana 12y agoWhere would you find ln, though? ;)
- digisign 12y agoThat's pre reboot.
- pyre 12y agoWhere would you find gcc to patch the kernel? :P
- daveloyall 12y agomake-symbolic-link is an interactive built-in function in `C source code'. (make-symbolic-link FILENAME LINKNAME &optional OK-IF-ALREADY-EXISTS) Make a symbolic link to FILENAME, named LINKNAME. Both args must be strings. Signals a `file-already-exists' error if a file LINKNAME already exists unless optional third argument OK-IF-ALREADY-EXISTS is non-nil. A number as third arg means request confirmation if LINKNAME already exists. This happens for interactive use with M-x. or... dired-do-symlink is an interactive autoloaded compiled Lisp function in `dired-aux.el'. (dired-do-symlink &optional ARG) Make symbolic links to current file or all marked (or next ARG) files. When operating on just the current file, you specify the new name. When operating on multiple or marked files, you specify a directory and new symbolic links are made in that directory with the same names that the files currently have. The default suggested for the target directory depends on the value of `dired-dwim-target', which see. For relative symlinks, use M-x dired-do-relsymlink. ...It doesn't seem to depend on an external `ln`. http://git.savannah.gnu.org/cgit/emacs.git/tree/src/fileio.c#n2444 http://git.savannah.gnu.org/cgit/emacs.git/tree/src/fileio.c...
- scott_karana 12y agoNice find! :-)
- josefonseca 12y agoI did that years ago as well. Soon as I read somewhere that Stallman meant Emacs to be his only shell and do everything in it(?), this was my first thought.
- teddyh 12y agoNo need to patch the kernel - I did this many years ago (before the age of initramfs) by simply passing “init=/usr/bin/emacs” on the kernel command line (in lilo, which was what was used at the time).
- pyre 12y agolilo: the Linux Loader! /getoffmylawn
- kjs3 12y agoIsn't this something almost everyone who got past the "wrote my first elisp macro" stage has done with emacs since the 90s?