From 6a49bc67b3fc5073612195510d556129bfdd28bb Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 1 Jan 2015 00:25:54 +0000 Subject: Add some checks to the sysroot deployment extension Ensure that a) the deployment directory must not exist b) the extension can not be used to upgrade a system --- sysroot.check | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 sysroot.check (limited to 'sysroot.check') diff --git a/sysroot.check b/sysroot.check new file mode 100755 index 00000000..bfacd3fc --- /dev/null +++ b/sysroot.check @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (C) 2015 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# Preparatory checks for Morph 'sysroot' write extension + +set -eu + +location="$1" +if [ -d "$location" ]; then + echo >&2 "ERROR: Deployment directory already exists: $location" + exit 1 +fi + +if [ "$UPGRADE" == "yes" ]; then + echo >&2 "ERROR: Cannot upgrade a sysroot deployment" + exit 1 +fi -- cgit v1.2.1 From ed741d8d090086e2380f7b9d68ddc3bd122acb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Fri, 13 Mar 2015 18:18:55 +0000 Subject: Use the modern way of the GPL copyright header: URL instead real address Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0 --- sysroot.check | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sysroot.check') diff --git a/sysroot.check b/sysroot.check index bfacd3fc..8ed965bd 100755 --- a/sysroot.check +++ b/sysroot.check @@ -11,8 +11,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# with this program. If not, see . # Preparatory checks for Morph 'sysroot' write extension -- cgit v1.2.1 From 7c360ce448114dd626661e688e0aad3b3754f302 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 29 Apr 2015 15:47:28 +0000 Subject: Fix sysroot.write trying to overwrite existing files Commit 807e6a90876c5469d242 changed the behaviour of sysroot.write to avoid deleting the contents of the sysroot. This was done so if you accidentally set 'sysroot=/' it wouldn't delete your whole system. It turns out that SDK deployments like clusters/sdk-example-cluster.morph depended on the contents of the directory being deleted. The system armv7lhf-cross-toolchain-system-x86_64.morph has a bunch of files installed by the cross-toolchain in /usr/armv7lhf-baserock-linux-gnueabi/sys-root. Previously sysroot.write would delete these, but since commit 807e6a90876c5469d242 it would fail with several errors like: mv: can't rename '/src/tmp/deployments/usr/armv7l.../sys-root/sbin' If we use 'cp -a' instead of 'mv' then it is slower to deploy, but there are no errors. I am still unsure why files from the cross-toolchain system are installed and then deleted. Although this patch fixes the immediate issue, I don't know if it's the right thing to do. It seems better to not install those files in the first place, if we do not need them. This commit also removes the check for the sysroot target location being empty. This doesn't work, because it runs /before/ the system being deployed is unpacked. Change-Id: I10671c2f3b2060cfb36f880675b83351c6cdd807 --- sysroot.check | 6 ------ 1 file changed, 6 deletions(-) (limited to 'sysroot.check') diff --git a/sysroot.check b/sysroot.check index 8ed965bd..71b35175 100755 --- a/sysroot.check +++ b/sysroot.check @@ -17,12 +17,6 @@ set -eu -location="$1" -if [ -d "$location" ]; then - echo >&2 "ERROR: Deployment directory already exists: $location" - exit 1 -fi - if [ "$UPGRADE" == "yes" ]; then echo >&2 "ERROR: Cannot upgrade a sysroot deployment" exit 1 -- cgit v1.2.1