Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not patch $TARGET_FS_ROOT/etc/mtab if symbolic link. #2048

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions usr/share/rear/finalize/GNU/Linux/280_migrate_uuid_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ for file in [b]oot/{grub.conf,menu.lst,device.map} [e]tc/grub.* \
[e]tc/security/pam_mount.conf.xml [b]oot/efi/*/*/grub.cfg
do

# $TARGET_FS_ROOT/etc/mtab is no longer regular file but symbolic link
# pointing to /proc/mounts resp /proc/self/mounts.
# We should not poke around /proc with `sed -i` for this reason we will
# check if $TARGET_FS_ROOT/etc/mtab is symbolic link and skip all further
# replacements.
[[ "$file" = "etc/mtab" && -L "$file" ]] && continue

#[[ -d "$file" ]] && continue # skip directory
[[ ! -f "$file" ]] && continue # skip directory and file not found
# sed -i bails on symlinks, so we follow the symlink and patch the result
Expand Down