[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Help needed with mount
From:       Rob Landley <rob () landley ! net>
Date:       2006-07-30 19:23:08
Message-ID: 200607301523.08847.rob () landley ! net
[Download RAW message or body]

On Monday 24 July 2006 11:13 pm, Sean Richards wrote:
> Thanks for the reply :)
> Have built busybox with make defconfig and CONFIG_FEATURE_SH_IS_ASH=y. 
> Just checked in .config and CONFIG_FEATURE_MTAB_SUPPORT is not set so 
> that looks OK. At the moment I boot the system with Grub using 'root 
> (hd1,0)', 'kernel (hd1,0)/boot/vmlinuz-2.6.17.1 root=/dev/hdb1'. It all 
> boots up OK and everything seems to be working OK, just can't get rid of 
> these errors from mount when rebooting or shutting down. Not really sure 
> where to go from here.

Ok, let's see if I can reproduce this...

Legacy mtab disabled check, the grub stuff is vaguely irrelevant, 
root=/dev/hdb1 check...

From your previous message, I have:

/etc/fstab contains
/dev/hdb1      /                reiserfs    defaults         0   0
devpts           /dev/pts     devpts     defaults         0   0
proc             /proc          proc        defaults         0   0

/etc/init.d/rcS contains
/bin/mount /proc
/bin/mount -a
/bin/mount -o remount,rw /

Ok, I don't use reiserfs and my laptop hasn't got a /dev/hdb, but let's see...

I can't reproduce this.  Here's what I did:

Grab a current busybox snapshot (svn 15754), make defconfig, make menuconfig, 
switch on static linking, make.  Move the resulting "busybox" binary to an 
empty testing directory.

Build a User Mode Linux instance from the kernel source I have lying around 
(2.6.17.1) with the attached miniconfig (using my miniconfig patch, also 
attached).  The command line was:

make ARCH=um miniconfig MINICONFIG=linux-miniconfig-uml
make ARCH=um

Move the resulting "linux" binary to the testing directory.

Then I created an ext2 filesystem image:
dd if=/dev/zero of=walnut.img bs=1M count=20
mke2fs walnut.img
tune2fs -c 0 -i 0 walnut.img
mkdir sub
su - # become root
mount -o loop walnut.img sub
cd sub
mkdir -p dev/pts proc etc sys
mknod dev/console c 5 1
cp ../busybox .
exit
umount sub
exit

Now let's run the image under UML:

./linux rw ubda=walnut.img root=/dev/ubda init=/busybox lash

In there, do:

mount -t sysfs /sys /sys
mdev -s # this populates /dev
cat > /etc/rcS << EOF
mount /proc
mount -a
mount -o remount,rw /
EOF
chmod +x /etc/rcS
cat > /etc/fstab << EOF
/dev/ubda      /                ext2    defaults         0   0
devpts           /dev/pts     devpts     defaults         0   0
proc             /proc          proc        defaults         0   0
EOF
ln -s /proc/mounts /etc/mtab
sync
exit

From the parent system, 
e2fsck walnut.img

And now run the image again and try it out:

./linux rw ubda=walnut.img root=/dev/ubda init=/busybox lash

At the command prompt:

lash /etc/rcS
umount -a

I didn't get an error from that...

What do I do to reproduce this?

Rob
-- 
Never bet against the cheap plastic solution.

["miniconfig.patch" (text/x-diff)]

diff -ur linux-2.6.17.1/scripts/kconfig/Makefile \
                linux-2.6.17.new/scripts/kconfig/Makefile
--- linux-2.6.17.1/scripts/kconfig/Makefile	2006-06-20 05:31:55.000000000 -0400
+++ linux-2.6.17.new/scripts/kconfig/Makefile	2006-07-06 15:51:25.000000000 -0400
@@ -2,7 +2,7 @@
 # Kernel configuration targets
 # These targets are used from top-level makefile
 
-PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig \
update-po-config +PHONY += oldconfig xconfig gconfig menuconfig config \
silentoldconfig miniconfig update-po-config  
 xconfig: $(obj)/qconf
 	$< arch/$(ARCH)/Kconfig
@@ -23,6 +23,14 @@
 silentoldconfig: $(obj)/conf
 	$< -s arch/$(ARCH)/Kconfig
 
+MINICONFIG = mini.config
+miniconfig: $(obj)/conf $(MINICONFIG)
+	$(Q)KCONFIG_ALLCONFIG=$(MINICONFIG) $< -n arch/$(ARCH)/Kconfig > /dev/null 2> \
.config.result ; \ +	cat .config.result ; \
+	RESULT=`cat .config.result`; \
+	rm .config.result ; \
+	if [ ! -z "${RESULT}" ]; then exit 1; fi
+
 update-po-config: $(obj)/kxgettext
 	xgettext --default-domain=linux \
           --add-comments --keyword=_ --keyword=N_ \
@@ -79,6 +87,7 @@
 	@echo  '  allmodconfig	  - New config selecting modules when possible'
 	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
 	@echo  '  allnoconfig	  - New config where all options are answered with no'
+	@echo  '  miniconfig	  - New config unpacked from mini.config (or MINICONFIG=file)'
 
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
diff -ur linux-2.6.17.1/scripts/shrinkconfig linux-2.6.17.new/scripts/shrinkconfig
--- linux-2.6.17.1/scripts/shrinkconfig	2006-07-06 16:34:39.000000000 -0400
+++ linux-2.6.17.new/scripts/shrinkconfig	2006-07-06 15:54:40.000000000 -0400
@@ -0,0 +1,86 @@
+#!/bin/bash
+
+# shrinkconfig copyright 2006 by Rob Landley <rob@landley.net>
+# Licensed under the GNU General Public License version 2.
+
+if [ $# -ne 1 ]
+then
+  echo "Turns current .config into a miniconfig file."
+  echo "Usage: shrinkconfig mini.config"
+  exit 1
+fi
+
+if [ ! -f .config ]
+then
+  echo "Need a .config file to shrink."
+  exit 1
+fi
+LENGTH=$(cat .config | wc -l)
+
+OUTPUT="$1"
+cp .config "$OUTPUT"
+if [ $? -ne 0 ]
+then
+  echo "Couldn't create $OUTPUT"
+  exit 1
+fi
+
+# If we get interrupted, clean up the mess
+
+KERNELOUTPUT=""
+
+function cleanup
+{
+  echo
+  echo "Interrupted."
+  [ ! -z "$KERNELOUTPUT" ] && rm -rf "$KERNELOUTPUT"
+  rm "$OUTPUT"
+  exit 1
+}
+
+trap cleanup HUP INT QUIT TERM
+
+# Since the "O=" argument to make doesn't work recursively, we need to jump
+# through a few hoops to avoid overwriting the .config that we're shrinking.
+
+# If we're building out of tree, we'll have absolute paths to source and build
+# directories in the Makefile.
+
+KERNELSRC=$(sed -n -e 's/KERNELSRC[^/]*:=[^/]*//p' Makefile)
+[ -z "$KERNELSRC" ] && KERNELSRC=$(pwd)
+KERNELOUTPUT=`pwd`/.config.minitemp
+
+mkdir -p "$KERNELOUTPUT" || exit 1
+
+echo "Shrinking .config to $OUTPUT..."
+
+# Loop through all lines in the file 
+I=1
+while true
+do
+  if [ $I -gt $LENGTH ]
+  then
+    break
+  fi
+
+  echo -n -e "\r"$I/$LENGTH lines $(cat "$OUTPUT" | wc -c) bytes
+
+  sed -n "${I}!p" "$OUTPUT" > "$KERNELOUTPUT"/.config.test
+  # Do a config with this file
+  make -C "$KERNELSRC" O="$KERNELOUTPUT" allnoconfig \
KCONFIG_ALLCONFIG="$KERNELOUTPUT"/.config.test > /dev/null +
+  # Compare.  The date changes, so expect a small difference each time.
+  D=$(diff "$KERNELOUTPUT"/.config .config | wc -l)
+  if [ $D -eq 4 ]
+  then
+    mv "$KERNELOUTPUT"/.config.test "$OUTPUT"
+    LENGTH=$[$LENGTH-1]
+  else
+    I=$[$I + 1]
+  fi
+done
+
+rm -rf "$KERNELOUTPUT"
+
+# One extra echo to preserve status line.
+echo


["linux-miniconfig-uml" (text/plain)]

CONFIG_MODE_SKAS=y
CONFIG_BINFMT_ELF=y
CONFIG_HOSTFS=y
CONFIG_SWAP=y
CONFIG_SYSCTL=y
CONFIG_EMBEDDED=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_FUTEX=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SHMEM=y
CONFIG_LBD=y
CONFIG_STDERR_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_BLK_DEV_UBD=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_EXT2_FS=y
CONFIG_DNOTIFY=y
CONFIG_PROC_FS=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
#CONFIG_SQUASHFS=y
#CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3


_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic