rpi-update icon indicating copy to clipboard operation
rpi-update copied to clipboard

Copying failed when /opt symlinked

Open biji opened this issue 11 years ago • 11 comments

My /opt symlinked to /data/opt When running rpi-update, always failed copying vc to /opt Maybe better using rsync -rv -K ?

biji avatar Jun 17 '14 08:06 biji

I don't really see what the issue is. Copying to a symlinked directory should be fine. What error message do you get? What does

ls -ld /opt /data/opt
ls -l /opt /data/opt

show?

popcornmix avatar Jun 17 '14 10:06 popcornmix

Error message is similiar to this: cp: cannot overwrite non-directory ‘./opt’ with directory ‘source/opt/’

ls -ld opt data/opt/ drwxrwxr-x 2 u u 4096 Jun 18 09:59 data/opt/ lrwxrwxrwx 1 u u 9 Jun 18 09:59 opt -> data/opt/

biji avatar Jun 18 '14 03:06 biji

Can you edit /usr/bin/rpi-update and in download_rev change:

                curl -L "${REPO_URI}/tarball/${FW_REV}" | tar xzf - -C "${FW_RE$

to

                curl -L "${REPO_URI}/tarball/${FW_REV}" | tar xzfh - -C "${FW_RE$

and run:

sudo UPDATE_SELF=0 rpi-update

popcornmix avatar Jun 18 '14 11:06 popcornmix

got this error: cp: cannot overwrite non-directory //opt' with directory//root/.rpi-firmware/vc/hardfp/opt'

biji avatar Jun 23 '14 03:06 biji

@biji is this still an issue?

Ruffio avatar Jun 21 '15 10:06 Ruffio

It is for me, just ran sudo rpi-update on a Raspbian 7 install which was just updated. Just renamed /opt temporarily and mkdir /opt and ran again.

billchurch avatar Apr 03 '16 13:04 billchurch

@biji, @billchurch can you provide a step by step procedure to reproduce this issue?

Ruffio avatar May 20 '16 06:05 Ruffio

@biji, @billchurch can you provide a step by step procedure to reproduce this issue?

Ruffio avatar Jun 29 '16 20:06 Ruffio

@popcornmix any suggestions?

Ruffio avatar Jul 24 '16 10:07 Ruffio

@popcornmix This demonstrates the issue:

$ cd $(mktemp -d)
$ mkdir -p src/foo dest/bar
$ touch src/foo/test
$ cd dest
$ ln -s bar foo
$ cd ..
$ tree
.
├── dest
│   ├── bar
│   └── foo -> bar
└── src
    └── foo
        └── test

5 directories, 1 file
$ cp -R src/* dest/
cp: cannot overwrite non-directory ‘dest/foo’ with directory ‘src/foo’
$ tree
.
├── dest
│   ├── bar
│   └── foo -> bar
└── src
    └── foo
        └── test

5 directories, 1 file
$ rsync -rvK src/* dest/
sending incremental file list
foo/test

sent 112 bytes  received 36 bytes  296.00 bytes/sec
total size is 0  speedup is 0.00
$ tree
.
├── dest
│   ├── bar
│   │   └── test
│   └── foo -> bar
└── src
    └── foo
        └── test

5 directories, 2 files

However this is such an edge-case I'm not sure it warrants switching all usages of cp -R to rsync -rK ?

lurch avatar Jun 08 '19 17:06 lurch

This is still open... Really easy to reproduce, just copy your /opt into a different location and then create a symlink /opt to that location. (I had to move my /opt to a network drive and it took me quite some time to understand why rpi-update didn't work any longer...)

dg1sek avatar Sep 08 '20 08:09 dg1sek