Merge lp:~snappy-dev/livecd-rootfs/core_update into lp:livecd-rootfs

Proposed by Sergio Schvezov
Status: Merged
Merged at revision: 1089
Proposed branch: lp:~snappy-dev/livecd-rootfs/core_update
Merge into: lp:livecd-rootfs
Diff against target: 65 lines (+37/-2)
1 file modified
live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary (+37/-2)
To merge this branch: bzr merge lp:~snappy-dev/livecd-rootfs/core_update
Reviewer Review Type Date Requested Status
Michael Vogt (community) Needs Fixing
Review via email: mp+250245@code.launchpad.net

Description of the change

This is my initial proposal.

Some thoughts that I've had:
- MLO, u-boot and uEnv.txt are missing here for the bbb, if this goes to the oem part, do we plan to "live" install those or is this a bootstrap only thing; if it becomes part of the oem part it will be on disk wasting space.
- Maybe an intermediate solution for the bbb case is to do something like the click sync hook in livecd-rootfs to copy over the MLO, u-boot and uEnv.txt to not break compatibility.
- My preference would be for u-d-f to have a mapping to flash assets on p.c.c/~platform/snappy/devices (by default with an override).
- Maybe the kernel and initrd entry need to be removed from hardware.yaml, they make little sense and can lie in ./boot/

I haven't really tested this code, have been failing gracefully trying to run this locally.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

This fails unfortunately with:
"""
[2015-03-25 14:19:26] lb_binary_hooks
P: Begin executing hooks...
+ echo I: Remove unneeded files from /usr/share/doc
I: Remove unneeded files from /usr/share/doc
+ find binary/boot/filesystem.dir/usr/share/doc -depth -type f ! -name copyright
+ xargs rm -f
+ + findxargs binary/boot/filesystem.dir/usr/share/doc rmdir
 -empty
+ find binary/boot/filesystem.dir/usr/share/doc -type f -exec gzip -9 {} ;
+ echo I: Remove man/info pages
I: Remove man/info pages
+ rm -rf binary/boot/filesystem.dir/usr/share/man binary/boot/filesystem.dir/usr/share/groff binary/boot/filesystem.dir/usr/share/info binary/boot/filesystem.dir/usr/share/lintian binary/boot/filesystem.dir/usr/share/linda binary/boot/filesystem.dir/var/cache/man
+ echo I: Removing /var/lib/apt/lists/*
I: Removing /var/lib/apt/lists/*
+ find binary/boot/filesystem.dir/var/lib/apt/lists/ -type f
+ xargs rm -f
+ echo I: Removing /var/cache/apt/*.bin
I: Removing /var/cache/apt/*.bin
+ rm -f binary/boot/filesystem.dir/var/cache/apt/pkgcache.bin binary/boot/filesystem.dir/var/cache/apt/srcpkgcache.bin
+ echo I: Creating warning to use snappy when apt-get is used
I: Creating warning to use snappy when apt-get is used
+ PREFIX=binary/boot/filesystem.dir
+ mkdir -p binary/boot/filesystem.dir/usr/local/bin
+ cat
+ chmod 755 binary/boot/filesystem.dir/usr/local/bin/no-apt
+ ln -s no-apt binary/boot/filesystem.dir/usr/local/bin/apt
+ ln -s no-apt binary/boot/filesystem.dir/usr/local/bin/apt-cache
+ ln -s no-apt binary/boot/filesystem.dir/usr/local/bin/apt-get
I: Moving kernel into device tarball
cp: with --parents, the destination must be a directory
Try 'cp --help' for more information.
E: config/hooks/500-move-kernel-to-device-tar.binary failed (exit non-zero). You should check for errors.
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists...
Building dependency tree...
Reading state information...
Traceback (most recent call last):
  File "/usr/share/launchpad-buildd/slavebin/buildlivefs", line 198, in main
    builder.build()
  File "/usr/share/launchpad-buildd/slavebin/buildlivefs", line 159, in build
    self.run_build_command(["lb", "build"], env=base_lb_env)
  File "/usr/share/launchpad-buildd/slavebin/buildlivefs", line 108, in run_build_command
    self.chroot(["/bin/sh", "-c", command], echo=echo)
  File "/usr/share/launchpad-buildd/slavebin/buildlivefs", line 89, in chroot
    "/usr/bin/sudo", "/usr/sbin/chroot", self.chroot_path] + args)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
""""

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary'
--- live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary 2014-11-24 07:38:21 +0000
+++ live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary 2015-02-19 01:40:19 +0000
@@ -8,17 +8,51 @@
88
9HERE="$(pwd)"9HERE="$(pwd)"
10TMPDIR="$(mktemp -d)"10TMPDIR="$(mktemp -d)"
11ARCH=$(dpkg --print-architecture)
11mkdir -p $TMPDIR/system/12mkdir -p $TMPDIR/system/
13mkdir -p $TMPDIR/assets/
1214
13# cp files, we can't simply use tar --transform as it changes the symlink target15# cp files, we can't simply use tar --transform as it changes the symlink target
14(16(
15 cd binary/boot/filesystem.dir 17 cd binary/boot/filesystem.dir
16 cp -ar --parent boot/vmlinu?-* boot/initrd.img-* boot/abi-* boot/System.map-* $TMPDIR/system/18 cp -ar --parent boot/vmlinu?-* $TMPDIR/assets/vmlinuz
19 cp -ar --parent boot/initrd.img-* $TMPDIR/assets/initrd.img
20 cp -ar --parent boot/vmlinu?-* boot/initrd.img-* boot/abi-* boot/System.map-* $TMPDIR/assets/
17 cp -ar --parent lib/modules/ $TMPDIR/system/21 cp -ar --parent lib/modules/ $TMPDIR/system/
22
23 dtbs=$(find /lib/firmware -type d -name 'device-tree' -print0)
24 [ -n "$dtbs" ] && mv "$dtbs" $TMPDIR/assets/dtbs
25
26 cp -ar --parent lib/firmware/ $TMPDIR/system/
27
18 if [ -e vmlinu? ] && [ -e initrd.img ]; then28 if [ -e vmlinu? ] && [ -e initrd.img ]; then
19 cp -ar --parent vmlinu? initrd.img $TMPDIR/system29 cp -ar --parent vmlinu? initrd.img $TMPDIR/assets
30 cp -ar --parent vmlinu? initrd.img $TMPDIR/assets
20 fi31 fi
21)32)
33# create hardware.yaml for u-boot
34# this assumes armh == u-boot
35# and all others grub
36(
37# common bits
38 cat > $TMPDIR/hardware.yaml << EOF
39kernel: assets/vmlinuz
40initrd: assets/initrd.img
41partiton-layout: system-AB
42EOF
43
44# arch specific ones
45if [ "$ARCH" = "armhf" ]; then
46 cat >> $TMPDIR/hardware.yaml << EOF
47dtbs: assets/dtbs
48bootloader: u-boot
49EOF
50else
51 cat >> $TMPDIR/hardware.yaml << EOF
52bootloader: grub
53EOF
54)
55
22# and tar it up56# and tar it up
23(57(
24 cd $TMPDIR58 cd $TMPDIR
@@ -58,6 +92,7 @@
58 rm -f initrd.img92 rm -f initrd.img
59 rm -f vmlinu?93 rm -f vmlinu?
60 rm -rf lib/modules94 rm -rf lib/modules
95 rm -rf lib/firmware
61 # remove walinuxagent96 # remove walinuxagent
62 if [ -e var/lib/dpkg/info/walinuxagent.list ]; then97 if [ -e var/lib/dpkg/info/walinuxagent.list ]; then
63 chroot . dpkg --purge walinuxagent || true98 chroot . dpkg --purge walinuxagent || true

Subscribers

People subscribed via source and target branches