User Tools

Site Tools


linux:slitaz:chroot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux:slitaz:chroot [2010/04/16 22:51] – created 74.125.75.19linux:slitaz:chroot [2016/05/05 13:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +制作LiveCD的时候,最简单的方法就是直接chroot到slitaz的系统环境中去,官方已经提供了一个脚本,只要稍微更改一下路径就可以了:
 +  ROOTFS="/home/pjq/slitaz/rootcd/rootfs"
  
 +<file bash  chroot_in_env.sh>
 +#!/bin/sh
 +# Chroot in SliTaz to hack.
 +#
 +ROOTFS="/home/pjq/slitaz/rootcd/rootfs"
 +
 +# Mount virtual Kernel file systems and chroot.
 +#
 +#mount --bind /dev $ROOTFS/dev
 +#mount --bind /tmp $ROOTFS/tmp
 +mount -t proc proc $ROOTFS/proc
 +mount -t sysfs sysfs $ROOTFS/sys
 +mount -t devpts devpts $ROOTFS/dev/pts
 +mount -t tmpfs shm $ROOTFS/dev/shm
 +
 +echo "Chrooting into $ROOTFS... "
 +#chroot $ROOTFS /bin/sh --login
 +chroot $ROOTFS /bin/sh 
 +
 +# Unmount virtual Kernel file systems on exit.
 +#
 +umount $ROOTFS/dev/shm
 +umount $ROOTFS/dev/pts
 +umount $ROOTFS/sys
 +umount $ROOTFS/proc
 +#umount $ROOTFS/tmp
 +#umount $ROOTFS/dev
 +
 +echo "Exiting $ROOTFS chroot environment... "
 +</file>