diff options
-rw-r--r-- | classes/image_types_ostree.bbclass | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 5b975f0..a9a8174 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -80,15 +80,15 @@ IMAGE_CMD_ostree () { | |||
80 | if [ "$(ls -A $dir)" ]; then | 80 | if [ "$(ls -A $dir)" ]; then |
81 | bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr" | 81 | bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr" |
82 | fi | 82 | fi |
83 | |||
84 | if [ -n "${SYSTEMD_USED}" ]; then | ||
85 | echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf} | ||
86 | else | ||
87 | echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf} | ||
88 | fi | ||
89 | rm -rf ${dir} | 83 | rm -rf ${dir} |
90 | ln -sf var/rootdirs/${dir} ${dir} | ||
91 | fi | 84 | fi |
85 | |||
86 | if [ -n "${SYSTEMD_USED}" ]; then | ||
87 | echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf} | ||
88 | else | ||
89 | echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf} | ||
90 | fi | ||
91 | ln -sf var/rootdirs/${dir} ${dir} | ||
92 | done | 92 | done |
93 | 93 | ||
94 | if [ -d root ] && [ ! -L root ]; then | 94 | if [ -d root ] && [ ! -L root ]; then |
@@ -97,15 +97,40 @@ IMAGE_CMD_ostree () { | |||
97 | fi | 97 | fi |
98 | 98 | ||
99 | if [ -n "${SYSTEMD_USED}" ]; then | 99 | if [ -n "${SYSTEMD_USED}" ]; then |
100 | echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf} | 100 | echo "d /var/roothome 0700 root root -" >>${tmpfiles_conf} |
101 | else | 101 | else |
102 | echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf} | 102 | echo "mkdir -p /var/roothome; chown 700 /var/roothome" >>${tmpfiles_conf} |
103 | fi | 103 | fi |
104 | 104 | ||
105 | rm -rf root | 105 | rm -rf root |
106 | ln -sf var/roothome root | 106 | ln -sf var/roothome root |
107 | fi | 107 | fi |
108 | 108 | ||
109 | if [ -d usr/local ] && [ ! -L usr/local ]; then | ||
110 | if [ "$(ls -A usr/local)" ]; then | ||
111 | bbfatal "Data in /usr/local directory is not preserved by OSTree." | ||
112 | fi | ||
113 | rm -rf usr/local | ||
114 | fi | ||
115 | |||
116 | if [ -n "${SYSTEMD_USED}" ]; then | ||
117 | echo "d /var/usrlocal 0755 root root -" >>${tmpfiles_conf} | ||
118 | else | ||
119 | echo "mkdir -p /var/usrlocal; chown 755 /var/usrlocal" >>${tmpfiles_conf} | ||
120 | fi | ||
121 | |||
122 | dirs="bin etc games include lib man sbin share src" | ||
123 | |||
124 | for dir in ${dirs}; do | ||
125 | if [ -n "${SYSTEMD_USED}" ]; then | ||
126 | echo "d /var/usrlocal/${dir} 0755 root root -" >>${tmpfiles_conf} | ||
127 | else | ||
128 | echo "mkdir -p /var/usrlocal/${dir}; chown 755 /var/usrlocal/${dir}" >>${tmpfiles_conf} | ||
129 | fi | ||
130 | done | ||
131 | |||
132 | ln -sf ../var/usrlocal usr/local | ||
133 | |||
109 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then | 134 | if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then |
110 | # this is a hack for ostree not to override init= in kernel cmdline - | 135 | # this is a hack for ostree not to override init= in kernel cmdline - |
111 | # make it think that the initramfs is present (while it is in FIT image) | 136 | # make it think that the initramfs is present (while it is in FIT image) |