Re: cpio misunderstanding?

2010-12-26 Thread David Brodbeck
On Fri, Dec 24, 2010 at 4:57 PM, Joe Kraft jvk-l...@thekrafts.org wrote:
 OK, now I know what's going on.  I just don't know why.  The immutable flag
 was set on all these files, if you clear it cpio will happily copy them to
 the new directory.

Does cpio attempt to preserve flags?  Since the error is could not
create, I'm wondering if it's trying to set the same flags on the
copy of the file and failing to do so.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cpio misunderstanding?

2010-12-26 Thread Polytropon
On Sun, 26 Dec 2010 11:30:59 -0800, David Brodbeck g...@gull.us wrote:
 On Fri, Dec 24, 2010 at 4:57 PM, Joe Kraft jvk-l...@thekrafts.org wrote:
  OK, now I know what's going on.  I just don't know why.  The immutable flag
  was set on all these files, if you clear it cpio will happily copy them to
  the new directory.
 
 Does cpio attempt to preserve flags?  Since the error is could not
 create, I'm wondering if it's trying to set the same flags on the
 copy of the file and failing to do so.

I'm not sure about that - man cpio doesn't give a hint
about flags. On the other hand, tar's -p option does keep
the file mode (permissions), flags and maybe ACLs intact.

I've tried info cpio ouch! ouch!, but that's not a
continuous manual that allows easy searching for strings. :-(

Some search in the /usr/src/bin subtree for the chflags
call revealed that it is used by the chflags binary, cp,
mv and rm commands, but no hint it is involved directly
in cpio.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cpio misunderstanding?

2010-12-26 Thread Carl Johnson
Polytropon free...@edvax.de writes:

 On Sun, 26 Dec 2010 11:30:59 -0800, David Brodbeck g...@gull.us wrote:
 On Fri, Dec 24, 2010 at 4:57 PM, Joe Kraft jvk-l...@thekrafts.org wrote:
  OK, now I know what's going on.  I just don't know why.  The immutable flag
  was set on all these files, if you clear it cpio will happily copy them to
  the new directory.
 
 Does cpio attempt to preserve flags?  Since the error is could not
 create, I'm wondering if it's trying to set the same flags on the
 copy of the file and failing to do so.

 I'm not sure about that - man cpio doesn't give a hint
 about flags. On the other hand, tar's -p option does keep
 the file mode (permissions), flags and maybe ACLs intact.

 I've tried info cpio ouch! ouch!, but that's not a
 continuous manual that allows easy searching for strings. :-(

 Some search in the /usr/src/bin subtree for the chflags
 call revealed that it is used by the chflags binary, cp,
 mv and rm commands, but no hint it is involved directly
 in cpio.

I had done some testing for flag support out of curiosity, and found
that only cp -p, bsdtar and dump support them.  Cpio, afio, gnutar,
gnucp and pax do not support them.  I also tested extended attributes
(used for ACLs?), and only bsdtar and dump worked for them.  Those
results were for usf, and generally didn't transfer to zfs at all or
probably other file systems.

-- 
Carl Johnsonca...@peak.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


cpio misunderstanding?

2010-12-24 Thread Joe Kraft
Let me state a couple of given's up front:
1) I would post this on a FreeSBIE list if I could find one.
2) I think the issue I have right now is not understanding completely the 
limitations of cpio.

My problem is that when building the file system to use for making the iso 
cpio fails when copying some of the files saying Operation not permitted.  
These are some of the files fairly important to the operating system like 
libexec/ld-elf.so.1 and lib/libc.so.7.

I don't see any reason for copying the other 16,540 files and failing on 
these 22 important files.  

Can anyone point me in the right direction for a better understanding of 
what's going on, or even just call me an idiot and tell me the simple thing 
I've missed?  Either will be appreciated.

Joe.


Details
I'm using 8.1-STABLE FreeBSD 8.1-STABLE #2, and freesbie-2.0.20070710 from 
ports.  I've updated the kernel conf file to match GENERIC, with the 
following lines from the original FreeSBIE kernel added at the end:
   device   bktr
   options  IPFIREWALL
   options  IPFIREWALL_VERBOSE
   options  IPFIREWALL_DEFAULT_TO_ACCEPT
   device   pf
   device   pflog
   device   pfsync
   options  IPSTEALTH
   options  IPDIVERT
   options  GEOM_UZIP
   options  GEOM_LABEL
   options  VESA
   options  SC_PIXEL_MODE

The system seems to build fine but hits a snag in this section of the 
script:
# If FILE_LIST isn't defined...
if [ -z ${FILE_LIST:-} ]; then
# then copy the whole filesystem
find . -print -depth | cpio -dump -l -v ${CLONEDIR}  ${LOGFILE} 
21
else
# else pass it to cpio
... more code to dump filenames from ${FILE_LIST} to cpio ...
fi


If I try to run it manually on one of the files that fails, I get this:

slug# echo /usr/local/freesbie-fs/libexec/ld-elf.so.1 | cpio -dump -l -v 
/usr/local/freesbie-clone

/usr/local/freesbie-clone/usr/local/freesbie-fs/libexec/ld-elf.so.1

cpio: Can't create '/usr/local/freesbie-clone/usr/local/freesbie-
fs/libexec/ld-elf.so.1': Operation not permitted
0 blocks


I can use cp to copy the file, so I don't understand what's going on here.  
Does anyone have any ideas?  

/Details

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cpio misunderstanding?

2010-12-24 Thread Pegasus Mc Cleaft
 If I try to run it manually on one of the files that fails, I get this:
 
 slug# echo /usr/local/freesbie-fs/libexec/ld-elf.so.1 | cpio -dump -l -v
 /usr/local/freesbie-clone
 
 /usr/local/freesbie-clone/usr/local/freesbie-fs/libexec/ld-elf.so.1
 
 cpio: Can't create '/usr/local/freesbie-clone/usr/local/freesbie-
 fs/libexec/ld-elf.so.1': Operation not permitted
 0 blocks
 
 
 I can use cp to copy the file, so I don't understand what's going on here.
 Does anyone have any ideas?

I don't know if this is your problem, but whenever I see that 
Operation 
not permitted error I start to suspect file flags. You might want to check 
for extra flags put on the source file or destination directory and see if 
anything weird had been set on it. 

You can look at the flags with the command ls -lao. You may also want 
to do a man chflags and read the manual page there. 

~Peg
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cpio misunderstanding?

2010-12-24 Thread Joe Kraft
Pegasus Mc Cleaft wrote:

 If I try to run it manually on one of the files that fails, I get this:
 
 slug# echo /usr/local/freesbie-fs/libexec/ld-elf.so.1 | cpio -dump -l
 -v /usr/local/freesbie-clone
 
 /usr/local/freesbie-clone/usr/local/freesbie-fs/libexec/ld-elf.so.1
 
 cpio: Can't create '/usr/local/freesbie-clone/usr/local/freesbie-
 fs/libexec/ld-elf.so.1': Operation not permitted
 0 blocks
 
 
 I can use cp to copy the file, so I don't understand what's going on
 here. Does anyone have any ideas?
 
 I don't know if this is your problem, but whenever I see that Operation
 not permitted error I start to suspect file flags. You might want to
 check for extra flags put on the source file or destination directory and
 see if anything weird had been set on it.
 
 You can look at the flags with the command ls -lao. You may also want
 to do a man chflags and read the manual page there.
 

OK, now I know what's going on.  I just don't know why.  The immutable flag 
was set on all these files, if you clear it cpio will happily copy them to 
the new directory.  I'm guessing it's a change in how the installation 
copies the files with the schg intact, I ran into a discussion about that 
from 2008.  The original FreeSBIE scripts were based on FBSD 6.2 and maybe 
never ran into this issue.

I don't quite get why this works this way though.  I understand the 
immutable flag will keep the file itself from being changed, deleted or 
moved.  But I don't see in any documentation that the immutable flag will 
not allow a file to be copied.  I did note that when using the 'cp' command 
it cleared the immutable bit on the new file instead of keeping it, but at 
least it makes the copy.

Joe.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cpio misunderstanding?

2010-12-24 Thread Polytropon
On Fri, 24 Dec 2010 19:57:41 -0500, Joe Kraft jvk-l...@thekrafts.org wrote:
 I don't quite get why this works this way though.  I understand the 
 immutable flag will keep the file itself from being changed, deleted or 
 moved.  But I don't see in any documentation that the immutable flag will 
 not allow a file to be copied. 

It *may* have to do something with the updating of the access
time (atime) of a file by the cpio program?



 I did note that when using the 'cp' command 
 it cleared the immutable bit on the new file instead of keeping it, but at 
 least it makes the copy.

The schg flag has to be set on the destination file manually.
It won't be copied by the cp command.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org