Revision: 6830
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6830&view=rev
Author:   gespinasse
Date:     2012-11-07 08:08:54 +0000 (Wed, 07 Nov 2012)
Log Message:
-----------
Change some details about mtab with comment why
- do not write rootfs or du/bind-mount-dir-cycle.sh fail
- don't write our mount --move /dev to mtab to look more like an usual one

Touch /etc/fstab or fsck is noisy on futur util-linux tests

mknod one /dev/loop has a side effect of allowing loop module from the running 
kernel to be loaded by losetup from inside our chroot.
parted already do that but not util-linux or mdadm

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

Modified: ipcop/trunk/lfs/stage2
===================================================================
--- ipcop/trunk/lfs/stage2      2012-11-05 20:08:37 UTC (rev 6829)
+++ ipcop/trunk/lfs/stage2      2012-11-07 08:08:54 UTC (rev 6830)
@@ -113,11 +113,14 @@
        # 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
+       # rootfs line need to be absent or coreutils du/bind-mount-dir-cycle.sh 
fail
+       grep '^\/dev.* / ' /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
 
+       # To silent fsck on util-linux tests
+       touch /etc/fstab
+
        # Enable the serial line console for sparcs
 ifeq "$(MACHINE)" "sparc"
        sed -i "s,^#7,7,g" /etc/inittab
@@ -140,18 +143,24 @@
 
        # This trick is necessary in order to create two devices in the target 
/dev, rather than in the host /dev
        mkdir -p /dev1
-       mount --move /dev /dev1
+       # Avoid writing our /dev move to mtab to look more like a ordinary mtab.
+       # When this line was alone in mtab, it caused some 'df' issue.
+       mount --no-mtab --move /dev /dev1
 
        # Make /dev/null and /dev/console
        cd /dev && rm -f null console
        cd /dev && mknod -m 0666 null c 1 3
        cd /dev && mknod -m 0600 console c 5 1
 
+       # mknod one /dev/loop allow losetup (from inside) to mount loop module 
(from running kernel outside the chroot)
+       # That will allow some tests using loop to run
+       rm -f /dev/loop0 && mknod /dev/loop0 b 7 0
+
        # Now move the target /dev to point back to the host /dev
-       mount --move /dev1 /dev
+       mount --no-mtab --move /dev1 /dev
        rm -fr /dev1
 
-       # we need our diff helper before POSTBUILD
+       # Our diff helper is needed before POSTBUILD
        cp $(DIR_SRC)/src/scripts/install-diff.pl /usr/local/bin
 
        # show chroot_make existing variables to help debugging

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


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to