Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Can I install CPAN itself on busybox?

by cnd (Acolyte)
on Jul 09, 2017 at 19:43 UTC ( #1194631=note: print w/replies, xml ) Need Help??


in reply to Re: Can I install CPAN itself on busybox?
in thread Can I install CPAN itself on busybox?

it starts with "use strict", which of course will lead to the same problem...

I've gotten closer to my goal though:

vi /etc/opkg/distfeeds.conf #remove the comments opkg update opkg upgrade perl opkg install perlbase-cpan
which now gives this
root@Omega-C50F:/usr/lib/perl5/5.22# perl -MCPAN -e shell Can't locate ExtUtils/MakeMaker/version/vpp.pm in @INC (you may need t +o install the ExtUtils::MakeMaker::version::vpp module) (@INC contain +s: /usr/lib/perl5/5.24 /usr/lib/perl5/5.22) at (eval 6) line 2. BEGIN failed--compilation aborted at (eval 6) line 2. Compilation failed in require at /usr/lib/perl5/5.24/ExtUtils/MakeMake +r.pm line 9. BEGIN failed--compilation aborted at /usr/lib/perl5/5.24/ExtUtils/Make +Maker.pm line 9. Compilation failed in require at /usr/lib/perl5/5.24/CPAN.pm line 43. BEGIN failed--compilation aborted at /usr/lib/perl5/5.24/CPAN.pm line +43. Compilation failed in require. BEGIN failed--compilation aborted. root@Omega-C50F:/usr/lib/perl5/5.22#
so I will have another go with makemaker after all...

Replies are listed 'Best First'.
Re^3: Can I install CPAN itself on busybox?
by marto (Cardinal) on Jul 09, 2017 at 19:57 UTC

    strict has been core since perl5 was released. It muddies the waters when distros do things like this.

      ++

      When an OS removes exceptionally critical core pieces of any software whatsoever, it's time to find a new OS.

      strict is the most important and widely used core piece of Perl that exists (imho). Who in their right mind...

      Without strict, you'd be hard pressed to install anything. (Anything worth installing anyhow)

      update: There are exceptions to that, such as installing where the author knew why and how things such as strict can be removed as a requirement.

      Yes, but it happens. I don't know why. At work, I'm haunted by a customized version of Yocto, and boy does it suck. Not only that perl is severely crippled and misconfigured:

      root@XXX:~# perl -v This is perl 5, version 14, subversion 3 (v5.14.3) built for arm-linux +-gnueabi Copyright 1987-2012, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. root@XXX:~# perl -E 1 Can't locate feature.pm in @INC (@INC contains: /etc/perl /usr/lib/per +l/site_perl/5.14.3/ /usr/lib/perl/site_perl/5.14.3 /usr/lib/perl/vend +or_perl/5.14.3/ /usr/lib/perl/vendor_perl/5.14.3 /usr/lib/perl/5.14.3 +/ /usr/lib/perl/5.14.3 /usr/local/lib/site_perl /usr/lib/perl/5.14.3 +.). BEGIN failed--compilation aborted. root@XXX:~# perl -e 'system "ls","-R",$_ for @INC' ls: cannot access /etc/perl: No such file or directory ls: cannot access /usr/lib/perl/site_perl/5.14.3/: No such file or dir +ectory ls: cannot access /usr/lib/perl/site_perl/5.14.3: No such file or dire +ctory ls: cannot access /usr/lib/perl/vendor_perl/5.14.3/: No such file or d +irectory ls: cannot access /usr/lib/perl/vendor_perl/5.14.3: No such file or di +rectory /usr/lib/perl/5.14.3/: Config.pm Config_heavy-target.pl Config_heavy.pl strict.pm vars.pm + warnings warnings.pm /usr/lib/perl/5.14.3/warnings: register.pm /usr/lib/perl/5.14.3: Config.pm Config_heavy-target.pl Config_heavy.pl strict.pm vars.pm + warnings warnings.pm /usr/lib/perl/5.14.3/warnings: register.pm ls: cannot access /usr/local/lib/site_perl: No such file or directory /usr/lib/perl/5.14.3: Config.pm Config_heavy-target.pl Config_heavy.pl strict.pm vars.pm + warnings warnings.pm /usr/lib/perl/5.14.3/warnings: register.pm .: root@XXX:~#

      Yes, there almost NO modules. And yes, perl -E crashes due to a missing feature module. So why do they include perl at all?

      root@XXX:~# file /bin/* /usr/bin/* /usr/local/bin/* | grep -i perl /usr/bin/xxxmon: Perl script, ASCII text exec +utable /usr/bin/decode-yyy: Perl script, UTF-8 Unicode tex +t executable /usr/bin/decode-zzz: Perl script, ASCII text execu +table /usr/bin/mtrace: Perl script, ASCII text exec +utable /usr/bin/perl: symbolic link to `perl5.14.3 +' /usr/bin/perl5.14.3: ELF 32-bit LSB executable, A +RM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), fo +r GNU/Linux 2.6.16, BuildID[sha1]=XXXXXXXXXXXXXXXXXXX, stripped /usr/bin/smime: Perl script, ASCII text exec +utable root@XXX:~#

      Maybe those scripts do work without most of the core modules? Some kind of miniperl?

      root@XXX:~# decode-yyy Can't locate POSIX.pm in @INC (@INC contains: /etc/perl /usr/lib/perl/ +site_perl/5.14.3/ /usr/lib/perl/site_perl/5.14.3 /usr/lib/perl/vendor +_perl/5.14.3/ /usr/lib/perl/vendor_perl/5.14.3 /usr/lib/perl/5.14.3/ +/usr/lib/perl/5.14.3 /usr/local/lib/site_perl /usr/lib/perl/5.14.3 .) + at /usr/bin/decode-yyy line 41. BEGIN failed--compilation aborted at /usr/bin/decode-yyy line 41. root@XXX:~# decode-zzz Can't locate Fcntl.pm in @INC (@INC contains: /etc/perl /usr/lib/perl/ +site_perl/5.14.3/ /usr/lib/perl/site_perl/5.14.3 /usr/lib/perl/vendor +_perl/5.14.3/ /usr/lib/perl/vendor_perl/5.14.3 /usr/lib/perl/5.14.3/ +/usr/lib/perl/5.14.3 /usr/local/lib/site_perl /usr/lib/perl/5.14.3 .) + at /usr/bin/decode-zzz line 52. BEGIN failed--compilation aborted at /usr/bin/decode-zzz line 52. root@XXX:~# xxxmon Can't locate Fcntl.pm in @INC (@INC contains: /etc/perl /usr/lib/perl/ +site_perl/5.14.3/ /usr/lib/perl/site_perl/5.14.3 /usr/lib/perl/vendor +_perl/5.14.3/ /usr/lib/perl/vendor_perl/5.14.3 /usr/lib/perl/5.14.3/ +/usr/lib/perl/5.14.3 /usr/local/lib/site_perl /usr/lib/perl/5.14.3 .) + at /usr/bin/xxxmon line 48. BEGIN failed--compilation aborted at /usr/bin/xxxmon line 48. root@XXX:~# smime Can't locate Getopt/Std.pm in @INC (@INC contains: /etc/perl /usr/lib/ +perl/site_perl/5.14.3/ /usr/lib/perl/site_perl/5.14.3 /usr/lib/perl/v +endor_perl/5.14.3/ /usr/lib/perl/vendor_perl/5.14.3 /usr/lib/perl/5.1 +4.3/ /usr/lib/perl/5.14.3 /usr/local/lib/site_perl /usr/lib/perl/5.14 +.3 .) at /usr/bin/smime line 11. BEGIN failed--compilation aborted at /usr/bin/smime line 11. root@XXX:~#

      Yepp, those scripts that came with the distribution simply can't work. By their name, some actually are relevant for the hardware this system runs on. Luckily, this does not affect the system we use.

      So, why is perl included? My guess is that the *BEEEP* Yocto build system has detected that that those few scripts need perl, so it installed a bare minimum perl. I guess it does not analyse what modules those scripts need, so it does not install the packages that contain the required (core and non-core) modules.

      The other nasty error that will bite us sooner or later: Timezone information is messed up, wastes space and makes any attempt at smart prompting futile. This is ls -FR /usr/share/zoneinfo on a sane system (actually, Ubuntu 14):

      ls -R /usr/share/zoneinfo/ /usr/share/zoneinfo/: Africa/ Australia/ Cuba Etc/ GMT0@ Iceland J +apan Mexico/ Pacific/ PST8PDT Turkey W-SU America/ Brazil/ EET Europe/ GMT-0@ Indian/ K +wajalein MST Poland right/ UCT zone.ta +b Antarctica/ Canada/ Egypt Factory GMT+0 Iran l +eap-seconds.list MST7MDT Portugal ROC Universal@ Zulu Arctic/ CET Eire GB Greenwich@ iso3166.tab L +ibya Navajo posix/ ROK US/ Asia/ Chile/ EST GB-Eire@ Hongkong Israel l +ocaltime@ NZ posixrules Singapore UTC@ Atlantic/ CST6CDT EST5EDT GMT@ HST Jamaica M +ET NZ-CHAT PRC SystemV/ WET /usr/share/zoneinfo/Africa: Abidjan@ Asmera@ Blantyre@ Ceuta Douala@ Johann +esburg@ Kinshasa@ Lubumbashi@ Mbabane Niamey@ Timbuktu@ Accra Bamako@ Brazzaville@ Conakry@ El_Aaiun Juba + Lagos@ Lusaka Mogadishu@ Nouakchott@ Tripoli@ Addis_Ababa@ Bangui@ Bujumbura@ Dakar@ Freetown@ Kampal +a Libreville Malabo@ Monrovia Ouagadougou@ Tunis Algiers Banjul@ Cairo@ Dar_es_Salaam@ Gaborone@ Kharto +um@ Lome@ Maputo@ Nairobi@ Porto-Novo@ Windhoek Asmara@ Bissau Casablanca Djibouti@ Harare@ Kigali +@ Luanda@ Maseru@ Ndjamena Sao_Tome@ ... /usr/share/zoneinfo/Etc: GMT@ GMT-0@ GMT-1 GMT-10 GMT-11 GMT-12 GMT-13 GMT-2 GMT-3 GM +T-4 GMT-5 GMT-6 GMT-7 GMT-8 GMT-9 Greenwich@ Universal@ Zulu@ GMT0@ GMT+0@ GMT+1 GMT+10 GMT+11 GMT+12 GMT-14 GMT+2 GMT+3 GM +T+4 GMT+5 GMT+6 GMT+7 GMT+8 GMT+9 UCT@ UTC@ /usr/share/zoneinfo/Europe: Amsterdam Belgrade@ Budapest Gibraltar Jersey@ Ljubljan +a Mariehamn@ Oslo@ Rome Simferopol Tirane Vatic +an@ Zagreb@ Andorra Berlin Busingen@ Guernsey@ Kaliningrad London@ + Minsk Paris Samara Skopje@ Tiraspol@ Vienn +a Zaporozhye Astrakhan Bratislava Chisinau Helsinki Kiev Luxembou +rg Monaco Podgorica@ San_Marino@ Sofia Ulyanovsk Vilni +us Zurich@ Athens Brussels Copenhagen Isle_of_Man@ Kirov Madrid + Moscow@ Prague@ Sarajevo@ Stockholm Uzhgorod Volgo +grad Belfast@ Bucharest Dublin@ Istanbul@ Lisbon@ Malta + Nicosia@ Riga Saratov Tallinn Vaduz Warsa +w@ ... /usr/share/zoneinfo/US: Alaska@ Aleutian@ Arizona@ Central@ Eastern@ East-Indiana@ Hawai +i@ Indiana-Starke@ Michigan@ Mountain@ Pacific@ Pacific-New@ Sa +moa@

      Lots of regions omitted, but you get the idea. Almost all data is available via a single, canonical name and a ton of symlinks (indicated by a trailing "@" due to ls) linking to the canonical name.

      And here is the same command on that Yocto-based system:

      root@XXX:~# ls -FR /usr/share/zoneinfo/ /usr/share/zoneinfo/: Africa/ EET GMT MET PST8PDT Universal America/ EST GMT+0 MST Pacific/ W-SU Asia/ EST5EDT GMT-0 MST7MDT ROC WET Australia/ Etc/ GMT0 NZ ROK Zulu CET Europe/ Greenwich NZ-CHAT UCT iso3166.tab CST6CDT GB HST PRC UTC zone.tab /usr/share/zoneinfo/Africa: Cairo /usr/share/zoneinfo/America: Anchorage Caracas Chicago Denver Los_Angeles New_York Sao_Paulo /usr/share/zoneinfo/Asia: Dhaka Dubai Hong_Kong Karachi Tokyo /usr/share/zoneinfo/Australia: Adelaide Brisbane Darwin Sydney /usr/share/zoneinfo/Etc: GMT GMT+11 GMT+4 GMT+8 GMT-10 GMT-14 GMT-5 GMT-9 UTC GMT+0 GMT+12 GMT+5 GMT+9 GMT-11 GMT-2 GMT-6 GMT0 Univer +sal GMT+1 GMT+2 GMT+6 GMT-0 GMT-12 GMT-3 GMT-7 Greenwich Zulu GMT+10 GMT+3 GMT+7 GMT-1 GMT-13 GMT-4 GMT-8 UCT /usr/share/zoneinfo/Europe: Amsterdam Busingen Kaliningrad Monaco San_Marino Vaduz Andorra Chisinau Kiev Moscow Sarajevo Vatican Athens Copenhagen Lisbon Nicosia Simferopol Vienna Belfast Dublin Ljubljana Oslo Skopje Vilnius Belgrade Gibraltar London Paris Sofia Volgograd Berlin Guernsey Luxembourg Podgorica Stockholm Warsaw Bratislava Helsinki Madrid Prague Tallinn Zagreb Brussels Isle_of_Man Malta Riga Tirane Zaporozhy +e Bucharest Istanbul Mariehamn Rome Tiraspol Zurich Budapest Jersey Minsk Samara Uzhgorod /usr/share/zoneinfo/Pacific: Honolulu Noumea root@XXX:~#

      Yes, that's all. Small world solution. All files copied over and over again. Can't find a canonical name. Can't find half of the world. Africa has a single time zone: Cairo. I don't even know from where they copied this crap.

      This should be fixable, simply by adding a two more lines to my post-install script, and sane-zoneinfo.tar.gz stolen from some sane Linux distribution:

      rm -rf $DEST/usr/share/zoneinfo ( cd $DEST && tar xzf - ) < $SRC/sane-zoneinfo.tar.gz

      Many configuration files below /etc/ are executable, most likely because someone copied or edited them via a samba server, and then added them including the executable flag to version control. Boot scripts search for hardware that is not present on the system and can never be present, simply because the required interfaces do not exist. Yes, you could assume this was a generic system. No, the OS bundle is complied exclusively for that system.

      Lots of commands are actually installed twice, once as a size-optimized variant compiled into busybox, and once as a fully-featured variant compiled from coreutils. A symlink for each of those commands allows switching between the two implementations. Which is plain nonsense. The busybox implementation usually implements only a subset of the coreutils implementation, so if you install coreutils, you don't need those commands in busybox.

      Yes, it works, the wasted space and the wrong permssions don't not hurt that much, and I kill the most stupid boot scripts during installation. But it is messy all over the place.

      So this is how commercial embedded Linux systems can look like. Fix it or get used to it.

      No, I won't open tickets at the manufacturer's support. They could fix those problems, but we won't gain much. It takes time and we would have to "hold their hands" while they attempt to fix the problems. Plus everything that's not strictly a bug would be a feature request, causing costs for us. Fixing the real problems by a post-install script and ignoring cosmetic problems is cheaper. I'm aware that this is not how developing open source software should work, and it makes me sad, but I don't have time or money to change this.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^3: Can I install CPAN itself on busybox?
by huck (Prior) on Jul 09, 2017 at 20:45 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1194631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2022-11-27 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?