Commits

Uelsk8s committed 39535d2

chdir before symline live rc files

Comments (0)

Files changed (1)

vinstall/controller/automatic.py

             kernel_version)
         shutil.copyfile(source, target)
 	for rc in ("rc.S", "rc.M", "rc.K", "rc.local"):
-	    source = os.path.join('/mnt', 'TARGET', 'etc', 'rc.d', '%s.real' %
-	        rc)
-	    target = os.path.join('/mnt', 'TARGET', 'etc', 'rc.d', rc)
-	    os.remove(target)
-	    os.symlink(source, target)
+	    rcdir = os.path.join('/mnt', 'TARGET', 'etc', 'rc.d')
+	    source = os.path.join('%s.real' % rc)
+	    os.chdir(rcdir)
+	    os.remove(rc)
+	    os.symlink(source, rc)
 
     def fstab(self, disk):
         """Create and install a fstab file in disk