diff mbox series

[Unstable/Lunar] UBUNTU: [Packaging] debian/rules: Bring back 'editconfigs'

Message ID 20230124130312.854559-1-juerg.haefliger@canonical.com
State New
Headers show
Series [Unstable/Lunar] UBUNTU: [Packaging] debian/rules: Bring back 'editconfigs' | expand

Commit Message

Juerg Haefliger Jan. 24, 2023, 1:03 p.m. UTC
With the switch to the new annotations-only mechanism and the new
annotations script, the 'editconfigs' target was dropped for some
reason. It's usefull so bring it back.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 debian/rules.d/1-maintainer.mk   |  3 ++-
 debian/scripts/misc/kernelconfig | 14 +++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

Andrea Righi Jan. 24, 2023, 1:32 p.m. UTC | #1
On Tue, Jan 24, 2023 at 02:03:12PM +0100, Juerg Haefliger wrote:
> With the switch to the new annotations-only mechanism and the new
> annotations script, the 'editconfigs' target was dropped for some
> reason. It's usefull so bring it back.

I dropped ediconfigs, because it doesn't work in our build chroots
(some packages are missing, like ncruses).

I'm happy to bring it back, but we should also update our build chroots
to support it, editing configs outside a build chroot environment can
lead to incorrect configurations...

-Andrea

> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  debian/rules.d/1-maintainer.mk   |  3 ++-
>  debian/scripts/misc/kernelconfig | 14 +++++++++++++-
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> index 4d327ec3c478..239af468df5d 100644
> --- a/debian/rules.d/1-maintainer.mk
> +++ b/debian/rules.d/1-maintainer.mk
> @@ -9,6 +9,7 @@ help:
>  	@echo "  updateconfigs       : Update core arch configs"
>  	@echo "  defaultconfigs      : Update core arch configs using defaults"
>  	@echo "  genconfigs          : Generate core arch configs in CONFIGS/*"
> +	@echo "  editconfigs         : Edit core arch configs"
>  	@echo "  migrateconfigs      : Automatically import old configs into annotations"
>  	@echo "  printchanges        : Print the current changelog entries (from git)"
>  	@echo "  insertchanges       : Insert current changelog entries (from git)"
> @@ -40,7 +41,7 @@ migrateconfigs:
>  	fi
>  	rm -rf build
>  
> -configs-targets := updateconfigs defaultconfigs genconfigs
> +configs-targets := updateconfigs defaultconfigs genconfigs editconfigs
>  
>  .PHONY: $(configs-targets)
>  $(configs-targets):
> diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
> index 0c412af2ec8e..555e5399bd8d 100755
> --- a/debian/scripts/misc/kernelconfig
> +++ b/debian/scripts/misc/kernelconfig
> @@ -17,7 +17,7 @@ if [ -z "${gcc:-}" ] ; then
>  fi
>  
>  if [ ${#} -ne 1 ] ; then
> -	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs"
> +	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs|editconfigs"
>  	exit 2
>  fi
>  
> @@ -27,6 +27,7 @@ case "${mode}" in
>  	updateconfigs)  target="syncconfig" ;;
>  	defaultconfigs) target="olddefconfig" ;;
>  	genconfigs)     target="oldconfig" ;;
> +	editconfigs)    ;;  # Target is set later based on user input
>  	*) echo "ERROR: Invalid mode: ${1}" >&2
>  	   exit 1 ;;
>  esac
> @@ -77,6 +78,17 @@ EOF
>  		continue
>  	fi
>  
> +	if [ "${mode}" = "editconfigs" ] ; then
> +		while true ; do
> +			echo -n "Do you want to edit configs for ${arch}-${flavour}? [Y/n] "
> +			read -r choice
> +			case "${choice,,}" in
> +				y|"") target="menuconfig" ; break ;;
> +				n)    target="syncconfig" ; break ;;
> +			esac
> +		done
> +	fi
> +
>  	rm -rf build
>  	mkdir build
>  
> -- 
> 2.34.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Dimitri John Ledkov Jan. 24, 2023, 1:36 p.m. UTC | #2
Imho editconfigs should use faketools export, and then editing configs will
be most festureful on any host release.

W.r.t. ncurses, given how common of an action it is, I am happy to add them
as default build-depends. They are tiny compared to the rest of the build
depends.

On Tue, 24 Jan 2023, 13:33 Andrea Righi, <andrea.righi@canonical.com> wrote:

> On Tue, Jan 24, 2023 at 02:03:12PM +0100, Juerg Haefliger wrote:
> > With the switch to the new annotations-only mechanism and the new
> > annotations script, the 'editconfigs' target was dropped for some
> > reason. It's usefull so bring it back.
>
> I dropped ediconfigs, because it doesn't work in our build chroots
> (some packages are missing, like ncruses).
>
> I'm happy to bring it back, but we should also update our build chroots
> to support it, editing configs outside a build chroot environment can
> lead to incorrect configurations...
>
> -Andrea
>
> >
> > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> > ---
> >  debian/rules.d/1-maintainer.mk   |  3 ++-
> >  debian/scripts/misc/kernelconfig | 14 +++++++++++++-
> >  2 files changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/
> 1-maintainer.mk
> > index 4d327ec3c478..239af468df5d 100644
> > --- a/debian/rules.d/1-maintainer.mk
> > +++ b/debian/rules.d/1-maintainer.mk
> > @@ -9,6 +9,7 @@ help:
> >       @echo "  updateconfigs       : Update core arch configs"
> >       @echo "  defaultconfigs      : Update core arch configs using
> defaults"
> >       @echo "  genconfigs          : Generate core arch configs in
> CONFIGS/*"
> > +     @echo "  editconfigs         : Edit core arch configs"
> >       @echo "  migrateconfigs      : Automatically import old configs
> into annotations"
> >       @echo "  printchanges        : Print the current changelog entries
> (from git)"
> >       @echo "  insertchanges       : Insert current changelog entries
> (from git)"
> > @@ -40,7 +41,7 @@ migrateconfigs:
> >       fi
> >       rm -rf build
> >
> > -configs-targets := updateconfigs defaultconfigs genconfigs
> > +configs-targets := updateconfigs defaultconfigs genconfigs editconfigs
> >
> >  .PHONY: $(configs-targets)
> >  $(configs-targets):
> > diff --git a/debian/scripts/misc/kernelconfig
> b/debian/scripts/misc/kernelconfig
> > index 0c412af2ec8e..555e5399bd8d 100755
> > --- a/debian/scripts/misc/kernelconfig
> > +++ b/debian/scripts/misc/kernelconfig
> > @@ -17,7 +17,7 @@ if [ -z "${gcc:-}" ] ; then
> >  fi
> >
> >  if [ ${#} -ne 1 ] ; then
> > -     echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs"
> > +     echo "Usage: $0
> updateconfigs|defaultconfigs|genconfigs|editconfigs"
> >       exit 2
> >  fi
> >
> > @@ -27,6 +27,7 @@ case "${mode}" in
> >       updateconfigs)  target="syncconfig" ;;
> >       defaultconfigs) target="olddefconfig" ;;
> >       genconfigs)     target="oldconfig" ;;
> > +     editconfigs)    ;;  # Target is set later based on user input
> >       *) echo "ERROR: Invalid mode: ${1}" >&2
> >          exit 1 ;;
> >  esac
> > @@ -77,6 +78,17 @@ EOF
> >               continue
> >       fi
> >
> > +     if [ "${mode}" = "editconfigs" ] ; then
> > +             while true ; do
> > +                     echo -n "Do you want to edit configs for
> ${arch}-${flavour}? [Y/n] "
> > +                     read -r choice
> > +                     case "${choice,,}" in
> > +                             y|"") target="menuconfig" ; break ;;
> > +                             n)    target="syncconfig" ; break ;;
> > +                     esac
> > +             done
> > +     fi
> > +
> >       rm -rf build
> >       mkdir build
> >
> > --
> > 2.34.1
> >
> >
> > --
> > kernel-team mailing list
> > kernel-team@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
Juerg Haefliger Jan. 25, 2023, 8:36 a.m. UTC | #3
On Tue, 24 Jan 2023 14:32:24 +0100
Andrea Righi <andrea.righi@canonical.com> wrote:

> On Tue, Jan 24, 2023 at 02:03:12PM +0100, Juerg Haefliger wrote:
> > With the switch to the new annotations-only mechanism and the new
> > annotations script, the 'editconfigs' target was dropped for some
> > reason. It's usefull so bring it back.  
> 
> I dropped ediconfigs, because it doesn't work in our build chroots
> (some packages are missing, like ncruses).

Yes. But I (and probably others) have local chroots that can be updated.

...Juerg

 
> I'm happy to bring it back, but we should also update our build chroots
> to support it, editing configs outside a build chroot environment can
> lead to incorrect configurations...
> 
> -Andrea
> 
> > 
> > Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> > ---
> >  debian/rules.d/1-maintainer.mk   |  3 ++-
> >  debian/scripts/misc/kernelconfig | 14 +++++++++++++-
> >  2 files changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
> > index 4d327ec3c478..239af468df5d 100644
> > --- a/debian/rules.d/1-maintainer.mk
> > +++ b/debian/rules.d/1-maintainer.mk
> > @@ -9,6 +9,7 @@ help:
> >  	@echo "  updateconfigs       : Update core arch configs"
> >  	@echo "  defaultconfigs      : Update core arch configs using defaults"
> >  	@echo "  genconfigs          : Generate core arch configs in CONFIGS/*"
> > +	@echo "  editconfigs         : Edit core arch configs"
> >  	@echo "  migrateconfigs      : Automatically import old configs into annotations"
> >  	@echo "  printchanges        : Print the current changelog entries (from git)"
> >  	@echo "  insertchanges       : Insert current changelog entries (from git)"
> > @@ -40,7 +41,7 @@ migrateconfigs:
> >  	fi
> >  	rm -rf build
> >  
> > -configs-targets := updateconfigs defaultconfigs genconfigs
> > +configs-targets := updateconfigs defaultconfigs genconfigs editconfigs
> >  
> >  .PHONY: $(configs-targets)
> >  $(configs-targets):
> > diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
> > index 0c412af2ec8e..555e5399bd8d 100755
> > --- a/debian/scripts/misc/kernelconfig
> > +++ b/debian/scripts/misc/kernelconfig
> > @@ -17,7 +17,7 @@ if [ -z "${gcc:-}" ] ; then
> >  fi
> >  
> >  if [ ${#} -ne 1 ] ; then
> > -	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs"
> > +	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs|editconfigs"
> >  	exit 2
> >  fi
> >  
> > @@ -27,6 +27,7 @@ case "${mode}" in
> >  	updateconfigs)  target="syncconfig" ;;
> >  	defaultconfigs) target="olddefconfig" ;;
> >  	genconfigs)     target="oldconfig" ;;
> > +	editconfigs)    ;;  # Target is set later based on user input
> >  	*) echo "ERROR: Invalid mode: ${1}" >&2
> >  	   exit 1 ;;
> >  esac
> > @@ -77,6 +78,17 @@ EOF
> >  		continue
> >  	fi
> >  
> > +	if [ "${mode}" = "editconfigs" ] ; then
> > +		while true ; do
> > +			echo -n "Do you want to edit configs for ${arch}-${flavour}? [Y/n] "
> > +			read -r choice
> > +			case "${choice,,}" in
> > +				y|"") target="menuconfig" ; break ;;
> > +				n)    target="syncconfig" ; break ;;
> > +			esac
> > +		done
> > +	fi
> > +
> >  	rm -rf build
> >  	mkdir build
> >  
> > -- 
> > 2.34.1
> > 
> > 
> > -- 
> > kernel-team mailing list
> > kernel-team@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
Andrea Righi Jan. 25, 2023, 12:40 p.m. UTC | #4
On Tue, Jan 24, 2023 at 02:03:12PM +0100, Juerg Haefliger wrote:
> With the switch to the new annotations-only mechanism and the new
> annotations script, the 'editconfigs' target was dropped for some
> reason. It's usefull so bring it back.
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>

Alright, after some clarifications it seems that it doesn't hurt
restoring this option as it was before, therefore: applied to
linux-unstable.

Thanks,
-Andrea
diff mbox series

Patch

diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 4d327ec3c478..239af468df5d 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -9,6 +9,7 @@  help:
 	@echo "  updateconfigs       : Update core arch configs"
 	@echo "  defaultconfigs      : Update core arch configs using defaults"
 	@echo "  genconfigs          : Generate core arch configs in CONFIGS/*"
+	@echo "  editconfigs         : Edit core arch configs"
 	@echo "  migrateconfigs      : Automatically import old configs into annotations"
 	@echo "  printchanges        : Print the current changelog entries (from git)"
 	@echo "  insertchanges       : Insert current changelog entries (from git)"
@@ -40,7 +41,7 @@  migrateconfigs:
 	fi
 	rm -rf build
 
-configs-targets := updateconfigs defaultconfigs genconfigs
+configs-targets := updateconfigs defaultconfigs genconfigs editconfigs
 
 .PHONY: $(configs-targets)
 $(configs-targets):
diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
index 0c412af2ec8e..555e5399bd8d 100755
--- a/debian/scripts/misc/kernelconfig
+++ b/debian/scripts/misc/kernelconfig
@@ -17,7 +17,7 @@  if [ -z "${gcc:-}" ] ; then
 fi
 
 if [ ${#} -ne 1 ] ; then
-	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs"
+	echo "Usage: $0 updateconfigs|defaultconfigs|genconfigs|editconfigs"
 	exit 2
 fi
 
@@ -27,6 +27,7 @@  case "${mode}" in
 	updateconfigs)  target="syncconfig" ;;
 	defaultconfigs) target="olddefconfig" ;;
 	genconfigs)     target="oldconfig" ;;
+	editconfigs)    ;;  # Target is set later based on user input
 	*) echo "ERROR: Invalid mode: ${1}" >&2
 	   exit 1 ;;
 esac
@@ -77,6 +78,17 @@  EOF
 		continue
 	fi
 
+	if [ "${mode}" = "editconfigs" ] ; then
+		while true ; do
+			echo -n "Do you want to edit configs for ${arch}-${flavour}? [Y/n] "
+			read -r choice
+			case "${choice,,}" in
+				y|"") target="menuconfig" ; break ;;
+				n)    target="syncconfig" ; break ;;
+			esac
+		done
+	fi
+
 	rm -rf build
 	mkdir build