scripts/buildkernel: use lexists() instead of exists()
exists() will return false for broken symlinks. We need lexists() instead.
This commit is contained in:
parent
18fdbb86ea
commit
7ef2da9e83
|
@ -90,7 +90,7 @@ def install_kernel():
|
||||||
# exists). I still do this however.
|
# exists). I still do this however.
|
||||||
for filename in os.listdir('/boot'):
|
for filename in os.listdir('/boot'):
|
||||||
if filename.startswith('vmlinuz-'):
|
if filename.startswith('vmlinuz-'):
|
||||||
if os.path.exists('/boot/vmlinuz'):
|
if os.path.lexists('/boot/vmlinuz'):
|
||||||
os.unlink('/boot/vmlinuz')
|
os.unlink('/boot/vmlinuz')
|
||||||
os.symlink(filename, '/boot/vmlinuz')
|
os.symlink(filename, '/boot/vmlinuz')
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue