tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

postinstall(8) makedev check not reporting expected failure



Hi,

Since quite some time, i noticed that postinstall(8) does not report a
failure when `/dev/MAKEDEV' is outdated ...

Looking at the corresponding code, shows that there are checks for
both MAKEDEV and MAKEDEV.local; but only the latter will make it fail
if outdated, as the previous compare_dir() result is lost.

How about the attached patch which will make it fail if either file
needs updating ?

postinstall-check ===> .        (with: DESTDIR=/misc/chroot/netbsd32)
   === Post installation checks ===
AWK=/local/src/NetBSD/tool/bin/nbawk MAKE=/local/src/NetBSD/tool/bin/nbmake 
/bin/sh /local/src/NetBSD/src/usr.sbin/postinstall/postinstall -s 
/local/src/NetBSD/src -d /misc/chroot/netbsd32/ check; if [ $? -gt 1 ]; then 
exit 1; fi
Source directory: /local/src/NetBSD/src
Target directory: /misc/chroot/netbsd32/
bluetooth check:
[...]
iscsi check:
makedev check:
        /tmp/_postinstall.29767.0/MAKEDEV != /misc/chroot/netbsd32//dev/MAKEDEV
motd check:
[...]
obsolete check:
postinstall checks passed: bluetooth ddbonpanic defaults dhcpcd envsys gid 
hosts iscsi makedev motd mtree named pam periodic pf postfix rc ssh wscons x11 
uid varrwho obsolete
postinstall checks failed:

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: usr.sbin/postinstall/postinstall
===================================================================
RCS file: /cvsroot/src/usr.sbin/postinstall/postinstall,v
retrieving revision 1.97
diff -u -p -r1.97 postinstall
--- usr.sbin/postinstall/postinstall    13 May 2009 23:44:26 -0000      1.97
+++ usr.sbin/postinstall/postinstall    19 May 2009 14:31:43 -0000
@@ -811,6 +811,7 @@ additem makedev "/dev/MAKEDEV being up t
 do_makedev()
 {
        [ -n "$1" ] || err 3 "USAGE: do_makedev   fix|check"
+       failed=0
 
        if [ -f "${SRC_DIR}/etc/MAKEDEV.tmpl" ]; then
                        # generate MAKEDEV from source if source is available
@@ -826,11 +827,16 @@ do_makedev()
            || return 1
                        # ${dir} is set by find_file_in_dirlist()
        compare_dir "$1" "${dir}" "${DEST_DIR}/dev" 555 MAKEDEV
+       failed=$(( ${failed} + $? ))
+
        find_file_in_dirlist MAKEDEV.local "MAKEDEV.local" \
            "${SRC_DIR}/etc" "${SRC_DIR}/dev" \
            || return 1
                        # ${dir} is set by find_file_in_dirlist()
        compare_dir "$1" "${dir}" "${DEST_DIR}/dev" 555 MAKEDEV.local
+       failed=$(( ${failed} + $? ))
+
+       return ${failed}
 }
 
 #


Home | Main Index | Thread Index | Old Index