Dnia 20 października 2007 12:39 Jakub W. Jozwicki <[EMAIL PROTECTED]>
napisał(a):
>
> Hello,
> Could you look at my initrd and tell me why there is a problem
> with pivot_root? Aufs has been checked out today from CVS.
>
> > cat /proc/mounts
>
> rootfs / rootfs rw 0 0
> proc /proc proc rw 0 0
> /sys /sys sysfs rw 0 0
> tmpfs /cdroot tmpfs rw 0 0
> aufs /cdroot/union aufs
> ro,xino=/cdroot/changes/.aufs.xino,udba=nonemnowarn_perm,br:/cdroot/changes=rw:
> /cdroot/images/var.sqf=rr:/cdroot/images/usr.sqf=rr:/cdroot/images/sbin.sqf=rr:
> /cdroot/images/root.sqf=rr:/cdroot/images/opt.sqf=rr:/cdroot/images/lib.sqf=rr:
> /cdroot/images/home.sqf=rr:/cdroot/images/etc.sqf=rr:/cdroot/images/boot.sqf=rr
> :/cdroot/images/bin.sqf=rr 0 0
> /dev/sr0 /mnt/cdrom iso9660 ro 0 0
> /dev/loop0 /cdroot/images/bin.sqf squashfs ro 0 0
> /dev/loop1 /cdroot/images/boot.sqf squashfs ro 0 0
> /dev/loop2 /cdroot/images/etc.sqf squashfs ro 0 0
> /dev/loop3 /cdroot/images/home.sqf squashfs ro 0 0
> /dev/loop4 /cdroot/images/lib.sqf squashfs ro 0 0
> /dev/loop5 /cdroot/images/opt.sqf squashfs ro 0 0
> /dev/loop6 /cdroot/images/root.sqf squashfs ro 0 0
> /dev/loop7 /cdroot/images/sbin.sqf squashfs ro 0 0
> /dev/loop8 /cdroot/images/usr.sqf squashfs ro 0 0
> /dev/loop9 /cdroot/images/var.sqf squashfs ro 0 0
>
> > cat /sys/fs/aufs/brs
> aufs /cdroot/union d786dc00 [ reverse order of aufs entries from mount ]
>
> > cat /sys/fs/aufs/config
> CONFIG_AUFS=m
> CONFIG_AUFS_FAKE_DM=y
> CONFIG_AUFS_BRANCH_MAX_127=y
> CONFIG_AUFS_SYSAUFS=y
> CONFIG_AUFS_HINOTIFY=
> CONFIG_AUFS_EXPORT=y
> CONFIG_AUFS_ROBR=y
> CONFIG_AUFS_DLGT=
> CONFIG_AUFS_RR_SQUASHFS=y
> CONFIG_AUFS_DEBUG=y
>
>
> > cat /sys/fs/aufs/stat
> wkq max_busy 1 0 0 0, 0(generic)
>
> > cat /sys/fs/aufs/d786dc00/xino
>
> 8x4096 4096
> 0: 1, 16x4096 12744
> 1: 1, 8x4096 6900
> 2: 1, 24x4096 196072
> 3: 1, 8x4096 12
> 4: 1, 8x4096 12
> 5: 1, 8x4096 5992
> 6: 1, 8x4096 1300
> 7: 1, 8x4096 1564
> 8: 1, 8x4096 1064
> 9: 1, 8x4096 20
> 10: 1, 8x4096 12
>
> /cdroot/union>pivot_root . /tmp/initrd: Device or resource busy
>
> > cat initrd.bootcd
>
> #!/bin/ash
>
> LIVE="/cdroot" # factory
> CHANGES="$LIVE/changes" # changes stored in memory
> IMAGES="$LIVE/images" # uncompressed squashfs
> UNION="$LIVE/union" # root
> CDROM="/mnt/cdrom"
> BASE="$CDROM/livecd/base" # storage for squashfs modules
> INITRD="/tmp/initrd"
> RAMSIZE="25%"
>
> fatal() {
> bad_msg "$1"
> /bin/ash
> }
>
> union_setup() {
> modprobe aufs
> modprobe loop max_loop=255
>
> mkdir -p $LIVE 2>&1 >/dev/null
>
> good_msg "mounting tmpfs"
> mount -t tmpfs -o "size=$RAMSIZE" tmpfs $LIVE 2>&1 >/dev/null
> mkdir -p $CHANGES $IMAGES $UNION 2>&1 >/dev/null
> good_msg "mounting unionfs"
> mount -t aufs -o nowarn_perm,udba=none,br:$CHANGES=rw none $UNION
>
> [[ $? -ne 0 ]] && fatal "can't setup union (aufs)"
> }
>
> find_cd() {
> good_msg "looking for cd"
> mkdir -p /mnt/cdrom 2>&1 >/dev/null
> for dev in `ls /sys/block | grep -v ram | grep -v fd | grep -v loop`;
> do
> echo "checking /dev/$dev"
> mount -o ro /dev/$dev /mnt/cdrom 2>/dev/null 1>/dev/null; ret=$?
> [[ -d $BASE ]] && return 0
> [[ $ret -eq 0 ]] && umount /mnt/cdrom 2>/dev/null 1>/dev/null
> done
> fatal "no media found"
> }
>
> union_insert_modules() {
>
> good_msg "inserting module"
>
> for i in 8 9 10 11 12 13 14 15 16; do
> mknod /dev/loop$i b 7 $i 2>&1 >/dev/null;
> done
>
> for mod in `ls $BASE/`; do
> name=`echo $mod | cut -d. -f1`
> echo -n -e "$name "
> mkdir $IMAGES/$mod 2>&1 >/dev/null
> mount -t squashfs -o loop,ro $BASE/$mod $IMAGES/$mod
> mount -o remount,append:$IMAGES/$mod=rr $UNION
> done
> echo ""
> }
>
> setupBootCD() {
>
> [[ "0$BOOTCD" -eq 1 ]] || return 0
>
> union_setup
> find_cd
> union_insert_modules
>
> for dir in "proc" "sys" "dev" "tmp"; do
> mkdir -p $UNION/$dir 2>&1 >/dev/null
> done
> chmod 0777 $UNION/tmp 2>&1 >/dev/null
> mkdir -p $INITRD 2>&1 >/dev/null
> cd $UNION
> cp -fdR /dev . 2>&1 >/dev/null
>
> mount -n -o remount,ro aufs .
> good_msg "pivoting root"
> pivot_root . $INITRD || fatal "error in pivot_root"
> good_msg "calling init"
> exec /usr/bin/chroot /sbin/init dev/console 2>&1
>
> fatal "fatal error"
> }
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/