Opened 26 hours ago
#5655 new enhancement
Remove $LFS/{bin,lib,sbin} from the chown commands
Reported by: | Xi Ruoyao | Owned by: | lfs-book |
---|---|---|---|
Priority: | normal | Milestone: | 12.4 |
Component: | Book | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description
They are symlinks and running chown on a symlink actually operates on the target of the link, and the targets of these links are already covered by $LFS/usr/*. So running chown on them are redundant, and it's potentially harmful if the user wrongly types
for i in bin lib sbin; do ln -sv /usr/$i $LFS/$i done
(note that the additional "/" before usr) in Creating a Limited Directory Layout in the LFS Filesystem: in this case /usr/lib of the host will be owned by the LFS user, and when we install Glibc in chapter 5 it'll just overwrite the Glibc of the host distro, blowing it up.
While we may argue "user error is user error" it's still better to prevent a single-point failure from blowing up the entire host distro. And I cannot see any bad effect to remove them.
Maybe we can even do it before 12.3 release but I'm not sure, so leaving the milestone 12.4 for now.