Revision: 6784
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6784&view=rev
Author:   gespinasse
Date:     2012-09-30 14:09:11 +0000 (Sun, 30 Sep 2012)
Log Message:
-----------
Remove the df hacks on coreutils tests for the fluctuating df behavior.
Instead produce a correct /etc/mtab that df understand.

In particular rootfs line need to be before /dev line for / partition or df may 
misbehave, in particular when using -t <fstype>.
That was not the case when I first try
grep -E ' / |/sys sysfs|/proc proc|/dev/pts|/dev/shm' /proc/mounts | sort -u 
>/etc/mtab
sort placed rootfs after /dev/sd3 and df -T -t ext3 find no fs to process even 
df -T / show /dev/sda3 as type ext3

The correct /etc/mtab fix the hacked tests and more like
-skip-seek-past-dev: skipped test: failed to determine size of -
-SKIP: dd/skip-seek-past-dev
+PASS: dd/skip-seek-past-dev
...
slink: skipped test: '.' is on an XFS file system
-SKIP: du/slink
+PASS: du/slink

I was always curious of the '.' is on an XFS file system diag as my partition 
is ext3.
It was just another bad df behavior with an incorrect mtab.

Add one hack to not skip ls/root-rel-symlink-color test
Add one hack to not skip  mv/i-3 test.
But I left this hack commented because it change permission of tty even out of 
chroot.
I can't warrant the permission will be restored. The corner case is that you 
stop the build during tests and restart from another tty.
Anyway, that enought to document why the /dev/stdin is not readable.
The right to read /dev/stdin is reserved to the user running make.sh.
As make.sh build as root, root has no right to read /dev/stdin unless we give 
him that right.

Update the comment for isatty that still fail on 8.19 (when not hacked)

Modified Paths:
--------------
    ipcop/trunk/lfs/coreutils
    ipcop/trunk/lfs/stage2

Modified: ipcop/trunk/lfs/coreutils
===================================================================
--- ipcop/trunk/lfs/coreutils   2012-09-09 18:41:10 UTC (rev 6783)
+++ ipcop/trunk/lfs/coreutils   2012-09-30 14:09:11 UTC (rev 6784)
@@ -81,13 +81,8 @@
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xf $(DIR_DL)/$(DL_FILE)
 
-       # Fix a 8.{16,17} test issue
+       # Fix a 8.{16,17,18,19} test issue
        cd $(DIR_APP) && sed -i -e 's/! isatty/isatty/' -e '45i\              
|| errno == ENOENT' gnulib-tests/test-getlogin.c
-       # Hack a 8.{18,19} test issues due to /etc/mtab not a symlink, df 
parameter should vary
-       # /etc/mtab as symlink is not a panacea as no-mtab-status may fail due 
to a mount outside of our chroot
-       cd $(DIR_APP) && sed -i -e "s/ '\.' / /" tests/df/total-unprocessed
-       cd $(DIR_APP) && sed -i -e "s/df ||/df '.' ||/" tests/df/no-mtab-status
-       cd $(DIR_APP) && sed -i -e "s/^df ||/df '.' ||/" -e "s/512/512 '.'/" -e 
"s/\-P  /-P '.' /" tests/df/total-verify
 
 ifeq "$(STAGE)" "toolchain"
        # hostname is used on base stage by coreutils configure and perl base 
tests
@@ -108,10 +103,17 @@
 ifeq "$(RUNNING_TEST)" "yes"
        # To run just one test, add TESTS=[full-test-name] VERBOSE=yes
 
-       # To be able to run rm/fail-eperm test
+       # To not skip rm/fail-eperm test
        touch /tmp/root-owned
+       # To not skip ls/root-rel-symlink-color
+       ln -sf ../usr /foo
+       # The user running make.sh own exclusive right to tty, allow root to 
read stdin in mv/i-3
+       # This change the setting even outside of the chroot
+       # Commented for now. Never certain to restore permission if you stop 
during tests and restart the tests from another tty.
+       #chmod a+r `tty`
 
        -cd $(DIR_APP) && make -j 1 NON_ROOT_USERNAME=nobody check-root &> 
$(DIR_TEST)/$(THISAPP)-$(STAGE_ORDER).log
+
        # Temporary during tests
        echo "dummy:x:1000:nobody" >> /etc/group
        # To be able to run non-root tests as nobody
@@ -121,7 +123,8 @@
 endif
        # need to be outside ifeq/endif in case a test fail and you recompile 
without test
        -sed -i '/dummy/d' /etc/group
-       rm -f /tmp/root-owned
+       rm -f /tmp/root-owned /foo
+       #chmod a-r `tty`
 
        cd $(DIR_APP) && make install-exec
        mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin

Modified: ipcop/trunk/lfs/stage2
===================================================================
--- ipcop/trunk/lfs/stage2      2012-09-09 18:41:10 UTC (rev 6783)
+++ ipcop/trunk/lfs/stage2      2012-09-30 14:09:11 UTC (rev 6784)
@@ -110,9 +110,13 @@
        chmod -R 644 /etc
        find /etc -type d -exec chmod 755 {} \;
 
-       # Use mtab as a file, not a symlink to /proc/mounts : it save 1 
coreutil test cleanup
-       rm -f /etc/mtab
-       touch /etc/mtab
+       # Use mtab as regular file. This allow 'df' not to fail during 
coreutils test with mount points out
+       # of the chroot that didn't exist inside (like debian /lib/init/rw)
+       rm -f /etc/mtab         # In case you experiment with symlink to 
/proc/mounts
+       # rootfs need to be on top or df -T -t <yourfstype> / will fail with 
df: no file systems processed
+       grep ' / ' /proc/mounts >/etc/mtab
+       # Remove the duplicate due to the mount --bind
+       grep -E '/sys sysfs|/proc proc|/dev/pts|/dev/shm' /proc/mounts | sort 
-u >>/etc/mtab
 
        # Enable the serial line console for sparcs
 ifeq "$(MACHINE)" "sparc"
@@ -150,7 +154,7 @@
        # we need our diff helper before POSTBUILD
        cp $(DIR_SRC)/src/scripts/install-diff.pl /usr/local/bin
 
-       # show chroot_make existing variables
+       # show chroot_make existing variables to help debugging
        env
 
        @$(POSTBUILD)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to