@ -6,6 +6,8 @@
PYTHONDIR = sorted(glob("usr/"+libdir+"/python?.?"))[0]
stubs = ("list-harddrives", "raidstart", "raidstop")
configdir = configdir + "/common"
import os, time
SOURCE_DATE_EPOCH = os.environ.get('SOURCE_DATE_EPOCH', str(int(time.time())))
%>
## move_stubs()
@ -134,6 +136,20 @@ runcmd mknod ${root}/dev/null c 1 3
runcmd mknod ${ root } /dev/urandom c 1 9
## Record the package versions used to create the image
runcmd chroot ${ root } /bin/rpm -qa --pipe "tee /root/lorax-packages.log"
runcmd chroot ${ root } /bin/rpm -qa --pipe "sort | tee /root/lorax-packages.log"
## fix fonconfig cache containing timestamps
runcmd chroot ${ root } /usr/bin/find /usr/share/fonts /usr/share/X11/fonts -newermt "@ ${ SOURCE_DATE_EPOCH } " -exec \
touch --no-dereference --date="@ ${ SOURCE_DATE_EPOCH } " {} +
runcmd chroot ${ root } /usr/bin/fc-cache -f
## drop timestamp from gconf.xml
runcmd sed -i -e 's/mtime="[0-9]*" //' ${ root } /etc/gconf/gconf.xml.defaults/desktop/gnome/interface/%gconf.xml
## sort groups
runcmd chroot ${ root } /bin/sh -c "LC_ALL=C sort /etc/group > /etc/group.new && mv /etc/group.new /etc/group"
runcmd chroot ${ root } /bin/sh -c "LC_ALL=C sort /etc/gshadow > /etc/gshadow.new && mv /etc/gshadow.new /etc/gschadow"
chmod /etc/gshadow 0700
## TODO: we could run prelink here if we wanted?