Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying failed when /opt symlinked #142

Open
biji opened this issue Jun 17, 2014 · 11 comments
Open

Copying failed when /opt symlinked #142

biji opened this issue Jun 17, 2014 · 11 comments

Comments

@biji
Copy link

biji commented Jun 17, 2014

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

@popcornmix
Copy link
Collaborator

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?

@biji
Copy link
Author

biji commented Jun 18, 2014

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/

@popcornmix
Copy link
Collaborator

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

@biji
Copy link
Author

biji commented Jun 23, 2014

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

@Ruffio
Copy link

Ruffio commented Jun 21, 2015

@biji is this still an issue?

@billchurch
Copy link

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.

@Ruffio
Copy link

Ruffio commented May 20, 2016

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

1 similar comment
@Ruffio
Copy link

Ruffio commented Jun 29, 2016

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

@Ruffio
Copy link

Ruffio commented Jul 24, 2016

@popcornmix any suggestions?

@lurch
Copy link
Contributor

lurch commented Jun 8, 2019

@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 ?

@dg1sek
Copy link

dg1sek commented Sep 8, 2020

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants