diff options
| -rw-r--r-- | meta/classes/package.bbclass | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 4452e2f4f4..894b7294a2 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
| @@ -727,6 +727,7 @@ python fixup_perms () { | |||
| 727 | dvar = d.getVar('PKGD', True) | 727 | dvar = d.getVar('PKGD', True) |
| 728 | 728 | ||
| 729 | fs_perms_table = {} | 729 | fs_perms_table = {} |
| 730 | fs_link_table = {} | ||
| 730 | 731 | ||
| 731 | # By default all of the standard directories specified in | 732 | # By default all of the standard directories specified in |
| 732 | # bitbake.conf will get 0755 root:root. | 733 | # bitbake.conf will get 0755 root:root. |
| @@ -773,24 +774,27 @@ python fixup_perms () { | |||
| 773 | continue | 774 | continue |
| 774 | entry = fs_perms_entry(d.expand(line)) | 775 | entry = fs_perms_entry(d.expand(line)) |
| 775 | if entry and entry.path: | 776 | if entry and entry.path: |
| 776 | fs_perms_table[entry.path] = entry | 777 | if entry.link: |
| 778 | fs_link_table[entry.link] = entry | ||
| 779 | else: | ||
| 780 | fs_perms_table[entry.path] = entry | ||
| 777 | f.close() | 781 | f.close() |
| 778 | 782 | ||
| 779 | # Debug -- list out in-memory table | 783 | # Debug -- list out in-memory table |
| 780 | #for dir in fs_perms_table: | 784 | #for dir in fs_perms_table: |
| 781 | # bb.note("Fixup Perms: %s: %s" % (dir, str(fs_perms_table[dir]))) | 785 | # bb.note("Fixup Perms: %s: %s" % (dir, str(fs_perms_table[dir]))) |
| 786 | #for link in fs_link_table: | ||
| 787 | # bb.note("Fixup Perms: %s: %s" % (link, str(fs_link_table[link]))) | ||
| 782 | 788 | ||
| 783 | # We process links first, so we can go back and fixup directory ownership | 789 | # We process links first, so we can go back and fixup directory ownership |
| 784 | # for any newly created directories | 790 | # for any newly created directories |
| 785 | for dir in fs_perms_table: | 791 | # Process in sorted order so /run gets created before /run/lock, etc. |
| 786 | if not fs_perms_table[dir].link: | 792 | for link in sorted(fs_link_table): |
| 787 | continue | 793 | dir = fs_link_table[link].path |
| 788 | |||
| 789 | origin = dvar + dir | 794 | origin = dvar + dir |
| 790 | if not (cpath.exists(origin) and cpath.isdir(origin) and not cpath.islink(origin)): | 795 | if not (cpath.exists(origin) and cpath.isdir(origin) and not cpath.islink(origin)): |
| 791 | continue | 796 | continue |
| 792 | 797 | ||
| 793 | link = fs_perms_table[dir].link | ||
| 794 | if link[0] == "/": | 798 | if link[0] == "/": |
| 795 | target = dvar + link | 799 | target = dvar + link |
| 796 | ptarget = link | 800 | ptarget = link |
| @@ -810,9 +814,6 @@ python fixup_perms () { | |||
| 810 | os.symlink(link, origin) | 814 | os.symlink(link, origin) |
| 811 | 815 | ||
| 812 | for dir in fs_perms_table: | 816 | for dir in fs_perms_table: |
| 813 | if fs_perms_table[dir].link: | ||
| 814 | continue | ||
| 815 | |||
| 816 | origin = dvar + dir | 817 | origin = dvar + dir |
| 817 | if not (cpath.exists(origin) and cpath.isdir(origin)): | 818 | if not (cpath.exists(origin) and cpath.isdir(origin)): |
| 818 | continue | 819 | continue |
