maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Newbie (https://talk.maemo.org/forumdisplay.php?f=26)
-   -   Hanful of linux-y n810 questions (https://talk.maemo.org/showthread.php?t=20761)

Pebby 2008-06-06 19:53

Hanful of linux-y n810 questions
 
Hey All,

I've been lurking here for a while and finally decided to get the n810 a week ago with developing some software in mind. I've been linux-ing for a little while and have become pretty familiar with getting what I need for my Debian/*buntu systems. Without the bounty of apt repositories, I'm definitely in the dark at times, though... so maybe you can help with a few questions, which may be really stupid:

1. Some people have referenced the 'broken' tar on our n810's that returns the 'broken tar magic' error message. Has anyone found a workaround for this, or is there a way to install a 'better' tar? (thread here: http://www.internettablettalk.com/forums/showthread.php?t=8751 )
2. Can the tablet read ext2/ext3 partitions on the removable memory card if I format them that way? Bonus question: I modified the mmc-mount script to not mount the card as 'noexec,' but I still cannot chmod files to be executable. Any ideas why?
3. Where is 'make?' I've added several repositories I found on the maemo site (maemo hackers, etc.), but I still cannot find a 'make.' The closest I found was 'cmake,' but I'm not sure that I need to cross-compile. ;)
4. As a general question, how horrible is it to just build code on the n810? I will probably go with scratchbox for speed reasons, but it'd seems useful to do it on the actual device when I'm ready, presuming it's not too slow.
5. I have the n810 working very nicely with my phone's GPRS connection over bluetooth, but I'd really like to 'hop off' when I get near a Wifi connection that I've used before. The n810 will do the opposite (when it loses wifi, it hops on to GPRS), but is there a simple way to make it do the former? Follow-up question: can scripts interface nicely with the connection manager, if I wanted to just write a simple wifi searching script to make it hop over that way?
6. Any recommendations for other file managers, or at least one that knows how to read from / instead of making me put files in silly predefined places?

I believe that's all for now. Thanks for all the great info on this board!

mudhoney 2008-06-06 20:19

Re: Hanful of linux-y n810 questions
 
2. - Yes, it can read/write ext2/ext3 filesystems. That's how I formatted my memory cards.

6. - The terminal. :P That's a good question though, I haven't run into any good alternative GUI file managers yet. I think there is a GPE one you might want to try.

josiahg777 2008-06-06 20:37

Re: Hanful of linux-y n810 questions
 
1) Tar works fine for me, the thread you referenced suggests using GNUtar or here's a link to the one I use which works perfectly for me: http://repository.maemo.org/pool/mae...osso_armel.deb
Also, you'll probably want to install bzip2, just run:
apt-get install bzip2

6) - EmelFM2 It's available from the garage I believe. There's a couple of tutorials on this forum

Hope this helps, I'm sorry I can't answer the other questions as I don't have any experience with coding on the device itself (except for Java, but I use the JXXX compiler service)

Benson 2008-06-06 21:08

Re: Hanful of linux-y n810 questions
 
If you want a development environment on the tablet, you'll need to add the maemo.org SDK repo; you can get make and a host of other stuff there. It's not entirely safe though, as it's only intended for use on scratchbox, and could conflict with important things on the tablet... use at your own risk. It works for me, though.

I use the shell for getting around the filesystem, mainly, but GPE filemanager is a nice basic one, and EmelFM2 is a big hairy graphical-shell approach, which I'm not persuaded is a wise choice, but is by all accounts good for that sort of thing...

Pebby 2008-06-06 21:35

Re: Hanful of linux-y n810 questions
 
Great, thanks for the helpful info! I'll read that the SDK repository was not for the tablet, but had no idea it would actually work on the device. Oh, beloved make, you are so close now. ;)

Yeah, I use the terminal for all my filesystem stuff too (and found a version of bash in one of the repositories, which is oh so nice), but I was just curious if there was anything around. XFE is my favorite for my desktop machines, but I think it's a little complicated for the tiny screen - I might try it out just for fun, though. I had tried EmelFM2 a while ago, I believe, and found it to be a little too awkward for my tastes - I'll give GPE a shot.

josiah: thanks for the deb link for tar, I don't know how I missed the comment about GNUtar in the thread.

stevecrye 2008-06-06 21:55

Re: Hanful of linux-y n810 questions
 
Hi Pebby;

Any progress on being able to chmod files on removable memory so that they are executable? I'm hoping to do that, without having to go through the pain of cloning the OS to boot from the removable memory.

Thanks,

Steve

Benson 2008-06-06 22:04

Re: Hanful of linux-y n810 questions
 
That's a filesystem issue; you'll need to use a UNIX-like filesystem (like ext2) instead of VFAT. One option is to use GeraldKo's cloning stuff, but only go partway; that's the easy way to get all the drivers, partitioning tools, etc. at once...

And thanks for bringing that up, Steve; I had missed the bonus question. You need to add a mode= option, I think, to make executable permissions on everything; because vfat doesn't have an execute bit, it's either all files, or no files.

Pebby 2008-06-06 22:33

Re: Hanful of linux-y n810 questions
 
Quote:

Originally Posted by Benson (Post 189447)
And thanks for bringing that up, Steve; I had missed the bonus question. You need to add a mode= option, I think, to make executable permissions on everything; because vfat doesn't have an execute bit, it's either all files, or no files.

Well, what's strange is that I tried adding an 'exec' to the list of mount options in mmc-mount script (and in /etc/fstab just for kicks), but it's still no-go. I will probably just format/mount it as ext2/3 to avoid the whole issue, but it's very weird since I can, for example, configure my eeePC's fstab to mount its SD card with full permissions for all. :confused:

Edit: BAM, got it. That tiny screen hid some more options in /usr/sbin/mmc-mount: just remove the lines regarding 'umask' and 'dmask' and you'll mount it will full (maybe too full) permissions. You're free to set umask/dmask to more sane values if you want too. :) Should we wiki-fi this information?

Pebby 2008-06-07 00:50

Re: Hanful of linux-y n810 questions
 
Quote:

Originally Posted by josiahg777 (Post 189421)
here's a link to the one I use which works perfectly for me: http://repository.maemo.org/pool/mae...osso_armel.deb

After wgetting and attempting to install the .deb through the package manager with the cryptic error 'tar failed to install' (gee, thanks), I tried doing it through dpkg --install at the command line. It tells me that it will conflict with 'busybox' and cannot be installed. As tempting as dpkg --remove busybox is, I'm thinking it's not a great idea.

josiah, how did you go about installing that .deb? I'll just install GNUtar as a backup plan, but I was curious how you managed to do it.

josiahg777 2008-06-07 01:11

Re: Hanful of linux-y n810 questions
 
Hmmm I seem to remember I just downloaded it and installed it from the app manager. Hang on real quick and I'll uninstall it and try to install it again :)

EDIT: Okay I see what I did now. I installed it while setting up KDE Boot From SD back when it was a manual process :P

Here's the directions I followed, copied from Pronuke's thisweekinnuclear site:

Download tar from the link I posted previously and save it to "Documents"
Then you can (as root):

# cd /home/user/MyDocs/.documents/
# mkdir /tar-temp/
# dpkg -x tar*.deb /tar-temp/

Once you've got the executable saved to /tar-temp/ you can do a

mv /tar-temp/tar /usr/bin/tar
or
cp /tar-temp/tar /usr/bin/tar

then
rm -r /tar-temp

Hope this helps! :)

Pebby 2008-06-07 03:04

Re: Hanful of linux-y n810 questions
 
Oh, duh - I should've just done that. ;) In any case, I went the long road. Here are the steps I undertook to get gnu tar, in case others have the same difficulties:
0. Download GNU tar from http://www.gnu.org/software/tar/#downloading
1. browsed the repos at http://repository.maemo.org/pool/chinook/ (adding the repository itself just made apt give me tons of errors) to find the .debs I needed to get a working gcc environment (I can list the .debs I used if anyone's interested, it's actually not too big when installed - maybe 25~35mb?)
2. Grabbed the 'make' from that same repository
3. Attempting to ./configure GNU-tar errored out on 'grep' (and, have you noticed how much our n810's 'grep' sucks? It literally doesn't even work as expected sometimes ;) ), so I got GNU-grep (also from gnu.org), ./configure'd and 'make'd it, then copied it to /usr/local/bin/
4. Successfully ./configure'd and 'make'd GNU-tar and copied that into /usr/local/bin/
5. Exit and re-enter the shell (why is this? 'which tar' shows the new one I'm pointing at - I shouldn't have to re-enter the shell, should I?)
6. SUCCESS! I can tar xzf my .tar.gz files on the N810!

Maybe that was ridiculously overdone, but, on the plus side, I got my gcc and make set up along the way ;) I also noted the tar I built is about 6x as big as the one in the .deb... I'm just going to assume that means it's 6 times better too :D Thanks for the assistance - I'll do my best to report my findings as well.

stevecrye 2008-06-07 23:55

Re: Hanful of linux-y n810 questions
 
Hi;

Benson,thanks for this tip:
Quote:

That's a filesystem issue; you'll need to use a UNIX-like filesystem (like ext2) instead of VFAT. One option is to use GeraldKo's cloning stuff, but only go partway; that's the easy way to get all the drivers, partitioning tools, etc. at once...
And thanks for being gentle - what was I thinking, trying to set *nix bits of a file on a non-*nix partition? (I'm a 'tard, again ...)

I've been reading that cloning thread, but it is at a high-altitude compared to my linux skills. I'd hate to screw up my N810 so early in the game.

This is not a big priority for me right now (I'm hot on the trail of my WPA problem) , but as I start to run out of memory on the internal card, it will be more urgent.

I know this is simplistic, but if I can somehow reformat the removable cart with ext2, and perhaps make some gentle changes in a config somewhere, can I then start to put bin files on the card and run then from there?

You mentioned "don't go all the way" ;) ... heh - that reminds me of back seat of my Camaro years ago. If I get the cloning stuff into the back seat, will I be able to easily stop? A bit more detail would be wonderful.

TIA as always,

Steve

josiahg777 2008-06-08 00:40

Re: Hanful of linux-y n810 questions
 
Quote:

I've been reading that cloning thread, but it is at a high-altitude compared to my linux skills. I'd hate to screw up my N810 so early in the game.
If you're worried about that, then Penguinbait put up a easy-install deb that will do the cloning for you :) It's over in this thread: http://www.internettablettalk.com/fo...ad.php?t=19639

or you can format a partition on your external card as ext2/ext3 and then symlink part of your internal filesystem to it. Which part this would be, I have no idea, although I did find this (old, it refers to the 770 but it should suit) wiki page:
http://maemo.org/community/wiki/Exte...ecbd162943b60e

I would recommend cloning to SD though, that's a lot easier and probably safer :)

PS: That wiki page is discussed here

Hope this helps! :)

Pebby 2008-06-08 01:14

Re: Hanful of linux-y n810 questions
 
Quote:

Originally Posted by stevecrye (Post 189684)
Hi;
I know this is simplistic, but if I can somehow reformat the removable cart with ext2, and perhaps make some gentle changes in a config somewhere, can I then start to put bin files on the card and run then from there?

Hey Steve... I posted in the thread back that you can (again, using the power of linux) mount the SD card with different permissions, effectively 'blanket-setting' those ext2-ey bits on any card you pop in.

In a terminal, do: vi /usr/sbin/mmc-mount (or however you like to edit text), then remove the comma-delimited settings in the mount line saying 'noexec' as well as the two settings regarding 'umask' and 'dmask'. This is safe because it falls back to default settings (full permission umask/dmask and 'exec' instead of 'noexec')

Try that if you're still unwilling to dive into the deep end ;)

Benson 2008-06-09 13:55

Re: Hanful of linux-y n810 questions
 
Quote:

Originally Posted by stevecrye (Post 189684)
Hi;

Benson,thanks for this tip:


And thanks for being gentle - what was I thinking, trying to set *nix bits of a file on a non-*nix partition? (I'm a 'tard, again ...)

I've been reading that cloning thread, but it is at a high-altitude compared to my linux skills. I'd hate to screw up my N810 so early in the game.

This is not a big priority for me right now (I'm hot on the trail of my WPA problem) , but as I start to run out of memory on the internal card, it will be more urgent.

I know this is simplistic, but if I can somehow reformat the removable cart with ext2, and perhaps make some gentle changes in a config somewhere, can I then start to put bin files on the card and run then from there?

You mentioned "don't go all the way" ;) ... heh - that reminds me of back seat of my Camaro years ago. If I get the cloning stuff into the back seat, will I be able to easily stop? A bit more detail would be wonderful.

TIA as always,

Steve

Absolutely; you can leave the card partitioned as-is, and do a mke2fs to "format" it ext2. Then you probably need to pull the "noexec" option out; that forbids executing things regardless, and is often set on removable media; maybe also "nosuid" if you need setuid things, etc.

As for the cloning stuff; I really don't remember the details of how much I used the scripts, but the benefit is you get gainroot, kernel modules, e2fstools, everything, all bundled up in one place; then you sort through and do exactly what you want with it. I knew what I wanted, so it worked out great ;). I think that running the main script with some numeric options is more or less right for putting a blank e2fs on, but I don't remember for sure. It's probably easier to run the stuff manually, anyway, if that's all you want.

stevecrye 2008-06-09 18:19

Re: Hanful of linux-y n810 questions
 
Ok; I'm standing on the diving board and looking down at the still, deep, blue, water...

From josiahg777:
Quote:

I would recommend cloning to SD though, that's a lot easier and probably safer
The clone thing seems really tempting. Questions: I get a 128 mb vfat, in addition to the ext2, so I can still connect to Windoze and copy files via USB? And, with the bootmenu, can I still boot to the original, internal partition (my life-preserver) ? While booted to the internal, will the n810 act the same way it does now - new apps get installed to the internal, etc. ? And conversely, while booted to the clone on the external card, will the N810 look and fell the same, but with more cool tools available, and new apps get installed to the external? (If the answer is yes to these, I think I'll go buy an 8 Gig card)

From Peeby:
Quote:

In a terminal, do: vi /usr/sbin/mmc-mount (or however you like to edit text), then remove the comma-delimited settings in the mount line saying 'noexec' as well as the two settings regarding 'umask' and 'dmask'. This is safe because it falls back to default settings (full permission umask/dmask and 'exec' instead of 'noexec')

Try that if you're still unwilling to dive into the deep end
This is really silly - will this work on the vfat filesystem, or will I need to do what Benson suggsted first:
Quote:

Absolutely; you can leave the card partitioned as-is, and do a mke2fs to "format" it ext2.
Thanks (as he takes deep breaths)

Steve

Benson 2008-06-09 19:30

Re: Hanful of linux-y n810 questions
 
Yes, what Pebby says to do works with FAT.

stevecrye 2008-06-09 21:34

Re: Hanful of linux-y n810 questions
 
OK;

I tried to follow Peeby's suggestions, but there was no umask parameter, only dmask=000. So, the only edits I did were to remove the noexec and the dmask.

Here's my results - the modified mmc-mount ( I saved a copy of the original), and the results after powering off/on the n810:

Quote:

Nokia-N810-51-3:/usr/sbin# cat mmc-mount
#!/bin/sh
#set -e
#dosfsck -n "$1" 2> /dev/null
mount -t vfat -o rw,noauto,nodev,nosuid,utf8,uid=29999,shortname=mi xed,fmask=0133 "$1" "$2" > /dev/null

Nokia-N810-51-3:/media/mmc1/Apps/nmap-4.50/bin# ls -l
-rw-r--r-- 1 user root 963095 Dec 21 02:25 nmap
Nokia-N810-51-3:/media/mmc1/Apps/nmap-4.50/bin# chmod 777 nmap
Nokia-N810-51-3:/media/mmc1/Apps/nmap-4.50/bin# ls -l
-rw-r--r-- 1 user root 963095 Dec 21 02:25 nmap
Nokia-N810-51-3:/media/mmc1/Apps/nmap-4.50/bin# ./nmap
-sh: ./nmap: Permission denied
Do I need to do something special to get it to mount after modifying the mmc-mount script? What about that fmask parameter?

I've also been a bit puzzled why my removable card is mmc1, and the internal card is mmc2.

BTW, the apparent space in "mix ed" is an artifact of the quote box in the forum.


Thanks,

Steve

Benson 2008-06-10 01:17

Re: Hanful of linux-y n810 questions
 
Well, try taking the fmask out... that'll fix it.

stevecrye 2008-06-10 02:37

Re: Hanful of linux-y n810 questions
 
Slowly this stuff is sinking into my impermiable skull...

Sucess after removing fmask!
Quote:

Nokia-N810-51-3:/media/mmc1/apps/nmap-4.50/bin# ls -l
-rwxr-xr-x 1 user root 963095 Dec 21 02:25 nmap
Nokia-N810-51-3:/media/mmc1/apps/nmap-4.50/bin# ./nmap -v -sS 192.168.100.1 > nmaptest
Nokia-N810-51-3:/media/mmc1/apps/nmap-4.50/bin# cat nmaptest

Starting Nmap 4.50 ( http://insecure.org ) at 2008-06-09 20:23 MDT
I
PORT STATE SERVICE
80/tcp open www
135/tcp filtered loc-srv
136/tcp filtered unknown
137/tcp filtered netbios-ns
138/tcp filtered netbios-dgm
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
Regarding running gui-apps as root;

I *think* it does not matter exactly how one assumes root - easyroot, sudo gainroot, ssh - the important tthing is that the application is launched as root:

Quote:

~ $ root
BusyBox v1.6.1 (2007-09-27 18:08:59 EEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
Nokia-N810-51-3:~# gconf-editor &
Nokia-N810-51-3:~# ps -ef | grep gconf
772 messagebus 3324 SW /usr/lib/gconf2/gconfd-2
1512 root 21596 SW gconf-editor
1514 root 1888 RW grep gconf
After launching it from the gui app-launcher:
Quote:

Nokia-N810-51-3:~#
Nokia-N810-51-3:~# ps -ef | grep gconf-editor
1546 user 21596 SW /usr/bin/gconf-editor
1550 root 1888 RW grep gconf-editor
Nokia-N810-51-3:~#
Question: is there something magical about gainroot, that easy root is lacking? I saw some highly technical posts where the different camps argued the merits, but for Steve The Newbie, is easyroot ok?

BTW, the odd problem with gconf-editor is the same when running it as root. Still have to cancel instead of ok at the second ok after changing a value.

Thanks,
Steve

Benson 2008-06-10 03:10

Re: Hanful of linux-y n810 questions
 
Well, gainroot is the standard way that Nokia provided. IMHO, that makes it better. But in the end, either works; it's just that scripts are more likely to use gainroot. (Fanoush's initfs_flasher and kernel_flasher, for example; if you have gainroot enabled (by installing becomeroot package, or by using flasher-3.0 to set RD mode), and start as user, it'll get root itself; if you don't have gainroot, you'll have to get root yourself, and then run the flasher...)

What easyroot provides that gainroot doesn't is some stuff related to environment, shell, etc. that may make it more comfortable... that's why it was created. (Oh, and it's less typing, but that's why we have alias...)

Bottom-line: Yeah, whatever floats your boat, that's what's cool. :cool:

sjgadsby 2008-06-10 03:30

Re: Hanful of linux-y n810 questions
 
Quote:

Originally Posted by stevecrye (Post 190184)
I've also been a bit puzzled why my removable card is mmc1, and the internal card is mmc2.

The first Nokia Internet Tablet, the 770, had only an external MultiMedia Card slot, named "mmc1". The N800 moved to SDHC and added an internal slot, but made it "mmc2" to maintain naming consistency for the external slot. The N810 just turned the N800's internal slot to internal fixed.

In short: hysterical raisins.


All times are GMT. The time now is 16:37.

vBulletin® Version 3.8.8