Skip to contentSkip to conversation

Problem with building sudo

Buildroot Boris Itkis (Linux) 2 participants 6 messages Dec 8, 2006 – Dec 20, 2006

lore
Share & tools
lore
#0 lore raw

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

it echo's the command to install sudu instead of running it.

It generally does not stop compile because on distributions like fedora because "touch -c" has a exit code of 0 even if the file does no exist.

#1 lore raw
Quoted 5 lines · Boris Itkis (Linux)

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

it echo's the command to install sudu instead of running it.

I'll look into this.

Quoted 3 lines

It generally does not stop compile because on distributions like fedora because "touch -c" has a exit code of 0 even if the file does no exist.

That's a bug.
Point them to
http://www.opengroup.org/onlinepubs/009695399/utilities/touch.html#tag_04_143_18

which reads
"
At least one historical implementation of touch incremented the exit code if -c was specified and the file did not exist. This volume of IEEE Std 1003.1-2001 requires exit status zero if no errors occur. "

#2 lore raw
Quoted 8 lines · Bernhard Fischer
Quoted 5 lines · Boris Itkis (Linux)

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

it echo's the command to install sudu instead of running it.

I'll look into this.

Can you update and retry? The installation is done via fakeroot, sudo didn't depend on fakeroot so may not be built for you, depending on your config.

Quoted 5 lines
Quoted 3 lines

It generally does not stop compile because on distributions like fedora because "touch -c" has a exit code of 0 even if the file does no exist.

That's a bug.

Nah, it's of course not. Not exiting with ACK would have been. Note to self: the character '0' denotes 0, not 1 ;)

#3 lore raw
Quoted 8 lines · Bernhard Fischer
Quoted 6 lines · Bernhard Fischer
Quoted 4 lines · Boris Itkis (Linux)

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

it echo's the command to install sudu instead of running it.

I'll look into this.

Can you update and retry? The installation is done via fakeroot, sudo didn't depend on fakeroot so may not be built for you, depending on your config.

The Part I am Refering to is:

$(TARGET_DIR)/usr/bin/sudo: $(SUDO_DIR)/sudo

	# Use fakeroot to pretend to do 'make install' as root
	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C $(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo
	touch -c $(TARGET_DIR)/usr/bin/sudo

If you execute ${STAGING_DIR)/.fakeroot.sudo it does the installation correctly.

May I suggest that you change:

	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C $(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo

to:

	$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C $(SUDO_DIR) install \
		> $(STAGING_DIR)/.fakeroot.sudo

I believe that should fix the problem of not automatically installing sudo:

Quoted 11 lines
Quoted 5 lines
Quoted 3 lines

It generally does not stop compile because on distributions like fedora because "touch -c" has a exit code of 0 even if the file does no exist.

That's a bug.

Nah, it's of course not. Not exiting with ACK would have been. Note to self: the character '0' denotes 0, not 1 ;)

This is or is not a bug depending on your perspective. If one just wishes to display to the user that there is a problem and possibly stop compilation then it's not a bug. If one wants to always stop if the file does not exist then it is a bug.

If one believes this is a bug then may I suggest that "touch -c" be changed to "test -f" or add a "test -f" line after the "touch -c" line.

#4 lore raw
Quoted 37 lines · Boris Itkis (Linux)
Quoted 8 lines · Bernhard Fischer
Quoted 6 lines · Bernhard Fischer
Quoted 4 lines · Boris Itkis (Linux)

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

it echo's the command to install sudu instead of running it.

I'll look into this.

Can you update and retry? The installation is done via fakeroot, sudo didn't depend on fakeroot so may not be built for you, depending on your config.

The Part I am Refering to is:

$(TARGET_DIR)/usr/bin/sudo: $(SUDO_DIR)/sudo

	# Use fakeroot to pretend to do 'make install' as root
	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo
	touch -c $(TARGET_DIR)/usr/bin/sudo

If you execute ${STAGING_DIR)/.fakeroot.sudo it does the installation correctly.

May I suggest that you change:

	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo
Quoted 7 lines

to:

	$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install \
		> $(STAGING_DIR)/.fakeroot.sudo

I believe that should fix the problem of not automatically installing sudo:

what does cat .fakeroot.sudo say if you output stdout of that make install into it?

Could it be that what you really need is quoting the echoed '"'?

echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=\"$(TARGET_DIR)\" -C $(SUDO_DIR) install" > $(STAGING_DIR)/.fakeroot.sudo

#5 lore raw
Quoted 50 lines · Bernhard Fischer
Quoted 48 lines · Boris Itkis (Linux)
Quoted 13 lines · Bernhard Fischer
Quoted 10 lines · Bernhard Fischer
Quoted 7 lines · Boris Itkis (Linux)

sudu.mk has a problem for building:

$(TARGET_DIR)/usr/bin/sudo

it echo's the command to install sudu instead of running it.

Quoted 9 lines
Quoted 3 lines

I'll look into this.

Can you update and retry? The installation is done via fakeroot, sudo didn't depend on fakeroot so may not be built for you, depending on your config.

The Part I am Refering to is:

$(TARGET_DIR)/usr/bin/sudo: $(SUDO_DIR)/sudo

	# Use fakeroot to pretend to do 'make install' as root
	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo
	touch -c $(TARGET_DIR)/usr/bin/sudo

If you execute ${STAGING_DIR)/.fakeroot.sudo it does the installation correctly.

May I suggest that you change:

	echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install" \
		> $(STAGING_DIR)/.fakeroot.sudo

to:

	$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install \
		> $(STAGING_DIR)/.fakeroot.sudo
Quoted 7 lines
Quoted 2 lines

I believe that should fix the problem of not automatically installing sudo:

what does cat .fakeroot.sudo say if you output stdout of that make install into it?

the consents of .fakeroot.sudo is:

make -j1 PATH=/opt/armtools/bin:/home/root/dist/arm-tool/buildroot/toolchain_build_arm/bin:/home/root/dist/arm-tool/buildroot/fakebin:/home/root/dist/bin:/usr/bin:/bin:/usr/sbin:/sbin AR=/opt/armtools/bin/arm-linux-uclibc-ar
AS=/opt/armtools/bin/arm-linux-uclibc-as
LD=/opt/armtools/bin/arm-linux-uclibc-ld
NM=/opt/armtools/bin/arm-linux-uclibc-nm
CC=/opt/armtools/bin/arm-linux-uclibc-gcc
GCC=/opt/armtools/bin/arm-linux-uclibc-gcc
CXX=/opt/armtools/bin/arm-linux-uclibc-g++
CPP=/opt/armtools/bin/arm-linux-uclibc-cpp
RANLIB=/opt/armtools/bin/arm-linux-uclibc-ranlib
STRIP=/opt/armtools/bin/arm-linux-uclibc-strip
OBJCOPY=/opt/armtools/bin/arm-linux-uclibc-objcopy
DESTDIR=/home/root/dist/arm-tool/buildroot/build_arm/root -C
/home/root/dist/arm-tool/buildroot/build_arm/sudo-1.6.8p9 install

Quoted 7 lines

Could it be that what you really need is quoting the echoed '"'?

echo "$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=\"$(TARGET_DIR)\" -C $(SUDO_DIR) install" > $(STAGING_DIR)/.fakeroot.sudo

The other option is to change the " to a ` to tiger command execution so the command would look like:

	echo `$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR="$(TARGET_DIR)" -C 
	$(SUDO_DIR) install` \
		> $(STAGING_DIR)/.fakeroot.sudo