From cacb470c97dd29c34e70826c12326694cda6d900 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sat, 11 Jan 2025 23:17:54 +0800 Subject: [PATCH] aboutlfs: Set umask to 022 I know some distros are using a different default and we are having reports of some mysterious permission issue via lfs-support those I highly suspect as some umask issue. Let's just explicitly set it (like setting $LFS) to protect us from such distros without changing every "mkdir -pv" to "install -vdm755". --- chapter02/aboutlfs.xml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/chapter02/aboutlfs.xml b/chapter02/aboutlfs.xml index 4f3f6ba46..64229f114 100644 --- a/chapter02/aboutlfs.xml +++ b/chapter02/aboutlfs.xml @@ -8,7 +8,7 @@ - Setting The $LFS Variable + Setting the $LFS Variable and the Umask Throughout this book, the environment variable LFS will be used several times. You should ensure that this variable is always defined @@ -28,8 +28,14 @@ /mnt/lfs (or whatever value the variable was set to) when it processes the command line. + Now setting the file mode creation mask (umask) to + 022 in case the host distro uses a different + default: + +umask 022 - Do not forget to check that LFS is set whenever + Do not forget to check that LFS is set and the + umask is set to 022 whenever you leave and reenter the current working environment (such as when doing a su to root or another user). Check that the LFS variable is set up @@ -39,10 +45,17 @@ Make sure the output shows the path to your LFS system's build location, which is /mnt/lfs if the - provided example was followed. If the output is incorrect, use the command - given earlier on this page to set $LFS to the correct - directory name. - + provided example was followed. + + Check that the umask is set up properly with: + + umask + + The output should be 022. + + If any output of these two commands is incorrect, use the command + given earlier on this page to set $LFS to the correct + directory name and set umask to 022. One way to ensure that the LFS variable is always set is to edit the .bash_profile file in both your