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
#!/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++ }
#!/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
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:~$
#!/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))
sudo addgroup --gid 29999 n900 sudo adduser YourUserName n900