Repository navigation
Commit cbce508
committed
fix(image-factory): create the loop device node when there is none
In a container the kernel hands out a free loop number through
/dev/loop-control, but the matching /dev/loopN node only exists if something
creates it, and there is no udev to do so. losetup gets as far as /dev/loop5
and then fails with ENOENT, reporting the node as "lost".
So create it. Where the container may use block devices at all, that is enough;
where it may not, the message now says what is actually missing instead of
blaming the loop module, which was loaded all along - and points at the host or
a VM, since device-mapper is the next thing this script needs and has the same
kind of problem.
The three silent retries stay as a loop, but they were never the answer here:
a device node that does not exist does not appear after sleeping two seconds.
Signed-off-by: Simon Walz <contact@simonwalz.de>1 parent ce8f055 commit cbce508
1 file changed
Lines changed: 55 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
174 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
175 | 223 | | |
176 | 224 | | |
177 | 225 | | |
| |||
0 commit comments