SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 246 | Next

Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness

"Gray Hat Hacking, Second Edition"

It takes a several minutes to build up a new root.lzm
module of an even sparsely populated /root directory. It would be inconvenient to add
this much time to the reboot process but we could live with it. After the dir2lzm finishes,
let??™s try deleting the /root directory and expanding it back to /root to make sure itworked:
bt ~ # rm -rf /root
bt ~ # cd
bash: cd: /root: No such file or directory
bt ~ # lzm2dir /tmp/root.lzm /
bt ~ # cd
bash: cd: /root: No such file or directory
Hmm??¦it doesn??™t appear to have worked. After investigating, we see that dir2lzm created
an LZM of the root directory??™s contents, not the root directory itself. Dir2lzm calls
create_module, which does not pass ??“keep-as-directory to mksquashfs. Because
we passed only one directory to dir2lzm (and subsequently mksquashfs), it added only
the content of the one directory to the module. To continue our example, the following
commands will re-create the /root directory contents:
bt ~ # mkdir /root
bt ~ # lzm2dir /tmp/root.lzm /root
We could work around this and build our root.lzm by passing ??“keep-as-directory
to mksquashfs. But after several experiments, we realize that the time it takes to build up
a new /root directory on every reboot is just too long.


Pages:
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258