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

Subscribers

People subscribed via source and target branches