ssfs rev 35
Create a list of system files when gen-vdisk
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun Jun 12 13:38:25 2011 +0200 (2011-06-12) |
parents | c7205f3db649 |
children | e3160ccd3ffb |
files | ssfs-server |
line diff
1.1 --- a/ssfs-server Sun Jun 12 13:31:26 2011 +0200 1.2 +++ b/ssfs-server Sun Jun 12 13:38:25 2011 +0200 1.3 @@ -211,12 +211,8 @@ 1.4 gettext -e "\nBack to the host system:" 1.5 echo -e " $(hostname)\n" ;; 1.6 gen-vdisk) 1.7 -<<<<<<< local 1.8 - # Generated a virtual disk with a minimal chroot for Ssfs users home. 1.9 + # Generate a virtual disk with a minimal chroot for Ssfs users home. 1.10 rootfs=$share/rootfs 1.11 -======= 1.12 - # Generate a virtual disk with a minimal chroot for Ssfs users home. 1.13 ->>>>>>> other 1.14 if [ -d "$root/bin" ]; then 1.15 gettext "A chroot already exists in:"; echo " $root" 1.16 exit 0 1.17 @@ -267,30 +263,12 @@ 1.18 cp -a $rootfs/* $root 1.19 status 1.20 1.21 -<<<<<<< local 1.22 gettext "Setting files permissions..." 1.23 chmod 0640 $root/etc/*shadow 1.24 - chmod 0700 $root/root && status 1.25 + chmod 0700 $root/root 1.26 chmod 4755 $root/bin/busybox 1.27 -======= 1.28 - # Busybox without deps (get && extract). No system comands are allowed 1.29 - # in /etc/busybox.conf to restrict SSH'd users. 1.30 - gettext "Installing Busybox..." 1.31 - cd $root/tmp 1.32 - tazpkg get busybox >/dev/null 1.33 - tazpkg extract busybox-* >/dev/null 1.34 - rm -rf fs && mv -f busybox-*/fs . && rm -rf busybox-* 1.35 - cp -a fs/bin fs/sbin $root 1.36 - cp -a fs/usr/bin fs/usr/sbin $root/usr 1.37 - rm -rf fs && chmod 4755 $root/bin/busybox 1.38 + chmod 0600 $root/etc/busybox.conf 1.39 status 1.40 - gettext "Creating restrictive Busybox config file..." 1.41 - echo '# Ssfs Busybox configuration.' \ 1.42 - > $root/etc/busybox.conf 1.43 - echo -e "\n[SUID]" >> $root/etc/busybox.conf 1.44 - echo -e "su = --- root.root" >> $root/etc/busybox.conf 1.45 ->>>>>>> other 1.46 - chmod 0600 $root/etc/busybox.conf 1.47 1.48 # Glib minimal libs, use host lib since package should be installed 1.49 # from same repo. 1.50 @@ -306,14 +284,16 @@ 1.51 status 1.52 1.53 # List of all system files. 1.54 - cd $root 1.55 + gettext "Creating the list of files... " 1.56 + cd $root && rm -f $state/vdisk.files 1.57 for d in bin etc lib sbin 1.58 do 1.59 - find ./$d | sed s'/^.//' 1.60 + find ./$d | sed s'/^.//' >> $state/vdisk.files 1.61 done 1.62 + cat $state/vdisk.files | wc -l 1.63 1.64 + separator 1.65 size=$(du -sh $root | awk '{print $1}') 1.66 - separator 1.67 gettext "Vdisk used space:"; echo -e " $size\n" ;; 1.68 mount-vdisk) 1.69 mount_vdisk ;;