scripts/buildkernel: use lexists() instead of exists()

exists() will return false for broken symlinks.  We need lexists() instead.
This commit is contained in:
Albert Hopkins 2016-12-08 11:59:21 +00:00
parent 18fdbb86ea
commit 7ef2da9e83
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ def install_kernel():
# exists). I still do this however.
for filename in os.listdir('/boot'):
if filename.startswith('vmlinuz-'):
if os.path.exists('/boot/vmlinuz'):
if os.path.lexists('/boot/vmlinuz'):
os.unlink('/boot/vmlinuz')
os.symlink(filename, '/boot/vmlinuz')
break