Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: jpakko on December 01, 2011, 01:20:20 AM

Title: foomatic-rip requires bash
Post by: jpakko on December 01, 2011, 01:20:20 AM
Installing a printer using cups and foomatic took me quite a while. The problem was that by default, foomatic-rip tries to use /usr/bash, and I hadn't installed bash. So foomatic didn't work. It seems to work with ash just fine, so I see two solutions:
1. Make foomatic-rip depend on bash.
2. Repackage foomatic-rip so that looks for /usr/ash instead of /usr/bash.

I prefer the latter.

I did this:
Create a file /usr/local/etc/foomatic/filter.conf that reads:
      preferred_shell: /bin/ash
Put "usr/local/etc/foomatic/filter.conf" in /opt/.filetool.lst

This works fine.
Title: Re: foomatic-rip requires bash
Post by: Juanito on December 01, 2011, 02:47:22 AM
the problem was that by default, foomatic-rip tries to use /usr/bash, and I hadn't installed bash. So foomatic didn't work.

Ah - that one had slipped by me - thanks

Could you check if it will work with /bin/sh - I don't have any printer hardware that requires foomatic-rip

In the meantime I'll modify the package to read:
Code: [Select]
$ cat /usr/local/etc/foomatic/filter.conf
...
preferred_shell: /bin/ash
Title: Re: foomatic-rip requires bash
Post by: jpakko on December 01, 2011, 08:45:04 PM
Yes, /bin/sh seems to work as well. Is sh different from ash? I see they're both symlinked to busybox.
Title: Re: foomatic-rip requires bash
Post by: maro on December 01, 2011, 10:44:53 PM
Well, '/bin/sh' and '/bin/ash' are AFAIK effectively identical applets provided by Busybox, BUT neither of them is a 'GNU bash' shell (but rather an Almquist shell (http://en.wikipedia.org/wiki/Ash_shell)).

OTOH fairly often when scripts are limiting themselves to not use "bashisms (http://en.wiktionary.org/wiki/bashism)" (but rather stick to "plain old Bourne shell" code) they can run in Core without requiring the 'bash.tcz' extension (by just changing the shebang entry from '/bin/bash' to '/bin'sh'). Hence the suggestion to just give it a try.