summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-22 11:26:13 +0200
committerChristoph Hellwig <hch@lst.de>2020-07-31 08:17:52 +0200
commit4b7ca5014cbef51cdb99fd644eae4f3773747a05 (patch)
tree694867036c56c7e99e0dd8754af9526d8d00c04c /init
parentdb63f1e315384590b979f8f74abd1b5363b69894 (diff)
downloadlinux-stable-4b7ca5014cbef51cdb99fd644eae4f3773747a05.tar.gz
linux-stable-4b7ca5014cbef51cdb99fd644eae4f3773747a05.tar.bz2
linux-stable-4b7ca5014cbef51cdb99fd644eae4f3773747a05.zip
init: add an init_chroot helper
Add a simple helper to chroot with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_chroot. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts.c2
-rw-r--r--init/do_mounts_initrd.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index a7581c6e85f2..b5f9604d0c98 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -629,7 +629,7 @@ void __init prepare_namespace(void)
out:
devtmpfs_mount();
init_mount(".", "/", NULL, MS_MOVE, NULL);
- ksys_chroot(".");
+ init_chroot(".");
}
static bool is_tmpfs;
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 04627fd22a92..a6b447b191db 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -63,7 +63,7 @@ static int __init init_linuxrc(struct subprocess_info *info, struct cred *new)
/* move initrd over / and chdir/chroot in initrd root */
init_chdir("/root");
init_mount(".", "/", NULL, MS_MOVE, NULL);
- ksys_chroot(".");
+ init_chroot(".");
ksys_setsid();
return 0;
}
@@ -101,7 +101,7 @@ static void __init handle_initrd(void)
/* move initrd to rootfs' /old */
init_mount("..", ".", NULL, MS_MOVE, NULL);
/* switch root and cwd back to / of rootfs */
- ksys_chroot("..");
+ init_chroot("..");
if (new_decode_dev(real_root_dev) == Root_RAM0) {
init_chdir("/old");