Introducing /run
Introducing /run
Posted Mar 31, 2011 19:15 UTC (Thu) by lindi (subscriber, #53135)In reply to: Introducing /run by neilbrown
Parent article: Introducing /run
pivot_root has not been used for quite some time. The "run-init" binary from klibc just mounts your hdd over / and chroots to it:
/* Overmount the root */
if (mount(".", "/", NULL, MS_MOVE, NULL))
return "overmounting root";
/* chroot, chdir */
if (chroot(".") || chdir("/"))
return "chroot";
/* Open /dev/console */
if ((confd = open(console, O_RDWR)) < 0)
return "opening console";
dup2(confd, 0);
dup2(confd, 1);
dup2(confd, 2);
close(confd);
/* Spawn init */
execv(init, initargs);
