Skip to contentSkip to conversation

chown to root does not work

Buildroot Thilo Riessner 4 participants 12 messages Jan 19, 2007 – Jan 24, 2007

lore
Share & tools
lore
#0 lore raw

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

#1 lore raw
Quoted 4 lines · Thilo Riessner

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Use fakeroot. Than the cpio/tar/... root images are owned by root.

Signature · 4 lines
/"\ Goetz Bock at blacknet dot de  --  secure mobile Linux everNETting
\ /       (c) 2006 Creative Commons, Attribution-ShareAlike 2.0 de
 X   [ 1. Use descriptive subjects - 2. Edit a reply for brevity -  ]
/ \  [ 3. Reply to the list - 4. Read the archive *before* you post ]
#2 lore raw

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 7 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Use fakeroot. Than the cpio/tar/... root images are owned by root.

I don't know fakeroot. What is it? A programme, an option of buildroot? How do I have to use it?
Thanks for your help so far.
Thilo

#3 lore raw
Quoted 6 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

Quoted 5 lines
Quoted 2 lines

Use fakeroot. Than the cpio/tar/... root images are owned by root.

I don't know fakeroot. What is it? A programme, an option of buildroot? How do I have to use it?
Thanks for your help so far.

#4 lore raw

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 11 lines · Thilo Riessner
Quoted 6 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

# Use fakeroot to pretend all target binaries are owned by root rm -f /home/foo/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2 touch /home/foo/buildroot/build_i386/staging_dir/.fakeroot.00000 cat /home/foo/buildroot/build_i386/staging_dir/.fakeroot*

Quoted 1 line

/home/triessner/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2

echo "chown -R root:root /home/foo/buildroot/build_i386/root"

Quoted 1 line
Quoted 1 line

/home/triessner/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2

# Use fakeroot to pretend to create all needed device nodes
echo "/home/foo/buildroot/build_i386/staging_dir/bin/makedevs -d target/generic/device_table.txt /home/triessner/buildroot/build_i386/root" \

Quoted 1 line
Quoted 1 line

/home/foo/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2

# Use fakeroot so genext2fs believes the previous fakery GENEXT2_REALSIZE=`LC_ALL=C
du -l -s -c -k /home/foo/buildroot/build_i386/root | grep total | sed -e "s/total//"`; \
GENEXT2_ADDTOROOTSIZE=`if [ $GENEXT2_REALSIZE -ge 20000 ] ; then echo
16384; else echo 2400; fi`; \
GENEXT2_SIZE=expr $GENEXT2_REALSIZE + $GENEXT2_ADDTOROOTSIZE; \
GENEXT2_ADDTOINODESIZE=`find /home/foo/buildroot/build_i386/root |

wc -l`; \
        GENEXT2_INODES=`expr $GENEXT2_ADDTOINODESIZE + 400`; \
        set -x; \
        echo "/home/foo/buildroot/build_i386/genext2fs-1.3/genext2fs -b 
$GENEXT2_SIZE " \
                "-i $GENEXT2_INODES -d /home/foo/buildroot/build_i386/root " \
                " -r 0 /home/foo/buildroot/rootfs.i386.ext2" 
Quoted 1 line
Quoted 1 line

/home/triessner/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2

+ echo '/home/foo/buildroot/build_i386/genext2fs-1.3/genext2fs -b 4548 ' '-i
761 -d /home/triessner/buildroot/build_i386/root ' ' -r
0 /home/triessner/buildroot/rootfs.i386.ext2'
chmod
a+x /home/foo/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2 /home/foo/buildroot/build_i386/staging_dir/usr/bin/fakeroot -- /home/triessner/buildroot/build_i386/staging_dir/_fakeroot.rootfs.i386.ext2
chown: ?ndern des Eigent?mers von
?/home/foo/buildroot/build_i386/root/bin/busybox?: Die Operation ist nicht
erlaubt

#5 lore raw
Quoted 12 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 11 lines · Thilo Riessner
Quoted 6 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

Are you running SElinux or something like this?

#6 lore raw
Quoted 5 lines · Bernhard Fischer
Quoted 4 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 3 lines · Thilo Riessner
Quoted 2 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 1 line · Thilo Riessner
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

#7 lore raw

Am Montag, 22. Januar 2007 21:30 schrieben Sie:

Quoted 12 lines · Bernhard Fischer
Quoted 11 lines · Thilo Riessner
Quoted 10 lines

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 9 lines · Thilo Riessner
Quoted 7 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 6 lines · Thilo Riessner
Quoted 5 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

No. Everything is fine now. Ready to start the first run with the new rootfs. Thank's a lot for your help.

Thilo

#9 lore raw
In reply to Bernhard Fischer
Quoted 11 lines · Bernhard Fischer
Quoted 10 lines · Bernhard Fischer
Quoted 9 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 8 lines · Thilo Riessner
Quoted 6 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

it works, but there are still the error messges?
claus at P3linux:~/src/buildroot> make
...

chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/readline/GPL2.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/readline': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/dhcp.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/commoncpp2/LGPL.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/commoncpp2': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/iputils/GPL2.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/iputils': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/portmap/RofUCA.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/portmap': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/busybox/GPL2.txt': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses/busybox': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root/licenses': Operation not permitted
chown: changing ownership of `/home/claus/src/buildroot/build_i686/root': Operation not permitted rootdir=/home/claus/src/buildroot/build_i686/root
table='target/generic/device_table.txt'
claus at P3linux:~/src/buildroot> !tar
tar tvf rootfs.i686.tar | tail
lrwxrwxrwx root/root 0 2007-01-23 23:10:15 ./licenses/readline/GPL2.txt -> ../GPL2.txt
-rw-r--r-- root/root 5128 2004-06-18 13:59:35 ./licenses/dhcp.txt

drwxr-xr-x root/root         0 2004-05-14 14:37:32 ./licenses/commoncpp2/
lrwxrwxrwx root/root         0 2007-01-23 23:10:15 ./licenses/commoncpp2/LGPL.txt -> ../LGPL.txt
drwxr-xr-x root/root         0 2004-05-14 14:37:32 ./licenses/iputils/
lrwxrwxrwx root/root         0 2007-01-23 23:10:15 ./licenses/iputils/GPL2.txt -> ../GPL2.txt
drwxr-xr-x root/root         0 2004-07-05 17:18:32 ./licenses/portmap/
lrwxrwxrwx root/root         0 2007-01-23 23:10:15 ./licenses/portmap/RofUCA.txt -> ../RofUCA.txt
drwxr-xr-x root/root         0 2004-05-14 14:37:32 ./licenses/busybox/
lrwxrwxrwx root/root         0 2007-01-23 23:10:15 ./licenses/busybox/GPL2.txt -> ../GPL2.txt

claus at P3linux:~/src/buildroot>

claus at P3linux:~/src/buildroot> make -n tarroot
find /home/claus/src/buildroot/build_i686/root -type f -perm +111 | xargs /tools/Linuxi386CDK/bin/i686-linux-uclibc-strip --remove-section=.comment --remove-section=.note 2>/dev/null || true; rm -rf /home/claus/src/buildroot/build_i686/root/usr/man
rm -rf /home/claus/src/buildroot/build_i686/root/usr/info
/sbin/ldconfig -r /home/claus/src/buildroot/build_i686/root 2>/dev/null
# Use fakeroot to pretend all target binaries are owned by root
rm -f /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar
touch /tools/Linuxi386CDK/.fakeroot.00000
cat /tools/Linuxi386CDK/.fakeroot* > /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar
echo "chown -R root:root /home/claus/src/buildroot/build_i686/root" >> /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar
# Use fakeroot to pretend to create all needed device nodes

echo "/tools/Linuxi386CDK/bin/makedevs -d target/generic/device_table.txt /home/claus/src/buildroot/build_i686/root" \
                >> /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar
# Use fakeroot so tar believes the previous fakery
echo "tar -c""f /home/claus/src/buildroot/rootfs.i686.tar -C /home/claus/src/buildroot/build_i686/root ." \
                >> /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar

chmod a+x /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar /tools/Linuxi386CDK/usr/bin/fakeroot -- /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar rm -f /tools/Linuxi386CDK/_fakeroot.rootfs.i686.tar

claus at P3linux:~/src/buildroot> /tools/Linuxi386CDK/usr/bin/fakeroot -v fakeroot version 1.5.12

claus at P3linux:~/src/buildroot> file /tools/Linuxi386CDK/.fakeroot.00000 /tools/Linuxi386CDK/.fakeroot.00000: empty
claus at P3linux:~/src/buildroot>

What is this file for and why is it still empty?

Bye
Claus

#8 lore raw
In reply to Thilo Riessner
Quoted 5 lines · Thilo Riessner
Quoted 3 lines

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

No. Everything is fine now. Ready to start the first run with the new rootfs. Thank's a lot for your help.

My pleasure. Thanks for checking!

#10 lore raw
In reply to Claus Klein
Quoted 16 lines · Claus Klein
Quoted 15 lines · Bernhard Fischer
Quoted 13 lines · Bernhard Fischer
Quoted 12 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 11 lines · Thilo Riessner
Quoted 6 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

Quoted 5 lines
Quoted 3 lines

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

it works, but there are still the error messges?

Please report this against your distro and/or against fakeroot if your distro fails to fix this.

PS: Works for me
PPS: please provide a patch that fixes this for you if you think fakeroot is in error.

thanks for your understanding..

#11 lore raw
Quoted 17 lines · Bernhard Fischer
Quoted 16 lines · Claus Klein
Quoted 15 lines · Bernhard Fischer
Quoted 13 lines · Bernhard Fischer
Quoted 12 lines · Thilo Riessner

Am Freitag, 19. Januar 2007 17:33 schrieben Sie:

Quoted 11 lines · Thilo Riessner
Quoted 6 lines

Am Freitag, 19. Januar 2007 14:35 schrieb Goetz Bock:

Quoted 5 lines · Thilo Riessner
Quoted 4 lines

In the docs is mentioned, that one doesn't need to be root to build a root filesystem. But when building the filesystem as a normal user, chown is not able to change owner to root in the target filesystem. Is there a solution of the problem, that I don't see?

Who does call chown in there? Which package?
Please show me the logs around the alleged call to chown that is failing.

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

I've updated fakeroot, both the old version and the new one work for me. Please update, make dirclean && make and let me know if you still get this error..

it works, but there are still the error messges?

Please report this against your distro and/or against fakeroot if your distro fails to fix this.

It is the buildroote host fakeroute which is running while build builroout target tarroot. claus at P3linux:~/src/buildroot> /tools/Linuxi386CDK/usr/bin/fakeroot -v fakeroot version 1.5.12

My Host (OpenSuse 10.2) has no fakeroot!
claus at P3linux:~/src/buildroot> which fakeroot
claus at P3linux:~/src/buildroot>

Quoted 3 lines

PS: Works for me
PPS: please provide a patch that fixes this for you if you think fakeroot is in error.

Ok, I will try to find the problem. But first I have to understand how fakeroot works.

Bye,
Claus