Active Topics

 


Reply
Thread Tools
Posts: 207 | Thanked: 119 times | Joined on Nov 2009 @ Pittsburgh, PA, USA
#131
I resolve CAMERA's problem!!!!
Now my camera can took pictures on ext3 and vfat!!!!

I resolved it by modification ke-recv (I will try too put patch somewhere...).
But camera has bug too.....

Bug is:
When camera start it is checking on presence folder DCIM on target partition. If it doesn't exist camera create folder DCIM. Here is a bug!
DCIM created with root:root (group and user) but should be user:users.

Like way around (until nokia will fix it) could be change owner:group by command:

chown -R user:users DCIM
chmod -R 664 DCIM

After this camera make picture on ext3 partition!!!
Quality of pictures absolutely same!

full script for this:
1. Turn on Camera
2. Change Location for saving picture on internal memory
3. Make picture. Camera will be closed with error message.
4. in terminal type:
chown -R user:users DCIM
chmod -R 664 DCIM

After this camera will work.
 

The Following 6 Users Say Thank You to mikhmv For This Useful Post:
Posts: 451 | Thanked: 334 times | Joined on Sep 2009
#132
Please post the diff here.
 

The Following User Says Thank You to 白い熊 For This Useful Post:
Posts: 207 | Thanked: 119 times | Joined on Nov 2009 @ Pittsburgh, PA, USA
#133
Ok here is my way to convert storage to ext3:
Code:
sudo gainroot
cd /home/user
umount MyDocs
sfdisk -d > sf
nano sf # set 1st partition to 83
sfdisk --force /dev/mmcblk0 < sf
mkfs.ext3 /dev/mmcblk0p1
After this need make normal fstab. I am not sure is it used (fstab) some where on n900 or not but I prefer to have it clear...
You can modify /etc/event.d/rcS-late or /usr/lib/genfstab.awk.
I modified /usr/lib/genfstab.awk.
here my file:
Code:
#!/usr/bin/awk

BEGIN {
	# states so that we don't end up having more than one
	# of home or MyDocs; we can have as many swaps as we find
	__home = 0
	__fat = 0

	print "# autogenerated"
	print "rootfs / rootfs defaults,errors=remount-ro,noatime 0 0"
}

/^\/dev\/mmc/ { start=1 }
start == 1 && $6 == 82 {
	printf "%s none swap sw 0 0\n", $1
}

start == 1 && $6 == 83 && !__home {
	printf "%s /home ext3 %s 0 0\n", "/dev/mmcblk0p2", home_opts
	__home++
}

start == 1 && $6 == 83 && !__fat {
	printf "%s /home/user/MyDocs ext3 %s 0 0\n", "/dev/mmcblk0p1", home_opts
	__fat++
}
For mounting it and make it work need make some small fix in ke-recv. First file probably more simple to just rewrite. This is "/usr/sbin/mmc-mount". I tried to make more universal. It could work now with ext3 and vfat. In case vfat it is require 3 (original amount of parameters) or 4 arguments.
Code:
#!/bin/sh
# $1 - device
# $2 - mount point
# $3 - rw or ro mode for mounting
# $4 - file system vfat or ext3. If it is absent mount vfat.


. /etc/default/mount-opts #load standard parameters for mounting FAT and ext3
#home_opts="rw,noatime,errors=continue,commit=1,data=writeback"
#fat_opts="noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir"

case "$4" in	
	ext3)
		SYS=ext3
		PAR=$home_opts
	;;
	*)
		SYS=vfat
		PAR="$3,$fat_opts"
	;;
esac

COMMAND="mount -t $SYS -o $PAR "$1" "$2" > /dev/null"
#echo $COMMAND
eval $COMMAND
#mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null
Second file which need to change is "/usr/sbin/osso-mmc-mount.sh"
Differences is here:
max@max-lap:~$ diff -b '/home/max/TEMP/n900/Scratchbox/ke-recv/ke-recv-3 (fixed).19/src/osso-mmc-mount.sh' '/home/max/TEMP/n900/Scratchbox/ke-recv/ke-recv-3.19/src/osso-mmc-mount.sh'
40d39
<
49,53d47
< FSys=vfat
< ;;
< 83)
< logger "$0: $PDEV type '$PID' is not FAT32 or FAT16"
< FSys=ext3
56c50
< logger "$0: $PDEV type '$PID' is not FAT32 or FAT16 or ext3"
---
> logger "$0: $PDEV type '$PID' is not FAT32 or FAT16"
66c60
< # mmc-mount $PDEV $MP ro $FSys
---
> # mmc-mount $PDEV $MP ro
76,78c70
< #echo "mmc-mount $PDEV $MP rw $FSys"
<
< mmc-mount $PDEV $MP rw $FSys
---
> mmc-mount $PDEV $MP rw
81d72
< #echo $RC
96,101d86
< if [ "$FSys" = "ext3" ]; then
< #chown -R user:users "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR"
< chown -R user:users "$MP"
< chmod -R 774 "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR"
< fi
<
118,122d102
< if [ "$FSys" = "ext3" ]; then
< #chown -R user:users "$NOKIA_MMC_CAMERA_DIR"
< chown -R user:users "$MP"
< chmod -R 774 "$NOKIA_MMC_CAMERA_DIR"
< fi
max@max-lap:~$
And full file:
Code:
#!/bin/sh
# This file is part of ke-recv
#
# Copyright (C) 2005-2009 Nokia Corporation. All rights reserved.
#
# Author: Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License 
# version 2 as published by the Free Software Foundation. 
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

# Return codes:
# 0 - mounted read-write
# 1 - could not mount
# 2 - mounted read-only

PDEV=$1  ;# preferred device (partition)
MP=$2    ;# mount point

grep "$PDEV " /proc/mounts > /dev/null
if [ $? = 0 ]; then
  logger "$0: $PDEV is already mounted"
  exit 0
fi

if [ ! -d $MP ]; then
  mkdir -p $MP
fi


if ! [ $PDEV = /dev/mmcblk0 -o $PDEV = /dev/mmcblk1 ]; then
  # check the FAT magic number
  PNUM=$(echo $PDEV | sed "s#/dev/mmcblk[01]p##")
  DEV=$(echo $PDEV | sed "s#p[1234]##")
  PID=$(sfdisk -c $DEV $PNUM)
  case "$PID" in
    b | c | e | 4 | 6 | 14 | 16 | 1b | 1c | 1e)
        logger "$0: $PDEV partition type is '$PID'"
        FSys=vfat
        ;;
    83)
        logger "$0: $PDEV type '$PID' is not FAT32 or FAT16"
        FSys=ext3
        ;;
    *)
        logger "$0: $PDEV type '$PID' is not FAT32 or FAT16 or ext3"
        exit 1
        ;;
  esac
fi

# time limited check
#/sbin/dosfsck -I -n -T 10 $PDEV
#if [ $? != 0 ]; then
#  logger "$0: $PDEV is corrupt, trying to mount it read-only"
#  mmc-mount $PDEV $MP ro $FSys
#  if [ $? = 0 ]; then
#    logger "$0: $PDEV mounted read-only"
#    exit 2
#  else
#    logger "$0: Couldn't mount $PDEV read-only"
#    exit 1
#  fi
#fi

#echo "mmc-mount $PDEV $MP rw $FSys"

mmc-mount $PDEV $MP rw $FSys
RC=$?
logger "$0: mounting $PDEV read-write to $MP, rc: $RC"
#echo $RC

if [ $RC = 0 ]; then
  # create some special directories for user's partition
  if [ "x$MP" = "x/home/user/MyDocs" -a -w $MP ]; then
    # use global folder names
    USERDIRS="/home/user/.config/user-dirs.dirs"
    if [ -f "$USERDIRS" ]; then
      HOME='/home/user'
      source "$USERDIRS"
      mkdir -p "$XDG_DOCUMENTS_DIR" 
      mkdir -p "$XDG_PICTURES_DIR"
      mkdir -p "$XDG_MUSIC_DIR"
      mkdir -p "$XDG_VIDEOS_DIR" 
      mkdir -p "$NOKIA_CAMERA_DIR"
      if [ "$FSys" = "ext3" ]; then
      	#chown -R user:users  "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR"
      	chown -R user:users "$MP"
      	chmod -R 774 "$XDG_DOCUMENTS_DIR" "$XDG_PICTURES_DIR" "$XDG_MUSIC_DIR" "$XDG_VIDEOS_DIR" "$NOKIA_CAMERA_DIR"   
      	chmod -R ug+rwX "$MP"   	
      fi
      
    else
      # fallback
      for d in .sounds .videos .documents .images .camera; do
        mkdir -p $MP/$d
      done
    fi
    touch $MP
  elif [ "x$MP" = "x/home/user/MyDocs" ]; then
    logger "$0: '$MP' is not writable"
  elif [ "x$MP" = "x/media/mmc1" -a -w $MP ]; then
    # use global folder names
    USERDIRS="/home/user/.config/user-dirs.dirs"
    if [ -f "$USERDIRS" ]; then
      HOME='/home/user'
      source "$USERDIRS"
      mkdir -p "$NOKIA_MMC_CAMERA_DIR"
      if [ "$FSys" = "ext3" ]; then
      	#chown -R user:users  "$NOKIA_MMC_CAMERA_DIR"
      	chown -R user:users "$MP"
      	chmod -R ug+rwX "$MP" 
      	chmod -R 774 "$NOKIA_MMC_CAMERA_DIR"      	
      fi
    fi
  elif [ "x$MP" = "x/media/mmc1" ]; then
    logger "$0: '$MP' is not writable"
  fi
fi

exit $(($RC != 0))
After this modification I have 2gb mounted /home (ext3) and 27gb on /home/user/MyDocs (ext3). Camera is working. When I connect device to computer (linux) /home/user/MyDocs unmounted (on n900) and exposed to notebook. For have possibility edit files on 27Gb partition on computer (linux, ubuntu) need execute (only once):
Code:
sudo addgroup --gid 29999 n900
sudo adduser YourUserName n900
After this you will be able to edit files on device. When you will disconnect device this partition will be remounted on" /home/user/MyDocs". Originally I had problem with files created on notebook. All this files had User and group from user and group on notebook. Now after mounting this partition back to n900 group and owner will be automatically changed to user:users (from n900).

EDIT: modified file "/usr/sbin/osso-mmc-mount.sh" (I didn't change now differences). In new file improved permissions changes for files. It is more comfortable for using with other linux computer. Before last modification some files was read only on computer because my script provide access to files by group (user on n900 and computer different). Now all files will have permissions: rwXrwXnnn (n-don't changed).

Additional information could be found in bug: https://bugs.maemo.org/show_bug.cgi?id=8179
If you would like to have this modification by default in new release you can vote for this bug

Last edited by mikhmv; 2010-01-20 at 15:20.
 

The Following 8 Users Say Thank You to mikhmv For This Useful Post:
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#134
Hmm so all it was is a stupid permissions error... gah... Time to remove MyDocs from the mount... I'll still keep it around somewhere else in case I need to share something with a win system.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
 
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#135
Gah... not even that... The camera app expects a volume... this is just anal.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
 
Posts: 451 | Thanked: 334 times | Joined on Sep 2009
#136
Where do you get that it needs a volume from?

Hmmm... so maybe, you're right. Removed the vfat partition completely, just made a MyDocs/DCIM subdir with the appropriate permissions in /home/user

The cam won't take pics there... WTF?

Ahhh, do I really have to have a volume mounted in MyDocs ? Why are the perms allowing read/write in MyDocs and DCIM not enough?

Last edited by 白い熊; 2010-01-24 at 16:01.
 
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#137
Originally Posted by 白い熊 View Post
Where do you get that it needs a volume from?
From testing it. I umounted MyDocs and camera refused to work without a volume. It clearly states it wants a volume to store images. And you can basically select 2 volumes... SD card or eMMC partition.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
 
Posts: 451 | Thanked: 334 times | Joined on Sep 2009
#138
Oh man, this really is an anal solution.

Created a tiny volume, mounted as ext3 in /home/user/MyDocs

It takes pics fine, duh...

How to get rid of this volume thingie?
 
Posts: 451 | Thanked: 334 times | Joined on Sep 2009
#139
Originally Posted by ruskie View Post
From testing it. I umounted MyDocs and camera refused to work without a volume. It clearly states it wants a volume to store images.
Yep, you're right...
Where's the conf for the camera that mandates this volume stuff though?
You'd think the proper directory structure would be enough... But no...
 
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#140
I'm assuming the camera app follows some digital camera specification that states that in needs to use a volume.

A simple solution would be: replace the camera app with an alt one.
__________________
For any repos or anything else I might have working on my N900 see:
http://wiki.maemo.org/User:Ruskie
A quick list of what I have in the repos
zsh|xmms2|fcron|gtar|gcoreutils
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:54.