Create /dev/random and /dev/urandom before running rpm -qa (#1420523)

In order to run rpm inside the newly created image it now needs to
create a couple device nodes to satisfy nss, which is used by rpm.
This commit is contained in:
Brian C. Lane 2017-02-21 10:24:56 -08:00
parent 21076f08d9
commit d95e69aa34
1 changed files with 4 additions and 1 deletions

View File

@ -117,6 +117,9 @@ remove etc/lvm/lvm.conf
append etc/lvm/lvm.conf "global {\n\tuse_lvmetad = 1\n}\n"
## Record the package versions used to create the image
runcmd chroot ${root} /bin/rpm -qa --pipe "tee /root/lorax-packages.log"
## rpm initializes nss, which requires /dev/urandom to be present, hence the mknod
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/random c 1 8
runcmd chroot ${root} /usr/bin/mknod -m 666 /dev/urandom c 1 9
runcmd chroot ${root} /usr/bin/rpm -qa --pipe "tee /root/lorax-packages.log"
## TODO: we could run prelink here if we wanted?