PRETRANS
<lua>
--#
--# If we are running in pretrans in a fresh root, there is no /usr and symlinks.
--# We cannot be sure, to be the very first rpm in the transaction list,
--# so, let's create the toplevel symlinks here and the directories they point to.
--# When our rpm is unpacked by cpio, it will set all permissions and modes later.
--#
if posix.stat("/usr") == nil then
posix.mkdir("/usr")
end
for i,dir in ipairs({"/lib", "/lib64", "/sbin", "/bin"}) do
if posix.stat("/usr"..dir) == nil then
posix.mkdir("/usr"..dir)
if posix.stat(dir, "mode") == nil then
posix.symlink("usr"..dir, dir)
end
end
end
return 0
POSTIN
<lua>
posix.symlink("../run", "/var/run")
posix.symlink("../run/lock", "/var/lock")