LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 5.4 error: patch: **** Can't open patch file .. (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-5-4-error-patch-%2A%2A%2A%2A-cant-open-patch-file-4175443294/)

DavidLee1A 12-28-2012 02:51 PM

LFS 5.4 error: patch: **** Can't open patch file ..
 
I typed:
Code:

patch -Np1 -i ../binutils-2.22-build_fix-1.patch
and got error message
Code:

patch: **** Can't open patch file ../binutils-2.22-build_fix-1.patch : No such file or directory
here is the full picture:
Code:

lfs@host:/mnt/lfs/sources$ ls
Checkmd5sums.sh                            lfs-bootscripts-20120901.tar.bz2
autoconf-2.69.tar.xz                    libpipeline-1.2.1.tar.gz
automake-1.12.3.tar.xz                    libtool-2.4.2.tar.gz
bash-4.2-fixes-8.patch                    linux-3.5.2.tar.xz
bash-4.2.tar.gz                            m4-1.4.16.tar.bz2
binutils-2.22-build_fix-1.patch    make-3.82-upstream_fixes-2.patch
binutils-2.22.tar.bz2                    make-3.82.tar.bz2
bison-2.6.2.tar.xz                    man-db-2.6.2.tar.xz
bzip2-1.0.6-install_docs-1.patch    man-pages-3.42.tar.xz
bzip2-1.0.6.tar.gz                    md5sums
check-0.9.8.tar.gz                    mpc-1.0.tar.gz
coreutils-8.19-i18n-1.patch            mpfr-3.1.1.tar.xz
coreutils-8.19.tar.xz                    ncurses-5.9.tar.gz
dejagnu-1.5.tar.gz                    patch-2.6.1-test_fix-1.patch
diffutils-3.2.tar.gz                    patch-2.6.1.tar.bz2
e2fsprogs-1.42.5.tar.gz                    perl-5.16.1-libc-2.patch
expect5.45.tar.gz                    perl-5.16.1.tar.bz2
file-5.11.tar.gz                    pkg-config-0.27.tar.gz
findutils-4.4.2.tar.gz                    procps-3.2.8-fix_HZ_errors-1.patch
flex-2.5.37-bison-2.6.1-1.patch    procps-3.2.8-watch_unicode-1.patch
flex-2.5.37.tar.bz2                    procps-3.2.8.tar.gz
gawk-4.0.1.tar.xz                    psmisc-22.19.tar.gz
gcc-4.7.1.tar.bz2                    readline-6.2-fixes-1.patch
gdbm-1.10.tar.gz                    readline-6.2.tar.gz
gettext-0.18.1.1.tar.gz                    sed-4.2.1-testsuite_fixes-1.patch
glibc-2.16.0-res_query_fix-1.patch  sed-4.2.1.tar.bz2
glibc-2.16.0.tar.xz                    shadow-4.1.5.1.tar.bz2
gmp-5.0.5.tar.xz                    sysklogd-1.5.tar.gz
grep-2.14.tar.xz                    systemd-188.tar.xz
groff-1.21.tar.gz                    sysvinit-2.88dsf.tar.bz2
grub-2.00.tar.xz                    tar-1.26.tar.bz2
gzip-1.5.tar.xz                            tcl8.5.12-src.tar.gz
iana-etc-2.30.tar.bz2                    texinfo-4.13a.tar.gz
inetutils-1.9.1.tar.gz                    tzdata2012e.tar.gz
iproute2-3.5.1.tar.xz                    udev-lfs-188-3.tar.bz2
kbd-1.15.3-backspace-1.patch            util-linux-2.21.2.tar.xz
kbd-1.15.3-upstream_fixes-1.patch  vim-7.3.tar.bz2
kbd-1.15.3.tar.gz                    wget-list
kmod-9-testsuite-1.patch            xz-5.0.4.tar.xz
kmod-9.tar.xz                            zlib-1.2.7.tar.bz2
less-444.tar.gz
lfs@host:/mnt/lfs/sources$ patch -Np1 -i ../binutils-2.22-build_fix-1.patch
patch: **** Can't open patch file ../binutils-2.22-build_fix-1.patch : No such file or directory
lfs@host:/mnt/lfs/sources$

sorry if this should be obvious, but,
Why am I getting the error message?
and
How do I fix it?
Thanks.

spiky0011 12-28-2012 02:55 PM

Hi

When you untared binutils did you cd into binutils dir
You should be standing in $LFS/sources/binutils-2.22 then run commands

The ../means back 1 level so it would read from the sources dir and patch in binutils-2.22 dir

chapter 5.3 last "important note"

DavidLee1A 12-28-2012 03:12 PM

ok, since I'm in the sources directory, I modified to:
Code:

lfs@host:/mnt/lfs/sources$ patch -Np1 -i binutils-2.22-build_fix-1.patch
and get
Code:

patching file opcodes/ChangeLog
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file opcodes/ChangeLog.rej
patching file opcodes/i386-dis.c
Hunk #1 FAILED at 11331.
1 out of 1 hunk FAILED -- saving rejects to file opcodes/i386-dis.c.rej
lfs@host:/mnt/lfs/sources$

I

spiky0011 12-28-2012 03:16 PM

WHY???

Why change the book

Quote:

lfs@host:/mnt/lfs/sources$ patch -Np1 -i binutils-2.22-build_fix-1.patch
Code:

lfs@host:/mnt/lfs/sources$ patch -Np1 -i ../binutils-2.22-build_fix-1.patch

DavidLee1A 12-28-2012 03:23 PM

the book: Change to the sources directory.

and I'm in the sources directory

How did I change the book?

spiky0011 12-28-2012 03:28 PM

Did you read chapter 5.3 important part
b
Quote:

Change to the directory created when the package was extracted.
c
Quote:

Follow the book's instructions for building the package

DavidLee1A 12-28-2012 03:33 PM

I will go back and reread and check stuff ... so I'm sure I'm doing this right and then I'll post back. If this is sensitive to my location then I want to see if I can figure out WHY it's going to be influenced by that.
Thank you for quickly responding ... it will be a few hours before I post back here.


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