diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2015-11-15 11:07:45 +0200 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2015-11-15 11:07:45 +0200 |
commit | 9f13d83639d16c3001338d0652a3eecc29a2056c (patch) | |
tree | 8c4f2778f173e404f1822b3c44f3a1a8b5d27011 /96boards-hikey-mainline-rebase.yaml | |
parent | ed32626e85beed53daf1203ceb579c100a1d55c1 (diff) |
96boards-hikey: add resize-rootfs service
1. Reduce sparse image size to fit the file generated by
linaro-media-create.
2. Add a oneshot resize-rootfs systemd service to
- fix GPT data structures
- resize rootfs partition
- disable the service itself
Change-Id: Ia9d89178b0349a210e4d62367b1ce69cc0b18bc3
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to '96boards-hikey-mainline-rebase.yaml')
-rw-r--r-- | 96boards-hikey-mainline-rebase.yaml | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/96boards-hikey-mainline-rebase.yaml b/96boards-hikey-mainline-rebase.yaml index 01332a19..371c6370 100644 --- a/96boards-hikey-mainline-rebase.yaml +++ b/96boards-hikey-mainline-rebase.yaml @@ -208,6 +208,21 @@ /dev/disk/by-partlabel/boot /boot/efi vfat defaults 0 0 EOF + cat << EOF | sudo tee rootfs/lib/systemd/system/resize-rootfs.service + [Unit] + Description=Resize rootfs to fit available disk space + After=systemd-remount-fs.service + + [Service] + Type=oneshot + ExecStart=-/bin/sh -c 'if /bin/grep -q "^HiKey" /proc/device-tree/model; then /sbin/sgdisk -e /dev/mmcblk0; /sbin/resize2fs /dev/disk/by-label/rootfs; fi' + ExecStartPost=/bin/systemctl disable resize-rootfs.service + + [Install] + WantedBy=default.target + EOF + (cd rootfs//etc/systemd/system/default.target.wants && sudo ln -sf /lib/systemd/system/resize-rootfs.service) + sudo rm -rf rootfs/dev rootfs/var/lib/apt/lists sudo mkdir rootfs/dev rootfs/var/lib/apt/lists rootfs/home/linaro/bin @@ -231,7 +246,7 @@ rm -rf wl18xx_fw # ******** TI wl18xx R8.6 - out of tree firmware ******** - sudo make_ext4fs -o -L rootfs -l 3056M -s out/hikey-jessie_${rootfs}_${VERSION}.emmc.img rootfs/ + sudo make_ext4fs -o -L rootfs -l 2G -s out/hikey-jessie_${rootfs}_${VERSION}.emmc.img rootfs/ sudo umount boot rootfs sudo kpartx -dv out/hikey-jessie_${rootfs}_${VERSION}.img sudo rm -rf boot rootfs |