Lines Matching refs:rootfs
46 rootfs=$1
53 if [ ! -e "$rootfs/dev/tty$tty" ]; then
54 mknod "$rootfs/dev/tty$tty" c 4 "$tty"
59 cat <<EOF > $rootfs/etc/inittab
78 [ -e "$rootfs/etc/mtab" ] && rm "$rootfs/etc/mtab"
79 ln -s /proc/self/mounts "$rootfs/etc/mtab"
82 mkdir -p "$rootfs/selinux"
83 echo 0 > "$rootfs/selinux/enforce"
86 cat <<EOF > $rootfs/etc/network/interfaces
95 cat <<EOF > $rootfs/etc/hostname
103 cat >> "$rootfs/etc/locale.gen" << EOF
106 chroot "$rootfs" locale-gen en_US.UTF-8 UTF-8
107 chroot "$rootfs" update-locale LANG=en_US.UTF-8
110 chroot "$rootfs" sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \
112 cat >> "$rootfs/etc/locale.gen" << EOF
115 chroot "$rootfs" locale-gen "$LANG" "$encoding"
116 chroot "$rootfs" update-locale LANG="$LANG"
120 chroot "$rootfs" /usr/sbin/update-rc.d -f checkroot.sh disable
121 chroot "$rootfs" /usr/sbin/update-rc.d -f umountfs disable
122 chroot "$rootfs" /usr/sbin/update-rc.d -f hwclock.sh disable
123 chroot "$rootfs" /usr/sbin/update-rc.d -f hwclockfirst.sh disable
126 if [ -x "$rootfs/var/lib/dpkg/info/openssh-server.postinst" ]; then
127 cat > "$rootfs/usr/sbin/policy-rc.d" << EOF
131 chmod +x "$rootfs/usr/sbin/policy-rc.d"
133 if [ -f "$rootfs/etc/init/ssh.conf" ]; then
134 mv "$rootfs/etc/init/ssh.conf" "$rootfs/etc/init/ssh.conf.disabled"
137 rm -f "$rootfs/etc/ssh/"ssh_host_*key*
139 DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot "$rootfs" /var/lib/dpkg/info/openssh-server.postinst configure
140 sed -i "s/root@$(hostname)/root@$hostname/g" "$rootfs/etc/ssh/"ssh_host_*.pub
142 if [ -f "$rootfs/etc/init/ssh.conf.disabled" ]; then
143 mv "$rootfs/etc/init/ssh.conf.disabled" "$rootfs/etc/init/ssh.conf"
146 rm -f "$rootfs/usr/sbin/policy-rc.d"
151 cat /etc/timezone > "$rootfs/etc/timezone"
152 chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata
155 echo "$ZONE" > "$rootfs/etc/timezone"
156 chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata
166 local rootfs="$1"; shift
181 cat >> "${rootfs}/etc/apt/sources.list" << EOF
186 cat >> "${rootfs}/etc/apt/sources.list" << EOF
194 local rootfs="$1"; shift
197 chroot "${rootfs}" apt-get update
199 chroot "${rootfs}" apt-get install --force-yes -y --no-install-recommends ${packages}
206 rootfs=$2
211 if [ -f "${rootfs}/lib/systemd/system/getty@.service" ]; then
214 < "${rootfs}/lib/systemd/system/getty@.service" \
215 > "${rootfs}/etc/systemd/system/getty@.service"
219 mkdir -p "${rootfs}/lib/systemd/system"
220 mkdir -p "${rootfs}/etc/systemd/system/getty.target.wants"
223 if [ -e "$rootfs//lib/systemd/system/getty-static.service" ] ; then
227 "$rootfs/lib/systemd/system/getty-static.service" | \
228 sed 's/\(tty2-tty\)[5-9]/\1'"${num_tty}"'/g' > "$rootfs/etc/systemd/system/getty-static.service"
232 rm -f "${rootfs}/etc/systemd/system/default.target"
233 chroot "${rootfs}" ln -s /dev/null /etc/systemd/system/udev.service
234 chroot "${rootfs}" ln -s /dev/null /etc/systemd/system/systemd-udevd.service
235 chroot "${rootfs}" ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
238 ( cd "${rootfs}/etc/systemd/system/getty.target.wants"
244 ( cd "${rootfs}/etc/systemd/system/getty.target.wants"
253 rm -rf "$cache/rootfs-$release-$arch"
314 echo "Failed to download the rootfs, aborting."
318 mv "$1/partial-$release-$arch" "$1/rootfs-$release-$arch"
332 rootfs=$3
336 echo -n "Copying rootfs to $rootfs..."
337 mkdir -p "$rootfs"
338 rsync -Ha "$cache/rootfs-$release-$arch"/ "$rootfs"/ || return 1
344 rootfs=$1
356 echo "Checking cache download in $cache/rootfs-$release-$arch ... "
357 if [ ! -e "$cache/rootfs-$release-$arch" ]; then
365 copy_debian "$cache" "$arch" "$rootfs" "$release"
367 echo "Failed to copy rootfs"
381 rootfs=$2
407 grep -q "^lxc.rootfs" "$path/config" 2> /dev/null || echo "lxc.rootfs = $rootfs" >> "$path/config"
425 local rootfs="$1"; shift
432 cat > "${rootfs}/usr/sbin/policy-rc.d" << EOF
436 chmod +x "${rootfs}/usr/sbin/policy-rc.d"
441 if ! chroot "$rootfs" dpkg --print-foreign-architectures 2>&1; then
442 chroot "$rootfs" dpkg --add-architecture "${hostarch}"
447 > "${rootfs}/etc/apt/sources.list"
449 write_sourceslist "${rootfs}" "${release}" "${arch}"
451 write_sourceslist "${rootfs}" "${release}"
459 install_packages "${rootfs}" "${pack_list}"
463 rm "${rootfs}/usr/sbin/policy-rc.d"
504 -p, --path=PATH directory where config and rootfs of this VM will be kept
530 options=$(getopt -o hp:n:a:r:c -l arch:,clean,help,enable-non-free,mirror:,name:,packages:,path:,release:,rootfs:,security-mirror: -- "$@")
572 --rootfs) rootfs=$2; shift 2;;
631 # detect rootfs
633 if [ -z "$rootfs" ]; then
634 if grep -q '^lxc.rootfs' "$config" 2> /dev/null ; then
635 rootfs=$(awk -F= '/^lxc.rootfs[ \t]+=/{ print $2 }' "$config")
637 rootfs=$path/rootfs
648 install_debian "$rootfs" "$release" "$arch" "$LXC_CACHE_PATH"
654 configure_debian "$rootfs" "$name" $num_tty
660 copy_configuration "$path" "$rootfs" "$name" $arch $num_tty
666 configure_debian_systemd "$path" "$rootfs" "$config" $num_tty
668 post_process "${rootfs}" "${release}" "${arch}" "${hostarch}" "${packages}"