![]() |
#31 | |||||||
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Quote:
eg: Login, passwd, etc. won't work unless it's suid root. I'm not concerned -- I just didn't want to say "full" upgrade, when it didn't wipe absolutely everything out on the partition and replace it. Quote:
Pin assignments apparently can't be loaded as a kernel module; so basically Kobo was forced to compile the same kernel twice with different #defines for pin definitions. Quote:
Although, it's interesting to note that there are some code changes which look like bug fixes evident in the KoboAuraHD's version of the zforce-ir-touch driver, and in the epaper display driver (besides just macro definitions for the resolution change). The hardware interface on those devices is essentially the same, so that the code didn't really need to change beyond setting a different screen resolution; but I'm guessing that historically, the Glo is an older device than the AuraHD and the engineers realized there were minor hardware problems based on what I see in the driver code. I'm also noticing that the values sent to the Kobo Glo for frontlight illumination start much higher in the Glo than on the Aura. Considering it's the same MSP430 driving the frontlight, that makes me wonder if replacing the Glo's lighting table with the Aura's would allow me to dim the screen more. ![]() Overall, it doesn't really look like KOBO has updated the kernels since the devices were released ; It's more of a test, once it's working and in production -- keep it that way.... Quote:
Quote:
Quote:
![]() Quote:
Is there no way to rename a directory after the fact, or show a history of what it was named (in the past) by clicking it somehow, or add a symlink directory once management had come up with a name for what engineering did, and decided to sell it on the market? I know second guessing management is impossible, but once they committed....! ![]() I don't expect to change Kobo's middle of the road programming approach ; I'm just curious about the git interface as I'm not doing very well with it in the school of hard knocks. So I want to be sure and jsay ![]() ![]() |
|||||||
![]() |
![]() |
![]() |
#32 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Are you sure about that? A test that some users did for me suggested that pickel changes the rotation only on Glo HD. Nickel however changes the rotation on all models except Touch, Mini and Glo. (On Glo HD, nickel seems to change the rotation only, if pickel has not already done so. I am not sure about that.) I guess your results differ because you start testing after nickel has already changed the rotation.
Last edited by tshering; 07-02-2015 at 04:06 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
Sample program:
Code:
int query_rotate() { int r; FILE * f = fopen("/sys/class/graphics/fb0/rotate", "r"); r = fgetc(f)-'0'; fclose(f); return r; } for(i=5; i--; ) { ioctl(fb0, FBIOGET_VSCREENINFO, &screen); printf("FBIOGET_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); printf("FBIOPUT_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); } Session on the H2O: Code:
# reboot to get clean initial state ... # ./flipper FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # ./flipper FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOGET_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOGET_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) As a result, if you use FBIOPUT_VSCREENINFO, you have to use it twice in order to make sure the rotation is what you intended. Code:
for(i=5; i--; ) { ioctl(fb0, FBIOGET_VSCREENINFO, &screen); printf("FBIOGET_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); printf("FBIOPUT_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); // doubled the FBIOPUT ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); printf("FBIOPUT_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); } Code:
# reboot ... # ./doubleflipper FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # ./doubleflipper FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 3 (3) FBIOPUT_VSCREENINFO 1 (1) That's not what pickel does, however. It calls get twice, put once. Code:
ioctl(3, FBIOGET_VSCREENINFO, 0x7efb9820) = 0 ioctl(3, FBIOPUT_VSCREENINFO, 0x7efb9820) = 0 ioctl(3, FBIOGET_VSCREENINFO, 0x7efb9820) = 0 Code:
# reboot ... # ./doubleflipper FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) # /usr/local/Kobo/pickel showpic < /dev/urandom # ./doubleflipper FBIOGET_VSCREENINFO 2 (2) FBIOPUT_VSCREENINFO 0 (0) FBIOPUT_VSCREENINFO 2 (2) Since pickel is used during boot already, it's unclear to me how nickel afterwards starts out in a "clean" state and how using pickel again makes it start flipping using just FBIOGET/PUT when my own program using the same syscalls does not have the same effect. It probably puts something into the vscreeninfo struct, but what? Or it just can handle either case on its own? What am I missing? EDIT: What I'm missing of course, is that pickel itself flips the rotation. Code:
for(i=5; i--; ) { ioctl(fb0, FBIOGET_VSCREENINFO, &screen); printf("FBIOGET_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); screen.rotate^=0x2; // flip ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); printf("FBIOPUT_VSCREENINFO %d (%d)\n", screen.rotate, query_rotate()); } Code:
# reboot ... # ./pngshow maze.png FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate # ./pngshow maze.png FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) FBIOGET_VSCREENINFO 1 (1) FBIOPUT_VSCREENINFO 1 (1) This thing is giving me headaches. Edit: I ended up with this framebuffer rotation hack for now: Code:
// get rotation ioctl(fb0, FBIOGET_VSCREENINFO, &screen); // remember rotation rotate = screen.rotate; // flip rotation screen.rotate ^= 0x2; // put rotation: some devices flip on put, some don't ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); // check if it did not flip if(rotate != screen.rotate) { // restore original rotation screen.rotate = rotate; // put original rotation ioctl(fb0, FBIOPUT_VSCREENINFO, &screen); // flip rotation screen.rotate ^= 0x2; } // now screen.rotate means the same thing on all devices // regardless whether they flip or not Last edited by frostschutz; 07-02-2015 at 07:59 AM. |
![]() |
![]() |
![]() |
#34 | |||||||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
![]() Quote:
|
|||||||
![]() |
![]() |
![]() |
#35 |
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
It does change permissions and ownerships of the files according to what's in the tar. Technically all tar should have root as owner and group but so far I've been too lazy to add the necessary --owner --group options to tar.
In practice it makes no difference. Everything on the Kobo runs as root anyway, and root does not care about wrong owners. So the only thing that really matters is the executable flag needed for binaries/scripts. Of course, if you DO set the suid flag and the owner is wrong, then it really bites you as suddenly you execute stuff as nobody instead of root. Here suid causes problems instead of solving them. suid on busybox is a bad idea. It would suid _everything_, not just passwd. So nobodies can overwrite files etc. etc. etc. EDIT: I was wrong about busybox+suid, apparently busybox can handle it. Thanks @fastrobot for pointing that out to me ![]() Last edited by frostschutz; 07-03-2015 at 06:57 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#36 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#37 | ||
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Quote:
I just compiled my dummy keyboard kernel module against the kernel in the repository labeled "Kobo Glo", and it gave me the exact same md5 sum as when I compiled it against the kernel for the KoboAuraHD. So it's not a problem with how I compiled it -- and therefore a hack like you are describing is exactly the kind of thing I'm needing to find. ![]() Found it...: Quote:
![]() So -- Tschering's solution -- prevent-freeze is just a script which never enters blocking mode for more than one second. I see, that means the linux kernel is constantly being woken up and should never 'decide' that it is totally idle because all processes have entered blocking mode for a long time. That's easy enough to try by running the script in the background, and seems likely to solve the problem in a roundabout way. I'll go over and see my kids later today, and check if it works for them. If it does, then I can move on to the next stage -- compiling frobtads, and zork, and hithikers guide to the galaxy eg: interactive fiction (choose your own ending book) games to run on the kobo. Thank you very much! ![]() Last edited by fastrobot; 07-02-2015 at 02:09 PM. |
||
![]() |
![]() |
![]() |
#38 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,466
Karma: 6900052
Join Date: Dec 2009
Location: The Heart of Texas
Device: Boox Note2, AuraHD, PDA,
|
Quote:
Luck; Ken |
|
![]() |
![]() |
![]() |
#39 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Quote:
![]() Doh! I just got Frobtads and Frotz working before I saw that. But Thanks. I have a vitual terminal now, runing ncurses. So Frotz ran perfectly on the first try. I simply downloaded the source code, compiled it with kobo's arm GCC, linked against my libraries; and installed it on an external SD card. Walah, instant play. My terminal has a vitual morse code keyboard; so I just use tap out international morse code on the screen, and the letters magically appear about as fast as I can peck... The only requirement (beyond having a terminal program) was to set up busybox to allow it to run as a regular user rather than superuser. Frotz won't run in superuser mode. Let the Zork sword glow again... ![]() I am curious, though; there's a QT based interactive fiction game engine called QTads, and also that engine comes with a web server version since 3.1. SInce the Kobo natively runs QT anyway, and also has a web browser, I would have thought that was an ideal fit. Has anyone ported QTads to KOBO yet? |
|
![]() |
![]() |
![]() |
#40 | ||
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Quote:
![]() I don't even want to know the conversations that must have gone on behind the scenes the accept a kernel driver that did this in the first place and make pickel and nickel work around it rather than make a simple driver with highly predictable results. What a waste of CPU power... reinitializing chips repetitively....because of redundant variables.... Quote:
The race conditions are the main problem. In my own code (not shown), nickel and pickel are actually -SIGSTOPped, and the dummy zforce-ir-touch driver is disconnected by the virtual keyboard emulator; So it's not accumulating buffer data and clogging up. So thats how I avoid race conditions as much as possible. When I restore the buffer, I send nickel and hindenburg -SIGCONT. So I could actually use your "write twice" solution without fear of race conditions with nickel, and I could add pickel to my killall list for extra security. I probably ought to look up linux signal processing to make sure there's no race conditions possible, but in practice it's not been a problem. Even if it sits idle for a long time, nothing happens until -SIGCONT, and then the system immediately goes to sleep. So unless it's coincidence, I think other signals / messages might queue up. But Nickel appears to continue to run stably as far as I can tell. [ Note, the Glo Freezeup is happening when Nickel is running, so don't jump to wrong conclusions. And I have finally got an inkling of an idea of what might have caused it... and it has nothing to do with the code in this thread. ![]() I don't see why you couldn't do the same thing, for if you are only writing to the buffer for a brief period of time; Your doing a brief -SIGSTOP is not likely to bother nickel or pickel's activities nearly as much as my long term interruptions do. Of course, writing to the same screen that nickel is using is risky in it's own right, because there's nothing stopping nickel from reading that data and wanting to use it again -- assuming that the images it wrote there earlier are still valid. Not that I fully understand what you are doing, but it sounds riskier than what I want to do which is a total save, disable nickel and hindenburg, allow another application to run for a while, and then do a total restore and re-enable of nickel and hindenburg. eg: I'm wanting to do the same as classic job control for a terminal, to allow two or more processes to share a screen. Each application has it's own rotation, which may be the same or different. I just want to remember it during the save and restore operations, because the screen is not symmetrical and so rotating data already on a screen on the fly is impractical. It would change the drawings scale factor.... Three ideas come to mind from your analysis: 1) Nickel and Pickel already expect the weird behavior, so fixing the driver (assuming the behavior actually is broken) may not be an option as that could break Nickel and Pickel. 2) Pickel reads the buffer twice in a row before writing once; That's normally a useless operation unless the data in some variable changes from one read to the next. So pickel might be detecting a buffer rotation mode by comparing a variable we're not inspecting, and deciding to flip based on that. You might want to do a memcpy, and memcmp from one read to the next, and not read the /sys directory at the same time, to see if any variable changed during double reads. (It could also be stupid code.) 3) The actual "pseudo-random" flipping of the screen appears to be happening during the write operation, and in the write code of the kernel driver; because it's actually modifying the data structure of the write ioctl. So -- that narrows down the portion of the driver code to look at, and hope against hope there are some comments in the source code that make sense out of this unexpected extra rotation activity... Last edited by fastrobot; 07-03-2015 at 02:00 AM. |
||
![]() |
![]() |
![]() |
#41 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Now that I'm thinking about it....
I don't recall seeing a setting that allows me to rotate my book sideways, and read it in landscape mode rather than in portrait mode on the KoboAuraHD. Is there a setting for that? and where is it? (I have a manual, but it would take hours to find it....) ![]() |
![]() |
![]() |
![]() |
#42 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Don't bother looking in the manual, there isn't an option. You can rotate PDF and images, but not epub or kepub.
|
![]() |
![]() |
![]() |
#43 | |||
Linux User
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,282
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
Quote:
Quote:
Quote:
That way you can do full screen drawing without having to worry about restore. And you can also do partial screen drawing like a popup window or just adding a clock in a screen corner or things like that. |
|||
![]() |
![]() |
![]() |
#44 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#45 | ||
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 53
Karma: 11844
Join Date: Jun 2014
Location: All over the place...
Device: KOBO AuraHD and GLO
|
Quote:
But yes, if you don't make it suid root, then it suddenly causes problems instead of solving them. That's why I made it suid root: chown root:root /bin/busybox chmod +s /bin/busybox It is in fact bizarre that kobo readers have several files which belong to a user id number which is not even in the /etc/passwd file, eg: essentially nobodies rather than root. Quote:
![]() Right now the kobo runs all software as root, as you yourself note. So, If I just hand my kids the vt52 terminal directly after a framebuffer switch to the virtual terminal (the whole purpose of this thread ![]() On the other hand, if I use a special command I created, eg: session to log them in as a non root user without busybox; I can't possibly get back to being root user from the terminal or do sudo commands to start wifi, etc. with -- Unless I can login as root from a non-root account. But logging in as root requires busybox to be suid root. It's messy, but in order to flexibly hack on the system without risking too much damage to the Kobo I really needed the ability to login as root (run su from non-root terminal) and log back out again to plain user, and have directories that are relatively safe for experimentation. So: I partitioned an external SD card into three parts using fdisk. Partition one is an of type 0x0b, msdos vfat. It's a mere 2 megabytes, and contains only an autorun.sh script, and a handful of binaries that are nearly always in use -- such as bash, vt52u (the terminal), the morse code virtual keyboard driver. etc. Highly used and high risk scripts. eg: Things that I don't want to have to 'kill' in order to unmount a partition, or remount it as readonly. This has two desired effects, the Kobo sees an msdos partition and so nickel/hindenburg doesn't complain continually about the sd card being unreadable and needing to be formatted. And it gives me a place to put executables which the kobo will auto-mount read-only root ownership for booting my auxilliary system. But because msdos does not support unix permissions, like suid, without globally setting them for all files as part of the mountpoint permssions -- I made two other partitions. The second partition is another msdos partion (type 0x0b) called 'home', which is the default login directory for a non-super user account that I add to the kobo. It is again resistant to corruption due to msdos's nature under hardware resets, so is a good place to put experimental files and game save files. I made it a partition, rather than a subdirectory in the first partition -- because vfat doesn't support unix ownership and I don't want to fight kobo's default actions in mounting /mnt/sd. So: The first partition the Kobo mounts however it wants, (superuser ownership readonly), but the second partion mounts rw and is owned by user 'home'. (I made its mount point /mnt/home). And of course, the third partition I created is a ext2fs partition (type 0x83); I call it user, and I made it ext2 because that's the only generic unix fs that the kobo supports natively. And I mount that partition read only on a directory I create called /mnt/user. If I need to edit files on the user partition, I mount it rw, make the changes, and then remount it read only. Since my sysadmin tools run from the first dos partition -- this means I can either unmount or remount user as rw, without worrying about the partition being 'busy' on a perpetual basis. All programs on that partition can be terminated without killing my user terminal or admin programs. So I put binaries like python-2.7.10, frotz, frobtads,sorry,battleship, etc. in that third partition. And remount it readonly before trying to execute them -- so if the system crashes, and is rebooted, I don't have a corrupted ext2fs filesystem on my hands without an ext2fsck program available.... As a note for you: Busybox itself allows choosing which programs run with suid permissions and which ones don't when it's owned by root. (By default busybox exits suid root before running it's internal applets unless instructed not to -- even if the suid bit is set on busybox as far as I know -- but I'm no expert...). There is is a configuration file that you can add in /etc which will tell busybox when to reset the suid permission to a the originating uid (non superuser id) and when not to reset it -- all you need to do is create an extra configuration file in /etc called (drumroll) busybox.conf Mine is like this: Code:
[SUID] su = ssx root.root login = ssx root.root chown root:root /etc/busybox.conf chmod 600 /etc/busybox.conf That's it -- the Kobo is happy to oblige multi users with those changes, and will only allow two busybox programs to run setuser id -- the rest must run as the id of the person calling busybox. I thought about not making the kobo's busybox suid, and instead putting a copy busybox on a mounted external filesystem, but having two copies of busybox sort of defeats the memory management benefits of having all tools in a single image; for linux can share code memory images among many different instances of runnning busybox commands if it comes from the same file -- but not if from multiple files. Hardlinks, unfortuantely, don't support different permissions on linux; so we can't make busybox suid under one name, and not suid under another. Softlinks don't allow suid changes either. (By the way, I just partially bricked my reader experimenting with that again and I even knew better! --- *sigh* time to drag out the sd card reader again or do factory reset ... ![]() And although I can make the group permission sgid on busybox, but leave the owner permission as non-suid; I don't see how that would help. For I am not sure how a non-root user to could change to a new group without having an suid busybox in the first place. It's sort of crazy that kobo has a busybox that is default user:group 501:1000 , which are not defined anywhere in /etc. Sloppy programming. But that's the way it is. So -- the only alternative to changing the mode of busybox to suid root, that I see -- it to create a standalone setiud root program on my third partition, eg: a sudo program that is not part of busybox. I'm pretty happy with the way busybox works when suid root is set for allowing a 'regular' user account, so I think I'm going to just keep using it; but the kobo does have one really irritating security feature which I think might be part of busybox, for it refuses to export LD_LIBRARY_PATH during the 'env' command execution, so that a user who wishes to make an autorun python script in the 'home' partition can't put '#!/user/bin/env python' at the start of the python script, because the kobo's version of ENV erases the system variable called LD_LIBRARY_PATH. That prevents security breaches by replacing shared libraries with hacked ones, but it also prevents me from running pyhon in an autoscript as a regular user. I suppose I could do "#!/usr/bin/env LD_LIBRARY_PATH=/mnt/user/lib python" as the first line, but it seems that there ought to be a better way to do it that is less system dependent... ![]() EDIT: Nope, even that solution causes the program to hang totally. Apparently env can't handle people setting environment variables as part of a script start execution... It works from the command line, but not as a script auto-start command. EDIT: OOOOOH! ![]() Almost every unix out there puts a shell of some kind on /bin/sh. The system shell.... Busybox is no exception: SO, watch this shell game -played over telnet exclusively on the AuraHD -- closely ---: Code:
~ # echo $LD_LIBRARY_PATH /mnt/user/lib ~ # export LD_LIBARY_PATH="/mnt/user/lib" ~ # login home Password: [home@AndrewsKoboHD ~]$ echo $LD_LIBRARY_PATH /mnt/user/lib [home@AndrewsKoboHD ~]$ export LD_LIBRARY_PATH="/mnt/user/lib" [home@AndrewsKoboHD ~]$ /bin/sh -c "python" python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory [home@AndrewsKoboHD ~]$ /bin/sh -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH python" Python 2.7.10 (default, Jun 30 2015, 20:30:05) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> ![]() Code:
~ # login AndrewsKoboHD login: home Password: [home@AndrewsKoboHD ~]$ echo $LD_LIBRARY_PATH /mnt/user/lib [home@AndrewsKoboHD ~]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH [home@AndrewsKoboHD ~]$ sh [home@AndrewsKoboHD ~]$ echo $LD_LIBARY_PATH [home@AndrewsKoboHD ~]$ [home@AndrewsKoboHD ~]$ exit [home@AndrewsKoboHD ~]$ echo $LD_LIBRARY_PATH /mnt/user/lib [home@AndrewsKoboHD ~]$ export quote="YES" [home@AndrewsKoboHD ~]$ bash [home@AndrewsKoboHD ~]$ echo $quote YES [home@AndrewsKoboHD ~]$ exit [home@AndrewsKoboHD ~]$ exit ~ # echo $LD_LIBRARY_PATH /mnt/user/lib ~ # export quote="yup" ~ # sh ~ # echo $quote yup ~ # bash bash-4.3# echo $quote yup bash-4.3# sh ~ #echo $quote yup ![]() Last edited by fastrobot; 07-06-2015 at 11:15 PM. Reason: GPL source code distribution issues... fixed. |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Worth switching over from Kobo? | Krytes | Which one should I buy? | 5 | 02-24-2013 12:04 AM |
Switching from Sony to Kobo Glo? | obyrm | Kobo Reader | 32 | 09-11-2012 04:41 PM |
Thinking of switching from Kobo to Kindle | ficbot | Amazon Kindle | 4 | 04-23-2011 02:15 AM |
Switching to Kobo? | quintanion | Kobo Reader | 12 | 03-15-2011 06:42 PM |
Major Kobo book switching issue | MrsJoseph | Kobo Reader | 6 | 03-09-2011 11:57 PM |