Skip to contentSkip to conversation

Avoid make distclean to remove packages from rootfs

RFC New Roberto A. Foglietta 4 participants 11 messages Oct 22, 2008 – Oct 28, 2008

lore
Share & tools
lore
#0 lore raw

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 8 lines

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 7 lines

Hi to all,

I never used buildroot before 5 days ago but it seems to me that once
a package has been activated in menuconfig a way to remove it from rootfs is saving .configs, make distclean; make (i.e.: I compiled Xorg modular and then I move on tinyx but tinyx keyboard was not working because some incompatible craps remained on the rootfs).

[cut]

Quoted 11 lines

A solution could be:

1) make checks for previous .config and un-install all removed packages (*)
2) make saves the current .config into
project_build_$ARCH/$project_name/previous.config
3) people who lose some rootfs customization do it because they
choose to remove packages (their fault)

(*) supposing all packages have a make uninstall which correctly work
otherwise N patches would be delivered to achieve this result.

A proof of concept of the proposed general solution is attached as
solution for bug report n.5564

http://busybox.net/bugs/view.php?id=5564

as you can see checkconfig.sh could be expanded to work on .config
changes and acts accordingly

Cheers,

Signature · 1 line
/roberto
#1 lore raw

[Buildroot] [RFC] Avoid make distclean to remove packages fromrootfs

I perform the following steps to rebuild the rootfs. It's fast and easy.

rm project_build_ARCH/PROJECT/.root
rm -rf project_build_ARCH/PROJECT/root

Once these steps are done then the next make will copy in a clean skeleton template and all the other Makefiles will notice the install targets are missing and they will install all the targets. This is the cleanest and fastest method I have found because this only copies files.

Maybe this should be added to the top level Makefile.

John

-----Original Message-----
From: [email protected] [mailto:buildroot-bounces at uclibc.org] On Behalf Of Roberto A. Foglietta
Sent: Wednesday, October 22, 2008 5:06 AM
To: buildroot at uclibc.org
Subject: [Buildroot] [RFC] Avoid make distclean to remove packages fromrootfs

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 8 lines

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 7 lines

Hi to all,

I never used buildroot before 5 days ago but it seems to me that
once a package has been activated in menuconfig a way to remove it from rootfs is saving .configs, make distclean; make (i.e.: I compiled Xorg modular and then I move on tinyx but tinyx keyboard was not working because some incompatible craps remained on the rootfs).

[cut]

Quoted 9 lines

A solution could be:

1) make checks for previous .config and un-install all removed
packages (*)
2) make saves the current .config into
project_build_$ARCH/$project_name/previous.config
3) people who lose some rootfs customization do it because they
choose to remove packages (their fault)

Quoted 3 lines

(*) supposing all packages have a make uninstall which correctly work
otherwise N patches would be delivered to achieve this result.

A proof of concept of the proposed general solution is attached as solution
for bug report n.5564

http://busybox.net/bugs/view.php?id=5564

as you can see checkconfig.sh could be expanded to work on .config changes
and acts accordingly

Cheers,
--
/roberto
_______________________________________________
buildroot mailing list
buildroot at uclibc.org
http://busybox.net/mailman/listinfo/buildroot

#2 lore raw

[Buildroot] [RFC] Avoid make distclean to remove packages fromrootfs

2008/10/22 John Schimandle <[email protected]>:

Quoted 5 lines

I perform the following steps to rebuild the rootfs. It's fast and easy.

rm project_build_ARCH/PROJECT/.root
rm -rf project_build_ARCH/PROJECT/root

Quoted 7 lines

Once these steps are done then the next make will copy in a clean skeleton template and all the other Makefiles will notice the install targets are missing and they will install all the targets. This is the cleanest and fastest method I have found because this only copies files.

Maybe this should be added to the top level Makefile.

I have just tried this way but it installs only skeleton, dbus, mcookie, busybox, kernel modules, kernel (in case), uClibc, some libraries (expat, drm, dbus, png, z), rxvt:

roberto at rafbook:~/gles/buildroot$ du -ks project_build_i586/ugles/root
44680 project_build_i586/ugles/root

roberto at rafbook:~/gles/buildroot$ mv -f project_build_i586/ugles/root project_build_i586/ugles/root.002
roberto at rafbook:~/gles/buildroot$ rm -f project_build_i586/ugles/.root roberto at rafbook:~/gles/buildroot$ make
[...]
roberto at rafbook:~/gles/buildroot$ du -ks project_build_i586/ugles/root
6676 project_build_i586/ugles/root

However it does not resolve the problem to remove ONLY a package from customized rootfs or reset some kernel config parameters back (i.e.:
bug report 5564).

Cheers,

Signature · 1 line
/roberto
#3 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

In reply to John Schimandle

2008/10/22 John Schimandle <[email protected]>:

Quoted 5 lines

I perform the following steps to rebuild the rootfs. It's fast and easy.

rm project_build_ARCH/PROJECT/.root
rm -rf project_build_ARCH/PROJECT/root

^^^^ these lines are not enough and sometime are too much (i.e.: about losing the customization)

rm -rf project_build_ARCH/PROJECT/autotools-stamps

^^^^ this line resolves the problem to reinstall everything (apart libfreetype which buggy installation put them in staging_dir but not in target_dir)

Quoted 6 lines

Once these steps are done then the next make will copy in a clean skeleton template and all the other Makefiles will notice the install targets are missing and they will install all the targets. This is the cleanest and fastest method I have found because this only copies files.

Maybe this should be added to the top level Makefile.

Attached patch allow two more targets:

make install

or

make rootclean install

I hope this helps,

Signature · 8 lines
/roberto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile-r23778.patch
Type: text/x-diff
Size: 1654 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20081027/81eeb8f1/attachment.patch 
#4 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

Quoted 49 lines · Roberto A. Foglietta

2008/10/22 John Schimandle <[email protected]>:

Quoted 5 lines

I perform the following steps to rebuild the rootfs. It's fast and easy.

rm project_build_ARCH/PROJECT/.root
rm -rf project_build_ARCH/PROJECT/root

^^^^ these lines are not enough and sometime are too much (i.e.: about losing the customization)

rm -rf project_build_ARCH/PROJECT/autotools-stamps

^^^^ this line resolves the problem to reinstall everything (apart libfreetype which buggy installation put them in staging_dir but not in target_dir)

Quoted 6 lines

Once these steps are done then the next make will copy in a clean skeleton template and all the other Makefiles will notice the install targets are missing and they will install all the targets. This is the cleanest and fastest method I have found because this only copies files.

Maybe this should be added to the top level Makefile.

Attached patch allow two more targets:

make install

or

make rootclean install

I hope this helps,

Signature · 1 line
/roberto
Makefile +1 -1
@@ -324,7 +324,7 @@
 		touch $(STAGING_DIR)/.fakeroot.00000; \
 	fi
 	-find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
-	-find $(TARGET_DIR) -type f -name .empty | xargs rm -rf	
+	-find $(TARGET_DIR) -type f -name .empty -delete
 	touch $@
 

$(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root

Makefile line 344

Quoted 4 lines
Makefile +1 -0
@@ -341,6 +341,7 @@
 	find $(TARGET_DIR)/lib -name '*.a' -delete
 	find $(TARGET_DIR)/usr/lib -name '*.la' -delete
 	find $(TARGET_DIR)/lib -name '*.la' -delete
+	find $(TARGET_DIR) -type f -name '*~' -delete

No. Use xargs instead.

Quoted 10 lines

endif

source: $(TARGETS_SOURCE) $(HOST_SOURCE)

Makefile +3 -0
@@ -357,6 +358,19 @@
 # Cleanup and misc junk
 #
 #############################################################
+
+install: softclean all
+	# TODO: to fix this bug in the proper way

Makefile line 373

Quoted 10 lines
Makefile +10 -0
+	name=$$(find $(STAGING_DIR) -name 'libfreetype.so'); \
+	dest=$$(dirname $$name | sed -e "s,$(STAGING_DIR),$(TARGET_DIR),"); \
+	cp -af $$name* $$dest; $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $$dest/libfreetype.so
+	
+rootclean:
+	rm -rf $(TARGET_DIR) $(PROJECT_BUILD_DIR)/.root
+
+softclean:
+	rm -rf $(IMAGE) $(PROJECT_BUILD_DIR)/autotools-stamps
+

No. Adding yet more targets makes absolutely no sense at all. Just make 'make clean' wipe the stamps and let 'make realclean' wipe the built stuff.

And DOCUMENT that stuff in 'make help'!
If you don't document it then the NACK and revert is implied.

#5 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

2008/10/27 Bernhard Reutner-Fischer <[email protected]>:

Quoted 1 line · Roberto A. Foglietta

[...]

Quoted 11 lines
Quoted 11 lines
Makefile (working copy) renamed from Makefile (revision 23784) +1 -1
@@ -324,7 +324,7 @@
              touch $(STAGING_DIR)/.fakeroot.00000; \
      fi
      -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
-      -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf
+      -find $(TARGET_DIR) -type f -name .empty -delete
      touch $@
 
Quoted 8 lines

Makefile (working copy) line 344

Quoted 6 lines

$(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root

Makefile (working copy) renamed from Makefile (revision 23784) +1 -0
@@ -341,6 +341,7 @@
      find $(TARGET_DIR)/lib -name '*.a' -delete
      find $(TARGET_DIR)/usr/lib -name '*.la' -delete
      find $(TARGET_DIR)/lib -name '*.la' -delete
+      find $(TARGET_DIR) -type f -name '*~' -delete

No. Use xargs instead.

Why?

Quoted 14 lines
Quoted 14 lines
Makefile (working copy) renamed from Makefile (revision 23784) +9 -0
 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
@@ -357,6 +358,19 @@
 # Cleanup and misc junk
 #
 #############################################################
+
+install: softclean all
+      # TODO: to fix this bug in the proper way
+      name=$$(find $(STAGING_DIR) -name 'libfreetype.so'); \
+      dest=$$(dirname $$name | sed -e "s,$(STAGING_DIR),$(TARGET_DIR),"); \
+      cp -af $$name* $$dest; $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $$dest/libfreetype.so
+
+rootclean:
+      rm -rf $(TARGET_DIR) $(PROJECT_BUILD_DIR)/.root
Quoted 8 lines

Makefile (working copy) line 373

Quoted 4 lines
Makefile (working copy) renamed from Makefile (revision 23784) +4 -0
+
+softclean:
+      rm -rf $(IMAGE) $(PROJECT_BUILD_DIR)/autotools-stamps
+

No. Adding yet more targets makes absolutely no sense at all. Just make 'make clean' wipe the stamps and let 'make realclean' wipe the built stuff.

clean remove a lot of things not only the stamps

clean: $(TARGETS_CLEAN)

	rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)

$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps

a) you want reinstall things in root because they have been corrupted without loosing your customization on scripts/configurations:

make install (which for work correctly need to do: softclean all, this is the reason because softclean exist)

b) you want remove root and remade it from scratch

make rootclean install

in both a) and b) cases you want do these things in the fastest way.

Quoted 4 lines

And DOCUMENT that stuff in 'make help'!
If you don't document it then the NACK and revert is implied.

I will made some tests in order to show you how much time people can
save in using some targets appropriately. Then if you will agree with me that those targets are really useful I will document them. Testing extensively the buildroot in many configuration implies to move AS FAST AS POSSIBLE from one build to another one without recompiling the WORLD.

Cheers,

Signature · 1 line
/roberto
#6 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

Quoted 25 lines · Roberto A. Foglietta

2008/10/27 Bernhard Reutner-Fischer <[email protected]>:

Quoted 1 line · Roberto A. Foglietta

[...]

Quoted 11 lines
Quoted 11 lines
Makefile (working copy) renamed from Makefile (revision 23784) +1 -1
@@ -324,7 +324,7 @@
              touch $(STAGING_DIR)/.fakeroot.00000; \
      fi
      -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
-      -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf
+      -find $(TARGET_DIR) -type f -name .empty -delete
      touch $@
 
Quoted 8 lines

Makefile (working copy) line 344

Quoted 6 lines

$(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root

Makefile (working copy) renamed from Makefile (revision 23784) +1 -0
@@ -341,6 +341,7 @@
      find $(TARGET_DIR)/lib -name '*.a' -delete
      find $(TARGET_DIR)/usr/lib -name '*.la' -delete
      find $(TARGET_DIR)/lib -name '*.la' -delete
+      find $(TARGET_DIR) -type f -name '*~' -delete

No. Use xargs instead.

Quoted 1 line

Why?

config FEATURE_FIND_DELETE
bool "Enable -delete option allowing to delete files" default n

Quoted 32 lines
Quoted 14 lines
Quoted 14 lines
Makefile (working copy) renamed from Makefile (revision 23784) +9 -0
 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
@@ -357,6 +358,19 @@
 # Cleanup and misc junk
 #
 #############################################################
+
+install: softclean all
+      # TODO: to fix this bug in the proper way
+      name=$$(find $(STAGING_DIR) -name 'libfreetype.so'); \
+      dest=$$(dirname $$name | sed -e "s,$(STAGING_DIR),$(TARGET_DIR),"); \
+      cp -af $$name* $$dest; $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $$dest/libfreetype.so
+
+rootclean:
+      rm -rf $(TARGET_DIR) $(PROJECT_BUILD_DIR)/.root
Quoted 8 lines

Makefile (working copy) line 373

Quoted 4 lines
Makefile (working copy) renamed from Makefile (revision 23784) +4 -0
+
+softclean:
+      rm -rf $(IMAGE) $(PROJECT_BUILD_DIR)/autotools-stamps
+

No. Adding yet more targets makes absolutely no sense at all. Just make 'make clean' wipe the stamps and let 'make realclean' wipe the built stuff.

clean remove a lot of things not only the stamps

clean: $(TARGETS_CLEAN)

	rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)

$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps

a) you want reinstall things in root because they have been corrupted without loosing your customization on scripts/configurations:

Quoted 8 lines

make install (which for work correctly need to do: softclean all, this is the reason because softclean exist)

b) you want remove root and remade it from scratch

make rootclean install

in both a) and b) cases you want do these things in the fastest way.

Work out a setup which deals fine via
- clean
- realclean
- distclean

Everything else is too finegrained and doesn't help since it's not intuitive.

Quoted 8 lines
Quoted 1 line

And DOCUMENT that stuff in 'make help'!

I will made some tests in order to show you how much time people can save in using some targets appropriately. Then if you will agree with me that those targets are really useful I will document them. Testing extensively the buildroot in many configuration implies to move AS FAST AS POSSIBLE from one build to another one without recompiling the WORLD.

I don't care about that, personally.
My tree is at least 50% faster when configuring stuff (AUTO_CONFIGURE_TARGET) and furthermore compiles packages correctly, as opposed to the thing you're using.

#7 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

2008/10/27 Bernhard Reutner-Fischer <[email protected]>:

Quoted 26 lines · Roberto A. Foglietta
Quoted 25 lines

2008/10/27 Bernhard Reutner-Fischer <[email protected]>:

Quoted 1 line · Roberto A. Foglietta

[...]

Quoted 19 lines
Quoted 13 lines
Makefile (working copy) renamed from Makefile (revision 23784) +1 -1
@@ -324,7 +324,7 @@
              touch $(STAGING_DIR)/.fakeroot.00000; \
      fi
      -find $(TARGET_DIR) -type d -name CVS -o -name .svn | xargs rm -rf
-      -find $(TARGET_DIR) -type f -name .empty | xargs rm -rf
+      -find $(TARGET_DIR) -type f -name .empty -delete
      touch $@
 

$(TARGET_DIR): $(PROJECT_BUILD_DIR)/.root

Makefile (working copy) line 344

Quoted 4 lines
Makefile (working copy) renamed from Makefile (revision 23784) +1 -0
@@ -341,6 +341,7 @@
      find $(TARGET_DIR)/lib -name '*.a' -delete
      find $(TARGET_DIR)/usr/lib -name '*.la' -delete
      find $(TARGET_DIR)/lib -name '*.la' -delete
+      find $(TARGET_DIR) -type f -name '*~' -delete

No. Use xargs instead.

Quoted 6 lines
Quoted 1 line

Why?

config FEATURE_FIND_DELETE
bool "Enable -delete option allowing to delete files" default n

Ok, I only emulate people who has used -delete before me. However in
this case we are using $HOST command-set and it is supposed that busybox has CONFIG_DESKTOP=y and many other fancy features:

roberto at rafbook:~/busybox-1.11.3$ make defconfig roberto at rafbook:~/busybox-1.11.3$ grep FEATURE_FIND_DELETE .config CONFIG_FEATURE_FIND_DELETE=y

There is a problem with xargs: if nothing has been found the line
fails with error.

Quoted 41 lines
Quoted 32 lines
Quoted 14 lines
Quoted 14 lines
Makefile (working copy) renamed from Makefile (revision 23784) +9 -0
 source: $(TARGETS_SOURCE) $(HOST_SOURCE)
@@ -357,6 +358,19 @@
 # Cleanup and misc junk
 #
 #############################################################
+
+install: softclean all
+      # TODO: to fix this bug in the proper way
+      name=$$(find $(STAGING_DIR) -name 'libfreetype.so'); \
+      dest=$$(dirname $$name | sed -e "s,$(STAGING_DIR),$(TARGET_DIR),"); \
+      cp -af $$name* $$dest; $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $$dest/libfreetype.so
+
+rootclean:
+      rm -rf $(TARGET_DIR) $(PROJECT_BUILD_DIR)/.root
Quoted 8 lines

Makefile (working copy) line 373

Quoted 4 lines
Makefile (working copy) renamed from Makefile (revision 23784) +4 -0
+
+softclean:
+      rm -rf $(IMAGE) $(PROJECT_BUILD_DIR)/autotools-stamps
+

No. Adding yet more targets makes absolutely no sense at all. Just make 'make clean' wipe the stamps and let 'make realclean' wipe the built stuff.

clean remove a lot of things not only the stamps

clean: $(TARGETS_CLEAN)

      rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)

$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps

a) you want reinstall things in root because they have been corrupted without loosing your customization on scripts/configurations:

Quoted 8 lines

make install (which for work correctly need to do: softclean all, this is the reason because softclean exist)

b) you want remove root and remade it from scratch

make rootclean install

in both a) and b) cases you want do these things in the fastest way.

Quoted 8 lines

Work out a setup which deals fine via
- clean
- realclean
- distclean

Everything else is too finegrained and doesn't help since it's not intuitive.

ok, being intuitive for the user is also my mantra. I will propose to add only

- install

which works in this way just because it is the fastest way I know to write it:

install: softclean all

softclean:
bla bla

In that way users should take care only about install which is a 'standard' target

Quoted 9 lines
Quoted 8 lines
Quoted 1 line

And DOCUMENT that stuff in 'make help'!

I will made some tests in order to show you how much time people can save in using some targets appropriately. Then if you will agree with me that those targets are really useful I will document them. Testing extensively the buildroot in many configuration implies to move AS FAST AS POSSIBLE from one build to another one without recompiling the WORLD.

Quoted 5 lines

I don't care about that, personally.
My tree is at least 50% faster when configuring stuff (AUTO_CONFIGURE_TARGET) and furthermore compiles packages correctly, as opposed to the thing you're using.

Faster is faster, it is a relative value: two ways to be faster is
better than one only.

Being correct is an absolute value: 0 or 1. Having a install target
should not be wrong.

Thanks,

Signature · 8 lines
/roberto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile-r23778.patch2
Type: application/octet-stream
Size: 2296 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20081027/40c4a320/attachment.obj 
#8 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

In reply to Roberto A. Foglietta
Quoted 8 lines · Roberto A. Foglietta

clean remove a lot of things not only the stamps

clean: $(TARGETS_CLEAN)

	rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)

$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps

a) you want reinstall things in root because they have been corrupted without loosing your customization on scripts/configurations:

You shouldn't edit anything in $(TARGET_DIR) yourself - edit the source, then rebuild.

However, there does need to be a way to copy the target_skeleton over the root directory again in case you've edited files (startup scripts, passwd file, fstab etc). And you might not want to copy this over an existing $(TARGET_DIR), because then you might lose changes made by packages.

I didn't understand your softclean and rootclean targets though. Here's what I have added to my own tree:

root-clean:

	rm -rf $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps $(TARGET_DIR)

Hamish

Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
#9 lore raw

PATCH 1/1 Avoid make distclean to remove packages fromrootfs

2008/10/28 Hamish Moffatt <[email protected]>:

Quoted 7 lines · Roberto A. Foglietta
Quoted 6 lines

clean remove a lot of things not only the stamps

clean: $(TARGETS_CLEAN)

      rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)

$(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps

Quoted 5 lines
Quoted 2 lines

a) you want reinstall things in root because they have been corrupted without loosing your customization on scripts/configurations:

You shouldn't edit anything in $(TARGET_DIR) yourself - edit the source, then rebuild.

Yes and no.
Yes you are right once I know what I want to do on the source. No, you are not right if I have to play with rootfs until I decide.

Quoted 10 lines

However, there does need to be a way to copy the target_skeleton over the root directory again in case you've edited files (startup scripts, passwd file, fstab etc). And you might not want to copy this over an existing $(TARGET_DIR), because then you might lose changes made by packages.

I didn't understand your softclean and rootclean targets though. Here's what I have added to my own tree:

my 'softclean' is an internal target in order to do 'install' target.

Quoted 4 lines

root-clean:

       rm -rf $(PROJECT_BUILD_DIR)/.root $(PROJECT_BUILD_DIR)/autotools-stamps $(TARGET_DIR)

ok, so it seems to me that: install and rootclean could be two acceptable targets to add.

here you are a newer version of the patch

+ @echo ' rootclean - delete all rootfs content

+ @echo ' install - (re)install rootfs but not skeleton if it exists'

Cheers,

Signature · 8 lines
/roberto
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile-r23778.patch3
Type: application/octet-stream
Size: 2568 bytes
Desc: not available
Url : http://busybox.net/lists/buildroot/attachments/20081028/4492baf1/attachment.obj 
#10 lore raw

RFC 1/1 Avoid make distclean to remove packages from rootfs

In reply to Roberto A. Foglietta
Quoted 20 lines · Roberto A. Foglietta

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 8 lines

2008/10/21 Roberto A. Foglietta <[email protected]>:

Quoted 7 lines

Hi to all,

I never used buildroot before 5 days ago but it seems to me that once
a package has been activated in menuconfig a way to remove it from rootfs is saving .configs, make distclean; make (i.e.: I compiled Xorg modular and then I move on tinyx but tinyx keyboard was not working because some incompatible craps remained on the rootfs).

[cut]

Quoted 8 lines

A solution could be:

1) make checks for previous .config and un-install all removed packages (*)
2) make saves the current .config into
project_build_$ARCH/$project_name/previous.config
3) people who lose some rootfs customization do it because they
choose to remove packages (their fault)

Quoted 6 lines
Quoted 3 lines

(*) supposing all packages have a make uninstall which correctly work
otherwise N patches would be delivered to achieve this result.

A proof of concept of the proposed general solution is attached as solution for bug report n.5564

First, bash scripts are not acceptable. The "binary" is something from ulf.

Quoted 5 lines

http://busybox.net/bugs/view.php?id=5564

as you can see checkconfig.sh could be expanded to work on .config changes and acts accordingly

no, this is not the proper thing to do.

Your solution #1 is already done.
Solutiln #2 would be to just

index 0325132..19aa785 100644

target/linux/Makefile.in +1 -1
@@ -195,7 +195,7 @@ ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 	echo "CONFIG_INITRAMFS_ROOT_UID=0" >> $(LINUX26_DIR)/.config
 	echo "CONFIG_INITRAMFS_ROOT_GID=0" >> $(LINUX26_DIR)/.config
 else
-	echo "CONFIG_INITRAMFS_SOURCE=\"\"" >> $(LINUX26_DIR)/.config
+	echo "# CONFIG_INITRAMFS_SOURCE is not set" >>

$(LINUX26_DIR)/.config
endif
ifeq ($(BR2_PACKAGE_BUSYBOX_INITRAMFS),y)

 	# precedence for a small initramfs

and your #3 is definitely not correct.

What you seem to be referring to above is that that if you unselect a package, it is not automagically -clean and -dircleaned, IIUC. Short of just rm -rf *_${YOURARCH}* && make, you could run the respective -clean target. Note that alot of them do not cleanup properly anyway, i.e. need improvement.