i encounter this error when building the (RAMDISK_CD) distrib kernel:
usage: maketz.sh DESTDIR

(in context:)
COPY    ${DESTDIR}/etc/firmware/run-rt3071      etc/firmware/run-rt3071
COPY    ${DESTDIR}/etc/firmware/zd1211          etc/firmware/zd1211
COPY    ${DESTDIR}/etc/firmware/zd1211b         etc/firmware/zd1211b
TZ
usage: maketz.sh DESTDIR
rm /mnt/instbin
Filesystem  512-blocks      Used     Avail Capacity iused   ifree  %iused  Mount
/dev/vnd0a        3615      3164       451    88%     173     337    34%   /mnt
umount /mnt
vnconfig -u vnd0


the kernel builds, but when i boot from it, there is no 'var/tzlist'.

i trace the problem to 'distrib/miniroot/list2sh.awk', 'maketz.sh' is being
called with an empty variable

--- list2sh.awk.orig    Fri Feb 21 14:33:31 2014
+++ list2sh.awk Fri Sep 26 22:48:12 2014
@@ -60,7 +60,7 @@ $1 == "CRUNCHSPECIAL" {
 }
 $1 == "TZ" {
        printf("echo '%s'\n", $0);
-       printf("(cd ${TARGDIR}; sh $UTILS/maketz.sh $DESTDIR)\n");
+       printf("(cd ${TARGDIR}; sh $UTILS/maketz.sh ${TARGDIR})\n");
        next;
 }
 $1 == "COPYDIR" {


then i rerun build, and instead get:
/usr/src/distrib/i386/ramdisk_cd/../../miniroot/maketz.sh[13]: cd: /mnt/usr/shar
e/zoneinfo - No such file or directory

it builds, and 'mr.fs' contains 'var/tzlist', but said file contains the
contents of the miniroot filesystem, and not the timezone list, since it runs
maketz.sh in /mnt, which does:
  ls -1dF `tar cvf /dev/null [A-Za-y]*`

there is no 'usr/share/zoneinfo' in the miniroot (and as far as i know never
has been), which is where 'maketz.sh' tries to get the list.

now i am possibly missing something, but 'distrib/miniroot/maketz.sh' makes no
sense in this respect:
      #!/bin/sh

      destdir=$1

      if [ $# -lt 1 ]; then
              echo usage: maketz.sh DESTDIR
              exit 0
      fi

      (
              cd $destdir/usr/share/zoneinfo
              ls -1dF `tar cvf /dev/null [A-Za-y]*`
      ) > var/tzlist

now why is $destdir here? is it in any way useful? this could be reduced to:
      #!/bin/sh

      cd /usr/share/zoneinfo
      ls -1dF `tar cvf /dev/null [A-Za-y]*` >var/tzlist


--- maketz.sh.orig      Wed May  6 23:43:02 2009
+++ maketz.sh   Fri Sep 26 23:33:49 2014
@@ -1,13 +1,4 @@
 #!/bin/sh
 
-destdir=$1
-
-if [ $# -lt 1 ]; then
-       echo usage: maketz.sh DESTDIR
-       exit 0
-fi
-
-(
-       cd $destdir/usr/share/zoneinfo
-       ls -1dF `tar cvf /dev/null [A-Za-y]*`
-) > var/tzlist
+cd /usr/share/zoneinfo
+ls -1dF `tar cvf /dev/null [A-Za-y]*` >var/tzlist


of course there doesn't seem to be any need for 'maketz.sh' at all.
'list2sh.awk' could be changed thus:

--- list2sh.awk.orig    Fri Feb 21 14:33:31 2014
+++ list2sh.awk Fri Sep 26 23:39:39 2014
@@ -60,7 +60,7 @@ $1 == "CRUNCHSPECIAL" {
 }
 $1 == "TZ" {
        printf("echo '%s'\n", $0);
-       printf("(cd ${TARGDIR}; sh $UTILS/maketz.sh $DESTDIR)\n");
+        printf("(cd /usr/share/zoneinfo && ls -1dF `tar cvf /dev/null 
[A-Za-y]*` >${TARGDIR}/var/tzlist)");
        next;
 }
 $1 == "COPYDIR" {

i used this last 'list2sh.awk' patch that bypasses 'maketz.sh' completely, and
everything is as it should be.

that is, unless there was some need for $DESTDIR to be used in the original
'list2sh.awk', to be passed on to 'maketz.sh'. where is the tzlist SUPPOSED to
come from anyway?

i think i have seen this bug for years, but the release kernel has the proper
'var/tzlist'. how is it succeeding for them? does whoever is compiling releases
have $DESTDIR set? does $DESTDIR _need_ to be set (manually)?

maybe the method i have been using to build distrib is outdated. currently i do:
# (cd /usr/src/distrib/special/libstubs && make)
# cd /usr/src/distrib/i386/ramdisk_cd && make
which i got some years ago from one of these lists. is this still the preferred
method?

Reply via email to