Lines Matching refs:rootfs
88 rootfs=$1
95 cat <<EOF > $rootfs/etc/network/interfaces
108 cat <<EOF > $rootfs/etc/hostname
112 cat <<EOF > $rootfs/etc/hosts
124 if [ ! -f $rootfs/etc/init/container-detect.conf ]; then
126 sed -i "s/=\"err\"/=0/" $rootfs/etc/udev/udev.conf
130 rm -f $rootfs/etc/init/tty{5,6}.conf
134 chroot $rootfs useradd --create-home -s /bin/bash $user
135 echo "$user:$password" | chroot $rootfs chpasswd
140 chroot $rootfs locale-gen en_US.UTF-8 || true
141 chroot $rootfs update-locale LANG=en_US.UTF-8 || true
143 chroot $rootfs locale-gen $LANG || true
144 chroot $rootfs update-locale LANG=$LANG || true
148 if [ -x $rootfs/var/lib/dpkg/info/openssh-server.postinst ]; then
149 cat > $rootfs/usr/sbin/policy-rc.d << EOF
153 chmod +x $rootfs/usr/sbin/policy-rc.d
155 rm -f $rootfs/etc/ssh/ssh_host_*key*
156 mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled
157 DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs /var/lib/dpkg/info/openssh-server.postinst configure
158 mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
160 sed -i "s/root@$(hostname)/root@$hostname/g" $rootfs/etc/ssh/ssh_host_*.pub
162 rm -f $rootfs/usr/sbin/policy-rc.d
175 sudo_version=$(chroot $rootfs dpkg-query -W -f='${Version}' sudo)
177 if chroot $rootfs dpkg --compare-versions $sudo_version gt "1.8.3p1-1"; then
184 chroot $rootfs groupadd --system $group >/dev/null 2>&1 || true
185 chroot $rootfs adduser ${user} $group >/dev/null 2>&1 || true
190 root_u_path="$rootfs/$u_path"
193 chroot $rootfs chown -R ${user}: "$u_path"
234 local rootfs=$1
264 # $1 => path to the partial cache or the rootfs
302 local rootfs="$1"
307 chroot $rootfs apt-get update
312 chroot $rootfs apt-get install --force-yes -y --no-install-recommends ${packages}
319 try_rmsubvolume $cache/rootfs-$arch
385 echo "Failed to download the rootfs, aborting."
417 mv "$1/partial-$arch" "$1/rootfs-$arch"
430 rootfs=$3
433 echo "Copying rootfs to $rootfs ..."
434 try_mksubvolume $rootfs
435 if which btrfs >/dev/null 2>&1 && is_btrfs_subvolume $cache/rootfs-$arch && is_btrfs_subvolume $rootfs; then
436 realrootfs=$(dirname $config)/rootfs
437 [ "$rootfs" = "$realrootfs" ] || umount $rootfs || return 1
439 btrfs subvolume snapshot $cache/rootfs-$arch $realrootfs || return 1
440 [ "$rootfs" = "$realrootfs" ] || mount --bind $realrootfs $rootfs || return 1
442 rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1
449 rootfs=$1
466 try_rmsubvolume $cache/rootfs-$arch
469 echo "Checking cache download in $cache/rootfs-$arch ... "
470 if [ ! -e "$cache/rootfs-$arch" ]; then
478 echo "Copy $cache/rootfs-$arch to $rootfs ... "
479 copy_ubuntu $cache $arch $rootfs
481 echo "Failed to copy rootfs"
495 rootfs=$2
532 grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
554 rootfs=$1
559 cat > $rootfs/usr/sbin/policy-rc.d << EOF
563 chmod +x $rootfs/usr/sbin/policy-rc.d
566 if [ -x "$(ls -1 ${rootfs}/usr/bin/qemu-*-static 2>/dev/null)" ]; then
567 dpkg_version=$(chroot $rootfs dpkg-query -W -f='${Version}' dpkg)
568 if chroot $rootfs dpkg --compare-versions $dpkg_version ge "1.16.2"; then
569 chroot $rootfs dpkg --add-architecture ${hostarch}
571 mkdir -p ${rootfs}/etc/dpkg/dpkg.cfg.d
572 echo "foreign-architecture ${hostarch}" > ${rootfs}/etc/dpkg/dpkg.cfg.d/lxc-multiarch
580 > ${rootfs}/etc/apt/sources.list
581 write_sourceslist $rootfs $arch "native"
585 write_sourceslist $rootfs $hostarch "multiarch"
589 chroot $rootfs apt-get update
590 if chroot $rootfs dpkg -l iproute2 | grep -q ^ii; then
595 install_packages $rootfs $HOST_PACKAGES
603 install_packages $rootfs $packages
608 cat /etc/timezone > $rootfs/etc/timezone
609 chroot $rootfs dpkg-reconfigure -f noninteractive tzdata
612 echo $ZONE > $rootfs/etc/timezone
613 chroot $rootfs dpkg-reconfigure -f noninteractive tzdata
619 # I'm afraid of doing rm -rf $rootfs/dev/shm, in case it did
623 if [ ! -L $rootfs/dev/shm ] && [ -e $rootfs/dev/shm ]; then
624 rmdir $rootfs/dev/shm 2>/dev/null || mv $rootfs/dev/shm $rootfs/dev/shm.bak
625 ln -s /run/shm $rootfs/dev/shm
629 rm $rootfs/usr/sbin/policy-rc.d
634 rootfs=$1
639 echo $pwd >> $rootfs/etc/passwd
643 if [ ! -x $rootfs/$shell ]; then
647 install_packages $rootfs $pkg
651 echo "$shad" >> $rootfs/etc/shadow
655 mkdir -p $rootfs/$h
667 chroot $rootfs getent group "$grpe" || echo "$grpe" >> $rootfs/etc/group
675 [--rootfs <rootfs>] [--packages <packages>] [-u|--user <user>] [--password <password>]
690 options=$(getopt -o a:b:hp:r:v:n:FS:du: -l arch:,bindhome:,help,path:,release:,variant:,name:,flush-cache,auth-key:,debug,rootfs:,packages:,user:,password:,mirror:,security-mirror: -- "$@")
738 --rootfs) rootfs=$2; shift 2;;
808 # detect rootfs
810 # if $rootfs exists here, it was passed in with --rootfs
811 if [ -z "$rootfs" ]; then
812 if grep -q '^lxc.rootfs' $config 2>/dev/null ; then
813 rootfs=$(awk -F= '/^lxc.rootfs =/{ print $2 }' $config)
815 rootfs=$path/rootfs
819 install_ubuntu $rootfs $release $flushcache $LXC_CACHE_PATH
825 configure_ubuntu $rootfs $name $release $user $password
831 copy_configuration $path $rootfs $name $arch $release
837 post_process $rootfs $release $trim_container $packages
840 do_bindhome $rootfs $bindhome