puppylinux-woof-CE / woof-CE

woof - the Puppy builder
GNU General Public License v2.0
389 stars 278 forks source link

./merge2out: 226: ./merge2out: Syntax error: redirection unexpected #963

Closed frenchiveruti closed 7 years ago

frenchiveruti commented 7 years ago

Hello, I'm having that line of error and I don't know if it's expected or not.

root@netbook-cole:/home/francisco# git clone https://github.com/puppylinux-woof-CE/woof-CE.git

Clonar en «woof-CE»... remote: Counting objects: 41933, done. remote: Compressing objects: 100% (64/64), done. remote: Total 41933 (delta 15), reused 0 (delta 0), pack-reused 41868 Receiving objects: 100% (41933/41933), 36.66 MiB | 161.00 KiB/s, done. Resolving deltas: 100% (25864/25864), done. Comprobando la conectividad… hecho. root@netbook-cole:/home/francisco# cd woof-CE/ root@netbook-cole:/home/francisco/woof-CE# ./merge2out

This script merges woof-arch, woof-code woof-distro, kernel-kit and initrd-progs to ../woof-out_*. See README


Host arch: x86 (The host is the machine you are running Woof on)

Please choose the target target architecture.. (the target is the machine in which the Puppy that you build is going to run):

1 arm 2 x86 3 x86_64 Type number of target architecture: 3 ...ok, x86_64

Woof builds a Puppy based on the binary packages from another distro. We sometimes refer to this as the "compat-distro".

1 slackware64 2 ubuntu Type number of compat-distro: 2 ...ok, ubuntu

The compat-distro usually has release versions Choose which release you want to obtain the binary packages from.

1 trusty64 2 xenial64 Type number of release: 1 ...ok, trusty64

Choices: Host architecture: x86 Target architecture: x86_64 Compatible-distro: ubuntu Compat-distro version: trusty64

If these are ok, press ENTER, other CTRL-C to quit:

Directory '../woof-out_x86_x86_64_ubuntu_trusty64' will now be created, if not already, and the contents of 'woof-code' copied into it. Then, these will also be copied into it: woof-arch/x86/build woof-arch/x86_64/target woof-distro/x86_64/ubuntu/trusty64 (files all levels)

Any existing files in '../woof-out_x86_x86_64_ubuntu_trusty64' will be over-ridden. (Also, all files in folders 'boot', 'kernel-skeleton', 'packages-templates', 'rootfs-skeleton', 'rootfs-packages', 'support', 'kernel-kit' and 'initrd-progs' will be deleted.)

Press ENTER to continue: Copying woof-code/... Copying woof-arch/x86/build/... Copying woof-arch/x86_64/target/ Copying kernel-kit, initrd-progs... Copying woof-distro/ubuntu/trusty64/... -e Undoing VCS-friendly stuff... ./merge2out: 226: ./merge2out: Syntax error: redirection unexpected root@netbook-cole:/home/francisco/woof-CE# Clonar en «woof-CE»... remote: Counting objects: 41933, done. remote: Compressing objects: 100% (64/64), done. remote: Total 41933 (delta 15), reused 0 (delta 0), pack-reused 41868 Receiving objects: 100% (41933/41933), 36.66 MiB | 161.00 KiB/s, done. Resolving deltas: 100% (25864/25864), done. Comprobando la conectividad… hecho. root@netbook-cole:/home/francisco# cd woof-CE/ root@netbook-cole:/home/francisco/woof-CE# ./merge2out

This script merges woof-arch, woof-code woof-distro, kernel-kit and initrd-progs to ../woof-out_*. See README


Host arch: x86 (The host is the machine you are running Woof on)

Please choose the target target architecture.. (the target is the machine in which the Puppy that you build is going to run):

1 arm 2 x86 3 x86_64 Type number of target architecture: 3 ...ok, x86_64

Woof builds a Puppy based on the binary packages from another distro. We sometimes refer to this as the "compat-distro".

1 slackware64 2 ubuntu Type number of compat-distro: 2 ...ok, ubuntu

The compat-distro usually has release versions Choose which release you want to obtain the binary packages from.

1 trusty64 2 xenial64 Type number of release: 1 ...ok, trusty64

Choices: Host architecture: x86 Target architecture: x86_64 Compatible-distro: ubuntu Compat-distro version: trusty64

If these are ok, press ENTER, other CTRL-C to quit:

Directory '../woof-out_x86_x86_64_ubuntu_trusty64' will now be created, if not already, and the contents of 'woof-code' copied into it. Then, these will also be copied into it: woof-arch/x86/build woof-arch/x86_64/target woof-distro/x86_64/ubuntu/trusty64 (files all levels)

Any existing files in '../woof-out_x86_x86_64_ubuntu_trusty64' will be over-ridden. (Also, all files in folders 'boot', 'kernel-skeleton', 'packages-templates', 'rootfs-skeleton', 'rootfs-packages', 'support', 'kernel-kit' and 'initrd-progs' will be deleted.)

Press ENTER to continue: Copying woof-code/... Copying woof-arch/x86/build/... Copying woof-arch/x86_64/target/ Copying kernel-kit, initrd-progs... Copying woof-distro/ubuntu/trusty64/... -e Undoing VCS-friendly stuff... ./merge2out: 226: ./merge2out: Syntax error: redirection unexpected root@netbook-cole:/home/francisco/woof-CE#

wdlkmpx commented 7 years ago

You're probably using lubuntu, xubuntu, yubuntu. Bash should be the default shell everywhere.

It's a good thing that fatal errors happen early, as you'll find MANY more errors afterwards. The problem is.. I only use Puppy and right now I'm being forced back into Windows. Some work towards fixing this may happen on Sunday.

Steps to fix this if anybody else wants to do it:

1) Use a distro other than puppy with a default shell other than bash 2) attempt to build a puppy 2) Change the shebang to /bin/bash in all the affected scripts (bashisms) 3) export PATH=$PATH:$PWD/woof-code/rootfs-skeleton/sbin:$PWD/woof-code/rootfs-skeleton/usr/bin:$PWD/woof-code/rootfs-skeleton/usr/sbin:$PWD/support (from 0setup to 3builddistro) 4) fix other possible issues

something like that..

woodenshoe-wi commented 7 years ago

Another approach to fix the problem might be
https://github.com/puppylinux-woof-CE/run_woof
but when I tried using run_woof I got errors involving dpkg-deb

dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2

It might still work for Slackware based builds, but I have not tested it.

It also requires aufs so that might be a problem in non puppy distros.

frenchiveruti commented 7 years ago

Ah... yes, I'm using Lubuntu, I'm really reeeaaaallly not a Linux user and I really didn't get a word about what the heck is bash, but I felt like I had to report it as there's literally no information about this particular error on freaking google. So for the future people on the internet! Behold your probable solutions!

woodenshoe-wi commented 7 years ago

I tried using run_woof again this time using a precise-5.7.1.iso and devx and I did not see any errors running ./2createpackages

It could be that the errors I ran into were from trying to do a deb (raspbian) based build using a slacko iso.

I do not know what kernel modules are included in Lubuntu, @frenchiveruti what is the output from
find /lib/modules/ -iname aufs.ko -or -iname overlay.ko

If you have aufs.ko using run_woof might work for you, if you only have overlay.ko I can try to add support for overlayfs to run_woof.

frenchiveruti commented 7 years ago

Hi, not on my Lubuntu PC, but on xubuntu it outputs that it has both aufs and overlay. ko I'll check out when I'm back to it.

mavrothal commented 7 years ago

Ah... yes, I'm using Lubuntu, I'm really reeeaaaallly not a Linux user and I really didn't get a word about what the heck is bash.

The first line of a shell script like the "merge2out" script, tells you which program will be used to interpret the text you are entering in a machine understandable language. /bin/sh is the generic name and usually points to a specific program/interpreter like bash, dash, ash, ksh, zsh etc. Ubuntu and friends "translate" /bin/sh to /bin/dash (but also have bash). Puppy to /bin/bash. The specific script has a re-direction command (the <<<) that is not sh POSIX-compliant and is not "understood" by dash, though is OK with bash and other interpreters. To solve the problem follow any of the recommendations suggested above by @wdlkmpx

woodenshoe-wi commented 7 years ago

@wdlkmpx I did some more testing and the problem with dpkg-deb only seems to affect 32bit slacko isos. I patched run_woof to work with 64bit isos and completed a Raspbian build using a slacko64-6.3.2 iso running run_woof from tahr64-6.0.6

see https://github.com/woodenshoe-wi/run_woof
I did issue a pull request.

I still have to update some libs in the Raspbian build, but before anyone starts putting too much work into trying to fix the issues with bash and other puppy specific parts of woof-CE I think they should look at run_woof as an option.