diff -Naur a/program/functions.py b/program/functions.py --- a/program/functions.py 2010-12-05 01:18:57.000000000 +0800 +++ b/program/functions.py 2015-10-26 14:47:11.167286057 +0800 @@ -54,10 +54,10 @@ def check_package_install( pkg_name ): - a = commands.getoutput( 'dpkg -l' ) + a = commands.getoutput( 'pacman -Q' ) a = a.split( '\n' ) for each in a: - if each[0:2] == 'ii' and each.split()[1] == pkg_name: + if each.split()[0] == pkg_name: return True return False @@ -279,7 +279,7 @@ def make_system_dirs( target_root ): print _('Making system dirs ...') errors = [] - for each in ( '/proc', '/sys', '/tmp', '/mnt', '/media', '/media/cdrom0' ): + for each in ( '/run', '/dev', '/proc', '/sys', '/tmp', '/mnt', '/media', '/media/cdrom0' ): tmp = commands.getstatusoutput( 'mkdir -p %s'%(target_root + each) ) if tmp[0] != 0: errors.append( _('Error occurred when mkdir %s , you need to make it manually.')%(target_root + each) ) @@ -326,7 +326,7 @@ # devices that works even if disks are added and removed. See fstab(5). # # -proc /proc proc nodev,noexec,nosuid 0 0 +# proc /proc proc nodev,noexec,nosuid 0 0 ''' MPs = mp_config.keys() MPs.sort() @@ -438,12 +438,14 @@ defaultExcludes.append( '/proc' ) defaultExcludes.append( '/sys' ) defaultExcludes.append( '/tmp' ) + defaultExcludes.append( '/run' ) + defaultExcludes.append( '/dev' ) + defaultExcludes.append( '/.snapshots' ) defaultExcludes.append( '/mnt' ) defaultExcludes.append( '/media' ) defaultExcludes.append( '/boot/grub' ) defaultExcludes.append( '/etc/fstab' ) - defaultExcludes.append( '/etc/mtab' ) defaultExcludes.append( '/etc/blkid.tab' ) defaultExcludes.append( '/etc/udev/rules.d/70-persistent-net.rules' ) @@ -490,16 +491,16 @@ defaultExcludes.append( '/lib/modules/' + kernelVersion + '/volatile/' + each ) # /var/cache/apt/archives/*.deb - contents = commands.getoutput( 'ls /var/cache/apt/archives | grep ".deb" ' ) + contents = commands.getoutput( 'ls /var/cache/pacman/pkg ' ) if contents: for each in contents.split('\n'): - defaultExcludes.append( '/var/cache/apt/archives/' + each ) + defaultExcludes.append( '/var/cache/pacman/pkg/' + each ) # /var/cache/apt/archives/partial/* - contents = commands.getoutput( 'ls /var/cache/apt/archives/partial/' ) - if contents: - for each in contents.split('\n'): - defaultExcludes.append( '/var/cache/apt/archives/partial/' + each ) + #contents = commands.getoutput( 'ls /var/cache/apt/archives/partial/' ) + #if contents: + # for each in contents.split('\n'): + # defaultExcludes.append( '/var/cache/apt/archives/partial/' + each ) return defaultExcludes diff -Naur a/program/sh/install_grub.sh b/program/sh/install_grub.sh --- a/program/sh/install_grub.sh 2010-07-14 12:53:44.000000000 +0800 +++ b/program/sh/install_grub.sh 2015-10-26 14:46:53.829725481 +0800 @@ -79,7 +79,7 @@ echo "Generating grub.cfg ..." -target_cmd "$target_dir" update-grub +target_cmd "$target_dir" grub-mkconfig -o /boot/grub/grub.cfg if [ $? -eq 0 ] ; then diff -Naur a/program/ucloner_cmd.py b/program/ucloner_cmd.py --- a/program/ucloner_cmd.py 2010-12-05 01:25:02.000000000 +0800 +++ b/program/ucloner_cmd.py 2015-10-26 14:48:39.320636280 +0800 @@ -130,7 +130,7 @@ print 'functions.generate_fstab() done.' # 生成 mtab - tmp = commands.getstatusoutput( 'touch ' + target_dir+'/etc/mtab' ) + tmp = commands.getstatusoutput( '[ -f '+target_dir+'/etc/mtabs ] || ln -s /proc/self/mounts '+target_dir+'/etc/mtab' ) # 修复休眠功能 ret = functions.fix_resume( target_dir, swappart ) @@ -249,7 +249,7 @@ f.close() exList += text - exclusionListFile = './excludes' + exclusionListFile = '/tmp/ucloner_excludes' f = file(exclusionListFile, 'w') for each in exList: f.write( each.strip('\r \n') + '\n' ) diff -Naur a/ucloner_gui.py b/ucloner_gui.py --- a/program/ucloner_gui.py 2015-10-26 23:12:28.000000000 +0800 +++ b/program/ucloner_gui.py 2015-10-28 19:37:18.092016519 +0800 @@ -53,7 +53,9 @@ - +def kill_mksquashfs(): + os.kill(int(commands.getoutput("ps -ef|grep -P '\d\s+mksquashfs.*/tmp/ucloner_excludes'|head").split()[1]), signal.SIGKILL) + @@ -336,6 +338,7 @@ self.parent.set_sensitive(True) try: os.kill( self.id_subproc, signal.SIGKILL ) + kill_mksquashfs() except: pass @@ -343,6 +346,7 @@ def stop_task(self, widget): try: os.kill( self.id_subproc, signal.SIGKILL ) + kill_mksquashfs() except: pass @@ -674,12 +678,14 @@ self.parent.set_sensitive(True) try: os.kill( self.id_subproc, signal.SIGKILL ) + kill_mksquashfs() except: pass def stop_task(self, widget): try: os.kill( self.id_subproc, signal.SIGKILL ) + kill_mksquashfs() except: pass