yocto: Various misc cleanups to install scripts
Add a new gnomeos-update-branches.sh script which just does the work of checking out roots. This is useful if you e.g. make a local modification. Rename scripts to gnomeos-*.sh consistently. Tweak gnomeos-clone-qemu.sh script to support command line arguments (again).
This commit is contained in:
parent
11e3490337
commit
82847bba24
|
|
@ -79,7 +79,7 @@ if ! test -d ostree; then
|
||||||
$SRCDIR/ostree-setup.sh $(pwd)/ostree
|
$SRCDIR/ostree-setup.sh $(pwd)/ostree
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rsync -a -H -v ${WORKDIR}/repo ${WORKDIR}/modules ${WORKDIR}/gnomeos-3.4-* ./ostree
|
rsync -a -H -v ${WORKDIR}/repo ${WORKDIR}/current ${WORKDIR}/modules ${WORKDIR}/gnomeos-3.4-* ./ostree
|
||||||
|
|
||||||
current_uname=$(uname -r)
|
current_uname=$(uname -r)
|
||||||
|
|
||||||
|
|
@ -89,8 +89,9 @@ sync
|
||||||
umount fs
|
umount fs
|
||||||
rmdir fs
|
rmdir fs
|
||||||
|
|
||||||
|
ARGS="$@"
|
||||||
if ! echo $ARGS | grep -q 'ostree='; then
|
if ! echo $ARGS | grep -q 'ostree='; then
|
||||||
ARGS="ostree=${BRANCH_PREFIX}runtime-current $ARGS"
|
ARGS="ostree=current $ARGS"
|
||||||
fi
|
fi
|
||||||
ARGS="rd.plymouth=0 root=/dev/sda $ARGS"
|
ARGS="rd.plymouth=0 root=/dev/sda $ARGS"
|
||||||
KERNEL=/boot/vmlinuz-${current_uname}
|
KERNEL=/boot/vmlinuz-${current_uname}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ cd /ostree
|
||||||
if ! test -d /ostree/repo/objects; then
|
if ! test -d /ostree/repo/objects; then
|
||||||
mkdir -p /ostree
|
mkdir -p /ostree
|
||||||
|
|
||||||
$SRCDIR/ostree-setup.sh /ostree
|
$SRCDIR/gnomeos-setup.sh /ostree
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ostree --repo=repo remote add origin http://ostree.gnome.org/repo
|
ostree --repo=repo remote add origin http://ostree.gnome.org/repo
|
||||||
|
|
@ -54,17 +54,7 @@ ostree-pull --repo=repo origin gnomeos-3.4-i686-devel
|
||||||
|
|
||||||
uname=$(uname -r)
|
uname=$(uname -r)
|
||||||
|
|
||||||
for branch in runtime devel; do
|
$SRCDIR/gnomeos-update-branches.sh
|
||||||
rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch});
|
|
||||||
if ! test -d ${BRANCH_PREFIX}${branch}-${rev}; then
|
|
||||||
ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}
|
|
||||||
ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev}
|
|
||||||
fi
|
|
||||||
rm -f ${BRANCH_PREFIX}${branch}-current
|
|
||||||
ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current
|
|
||||||
done
|
|
||||||
rm -f current
|
|
||||||
ln -s ${BRANCH_PREFIX}runtime-current current
|
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
|
@ -87,6 +77,7 @@ fi
|
||||||
cp -ar /lib/modules/${uname} /ostree/modules/${uname}
|
cp -ar /lib/modules/${uname} /ostree/modules/${uname}
|
||||||
|
|
||||||
initrd_name=initramfs-ostree-${uname}.img
|
initrd_name=initramfs-ostree-${uname}.img
|
||||||
|
if ! test -f "/boot/${initrd_name}"; then
|
||||||
initrd_tmpdir=$(mktemp -d '/tmp/gnomeos-dracut.XXXXXXXXXX')
|
initrd_tmpdir=$(mktemp -d '/tmp/gnomeos-dracut.XXXXXXXXXX')
|
||||||
linux-user-chroot \
|
linux-user-chroot \
|
||||||
--mount-readonly / \
|
--mount-readonly / \
|
||||||
|
|
@ -99,3 +90,4 @@ linux-user-chroot \
|
||||||
dracut -f /tmp/${initrd_name} "${uname}"
|
dracut -f /tmp/${initrd_name} "${uname}"
|
||||||
mv "${initrd_tmpdir}/${initrd_name}" "/boot/${initrd_name}"
|
mv "${initrd_tmpdir}/${initrd_name}" "/boot/${initrd_name}"
|
||||||
rm -rf "${initrd_tmpdir}"
|
rm -rf "${initrd_tmpdir}"
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2011,2012 Colin Walters <walters@verbum.org>
|
||||||
|
#
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Lesser General Public
|
||||||
|
# License as published by the Free Software Foundation; either
|
||||||
|
# version 2 of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This library 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
|
||||||
|
# Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public
|
||||||
|
# License along with this library; if not, write to the
|
||||||
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
# Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
ARCH=i686
|
||||||
|
BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
|
||||||
|
|
||||||
|
test -d repo || exit 1
|
||||||
|
|
||||||
|
for branch in runtime devel; do
|
||||||
|
rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch});
|
||||||
|
if ! test -d ${BRANCH_PREFIX}${branch}-${rev}; then
|
||||||
|
ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}
|
||||||
|
ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev}
|
||||||
|
cp -ar /lib/modules/${uname} ${BRANCH_PREFIX}${branch}-${rev}/lib/modules/${uname}
|
||||||
|
fi
|
||||||
|
ln -sf ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current.new
|
||||||
|
mv ${BRANCH_PREFIX}${branch}-current{.new,}
|
||||||
|
done
|
||||||
|
ln -sf ${BRANCH_PREFIX}runtime-current current.new
|
||||||
|
mv current.new current
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
|
|
||||||
#
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
if test $(id -u) = 0; then
|
|
||||||
cat <<EOF
|
|
||||||
This script should not be run as root.
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
mkdir gnomeos-fs
|
|
||||||
cd gnomeos-fs
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue