All pastes #357628 Raw Edit

Stuff

public text v1 · immutable
·published 2007-02-15 20:47 UTC
rendered paste body
Hi mbm, I have resolved this problem through totally other means, but, unfortunately, my mind sill not leave the problem I have with the makefile, so I cannot give up on it!!

I have been experiencing some intermittent failures with fakeroot (which I have been using in order to create device nodes in a SquashFS filesystem). It appears there is a race condition under certain circumstances between the fakeroot script and the faked daemon which causes the first fakeroot call not to create a fakeroot.env file if one is wanting to do that. This is a known bug in fakeroot. Apparently a workaround to this is to pipe the command into fakeroot. In my case the entire command sequence would be as follows:

(I have added this to the 'define Image/mkfs/squashfs' section of include/image.mk)


    # Use fakeroot to pretend to create all needed device nodes
    rm -f $(STAGING_DIR)/fakeroot.env
    echo $(STAGING_DIR)/bin/makedevs \
        -d $(TARGET_DEVICE_TABLE) \
        $(TARGET_DIR) | \
      $(STAGING_DIR)/usr/bin/fakeroot \
        -s $(STAGING_DIR)/fakeroot.env

    # Use fakeroot so mksquashfs believes the previous fakery
    echo $(STAGING_DIR)/bin/mksquashfs-lzma \
        $(BUILD_DIR)/root \
        $(KDIR)/root.squashfs \
        -nopad -noappend -root-owned $(SQUASHFS_OPTS) | \
    $(STAGING_DIR)/usr/bin/fakeroot \
      -i $(STAGING_DIR)/fakeroot.env

When I run the make V=99, I get the following result:

echo "Building squashfs ..."
Building squashfs ...
mkdir -p /clmirrorcp/hamish/figment/openwrt/vln/build_arm/root/jffs
# Use fakeroot to pretend all target binaries are owned by root
# Use fakeroot to pretend to create all needed device nodes
rm -f /clmirrorcp/hamish/figment/openwrt/vln/staging_dir_arm/fakeroot.env
echo /clmirrorcp/hamish/figment/openwrt/vln/staging_dir_arm/bin/makedevs -d /clmirrorcp/hamish/figment/openwrt/vln/target/linux/vlink-2.6/image/device_table.txt /clmirrorcp/hamish/figment/openwrt/vln/build_arm/root | /clmirrorcp/hamish/figment/openwrt/vln/staging_dir_arm/usr/bin/fakeroot -s /clmirrorcp/hamish/figment/openwrt/vln/staging_dir_arm/fakeroot.env
/clmirrorcp/hamish/figment/openwrt/vln/include/shell.sh;: -c: line 0: unexpected EOF while looking for matching `''
/clmirrorcp/hamish/figment/openwrt/vln/include/shell.sh;: -c: line 1: syntax error: unexpected end of file
make[3]: *** [install] Error 2

I cannot figure out what I am doing wrong!

As I say, this is now of academic interest because I found another way of getting arounf this whole fakeroot issue, but I am puzzled as to why I am unable to pipe stuff correctly!

Thanks for taking the time to look at this.

Hamish