LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   add_package_user fails when moving lfs-7.0-rc1 from new to old pc (https://www.linuxquestions.org/questions/linux-from-scratch-13/add_package_user-fails-when-moving-lfs-7-0-rc1-from-new-to-old-pc-901082/)

jelle_ 09-04-2011 02:22 PM

add_package_user fails when moving lfs-7.0-rc1 from new to old pc
 
hello

I have just compiled the 7.0-rc1 release on my fast computer. I added package users and DESTDIR-style package management using my own package manager. I'm also using bsd-init scripts.

LFS runs well on my fast computer trough chroot. So I decided to copy LFS to my old computer. That one boots to.

When I try to add a package user on my old computer, i get the following error:
Code:

root@jelle_pentium2 ~ # addpkguser htop htop
/usr/sbin/add_package_user: line 99: 1024 Illegal instruction    expr ${minuid} + 1 2> /dev/null 1>&2
/usr/sbin/add_package_user: line 100: 1025 Illegal instruction    expr ${minuid} + 1 2> /dev/null 1>&2
/usr/sbin/add_package_user: line 101: 1026 Illegal instruction    expr ${minuid} + 1 2> /dev/null 1>&2
/usr/sbin/add_package_user: line 102: 1027 Illegal instruction    expr ${minuid} + 1 2> /dev/null 1>&2
Error: Illegal numeric value!
root@jelle_pentium2 ~ #

note: addpkguser is just the install_package from the package users hint.

I compiled everything on a box running slackware-13.37
Code:

jelle@jelle-desktop ~ $ uname -a
Linux jelle-desktop 2.6.37.6-smp #2 SMP Sat Apr 9 23:39:07 CDT 2011 i686 AMD Phenom(tm) II X3 720 Processor AuthenticAMD GNU/Linux
jelle@jelle-desktop ~ $

the other box
Code:

root@jelle_pentium2 ~ # uname -a
Linux jelle-pentium2 3.0.4 #1 SMP Sun Sep 4 05:41:24 CEST 2011 i686 i686 i386 GNU/Linux
root@jelle_pentium2 ~ #

I hope anyone can help me finding out why this script crashes on my old computer, but works on the other

business_kid 09-05-2011 07:35 AM

Try
Quote:

view +99 /usr/sbin/add_package_user
see what command exactly is failing.

jelle_ 09-05-2011 10:09 AM

the script fails at the command
Code:

expr ${minuid} + 1 2> /dev/null 1>&2
I tested expr some more and this is the result:
phenom
Code:

root@jelle-desktop / # expr 10000 + 1
10001
root@jelle-desktop / # expr 25 - 3
22
root@jelle-desktop / # expr 25 * 3
expr: syntax error

pentium
Code:

root@jelle-pentium2 / # expr 10000 + 1
Illegal instruction
root@jelle-pentium2 / # expr 25 * 3
expr: syntax error
root@jelle-pentium2 / # expr 25 - 3
Illegal instruction

The last command on my phenom should be legal according to the man page. Does this mean expr is wrong there too?

Also, I assumed that my pentium and my phenom use the same 32-bit instruction set (i686). Am I wrong in this?

business_kid 09-06-2011 02:45 AM

Quote:

the script fails at the command
Code:
expr ${minuid} + 1 2> /dev/null 1>&2
That might happen if $minuid is not a number.

jelle_ 09-08-2011 02:35 PM

I copied expr from slackware to my lfs system and everything works again. currently compiling gmp and coreutils again. I hope this solves the problem, because compiling is slow without -j6.

jelle_ 09-08-2011 02:55 PM

recompiling gmp and coreutils solved the problem

blumbri 09-10-2011 10:39 AM

Kind of off topic, but if you want to use '*' with 'expr' you must escape it first:

Code:

# expr 25 \* 3

jelle_ 09-11-2011 03:17 AM

Quote:

Originally Posted by blumbri (Post 4468210)
Kind of off topic, but if you want to use '*' with 'expr' you must escape it first:

Code:

# expr 25 \* 3

thanks for learning me something new


All times are GMT -5. The time now is 02:05 AM.