diff mbox series

[v2] deb to snap: use apt-pinning to install just the kernel from -proposed

Message ID 1507305247-20239-1-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series [v2] deb to snap: use apt-pinning to install just the kernel from -proposed | expand

Commit Message

Paolo Pisati Oct. 6, 2017, 3:54 p.m. UTC
In the target kernel branch (e.g. pc-kernel), enable the proposed
repository and point the kernel version to the one present
in proposed:

Comments

Kleber Sacilotto de Souza Oct. 6, 2017, 4:12 p.m. UTC | #1
On 10/06/2017 05:54 PM, Paolo Pisati wrote:
> In the target kernel branch (e.g. pc-kernel), enable the proposed
> repository and point the kernel version to the one present
> in proposed:
>
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -1,5 +1,5 @@
>  name: pc-kernel
> -version: 4.4.0.96.101
> +version: 4.4.0.97.102
>  summary: generic linux kernel
>  description: The generic Ubuntu kernel package as a snap
>  type: kernel
> @@ -13,6 +13,7 @@ parts:
>      plugin: make
>      make-parameters:
>        - KERNEL=linux-pc-image
> +      - PROPOSED=true
>      build-packages:
>        - debootstrap
>        - lsb-release
>
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  Makefile | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 98c5a48..2dc47ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -25,6 +25,24 @@ $(error linux-pc-image is a meta package only used in i386 or amd64, abort)
>  endif
>  endif
>
> +define APTPREF
> +Package: *
> +Pin: release a=$(RELEASE);
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-updates
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-security
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-proposed
> +Pin-Priority: 650
> +endef
> +export APTPREF
>
>  install : KVERS = $(shell ls -1 chroot/boot/vmlinuz-*| tail -1 |sed 's/^.*vmlinuz-//;s/.efi.signed$$//')
>
> @@ -35,6 +53,7 @@ all:
>  	if [ "$(PROPOSED)" = "true" ]; then \
>  	  echo "deb http://$(MIRROR) $(RELEASE)-proposed main restricted" >> chroot/etc/apt/sources.list; \
>  	  echo "deb http://$(MIRROR) $(RELEASE)-proposed universe" >> chroot/etc/apt/sources.list; \
> +	  echo "$${APTPREF}" > chroot/etc/apt/preferences.d/01proposedkernel; \
>  	fi
>  	mkdir -p chroot/etc/initramfs-tools/conf.d
>  	echo "COMPRESS=lzma" >chroot/etc/initramfs-tools/conf.d/ubuntu-core.conf
>
Stefan Bader Oct. 9, 2017, 9:11 a.m. UTC | #2
On 06.10.2017 17:54, Paolo Pisati wrote:
> In the target kernel branch (e.g. pc-kernel), enable the proposed
> repository and point the kernel version to the one present
> in proposed:
> 
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -1,5 +1,5 @@
>  name: pc-kernel
> -version: 4.4.0.96.101
> +version: 4.4.0.97.102
>  summary: generic linux kernel
>  description: The generic Ubuntu kernel package as a snap
>  type: kernel
> @@ -13,6 +13,7 @@ parts:
>      plugin: make
>      make-parameters:
>        - KERNEL=linux-pc-image
> +      - PROPOSED=true
>      build-packages:
>        - debootstrap
>        - lsb-release
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---
>  Makefile | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 98c5a48..2dc47ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -25,6 +25,24 @@ $(error linux-pc-image is a meta package only used in i386 or amd64, abort)
>  endif
>  endif
>  
> +define APTPREF
> +Package: *
> +Pin: release a=$(RELEASE);
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-updates
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-security
> +Pin-Priority: 700
> +
> +Package: *
> +Pin: release a=$(RELEASE)-proposed
> +Pin-Priority: 650
> +endef
> +export APTPREF
>  
>  install : KVERS = $(shell ls -1 chroot/boot/vmlinuz-*| tail -1 |sed 's/^.*vmlinuz-//;s/.efi.signed$$//')
>  
> @@ -35,6 +53,7 @@ all:
>  	if [ "$(PROPOSED)" = "true" ]; then \
>  	  echo "deb http://$(MIRROR) $(RELEASE)-proposed main restricted" >> chroot/etc/apt/sources.list; \
>  	  echo "deb http://$(MIRROR) $(RELEASE)-proposed universe" >> chroot/etc/apt/sources.list; \
> +	  echo "$${APTPREF}" > chroot/etc/apt/preferences.d/01proposedkernel; \
>  	fi
>  	mkdir -p chroot/etc/initramfs-tools/conf.d
>  	echo "COMPRESS=lzma" >chroot/etc/initramfs-tools/conf.d/ubuntu-core.conf
>
Kleber Sacilotto de Souza Oct. 9, 2017, 9:21 a.m. UTC | #3
Applied to linux-snap/xenial/master branch. Thanks.
diff mbox series

Patch

--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,5 +1,5 @@ 
 name: pc-kernel
-version: 4.4.0.96.101
+version: 4.4.0.97.102
 summary: generic linux kernel
 description: The generic Ubuntu kernel package as a snap
 type: kernel
@@ -13,6 +13,7 @@  parts:
     plugin: make
     make-parameters:
       - KERNEL=linux-pc-image
+      - PROPOSED=true
     build-packages:
       - debootstrap
       - lsb-release

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 Makefile | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Makefile b/Makefile
index 98c5a48..2dc47ca 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,24 @@  $(error linux-pc-image is a meta package only used in i386 or amd64, abort)
 endif
 endif
 
+define APTPREF
+Package: *
+Pin: release a=$(RELEASE);
+Pin-Priority: 700
+
+Package: *
+Pin: release a=$(RELEASE)-updates
+Pin-Priority: 700
+
+Package: *
+Pin: release a=$(RELEASE)-security
+Pin-Priority: 700
+
+Package: *
+Pin: release a=$(RELEASE)-proposed
+Pin-Priority: 650
+endef
+export APTPREF
 
 install : KVERS = $(shell ls -1 chroot/boot/vmlinuz-*| tail -1 |sed 's/^.*vmlinuz-//;s/.efi.signed$$//')
 
@@ -35,6 +53,7 @@  all:
 	if [ "$(PROPOSED)" = "true" ]; then \
 	  echo "deb http://$(MIRROR) $(RELEASE)-proposed main restricted" >> chroot/etc/apt/sources.list; \
 	  echo "deb http://$(MIRROR) $(RELEASE)-proposed universe" >> chroot/etc/apt/sources.list; \
+	  echo "$${APTPREF}" > chroot/etc/apt/preferences.d/01proposedkernel; \
 	fi
 	mkdir -p chroot/etc/initramfs-tools/conf.d
 	echo "COMPRESS=lzma" >chroot/etc/initramfs-tools/conf.d/ubuntu-core.conf