parallel-debian: Add install and run scripts
This commit is contained in:
parent
8af2c6fbb8
commit
0f09ccea22
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# -*- indent-tabs-mode: nil; -*-
|
||||||
|
# Install built ostree image to current system
|
||||||
|
#
|
||||||
|
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
|
||||||
|
#
|
||||||
|
# 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; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
SRCDIR=`dirname $0`
|
||||||
|
WORKDIR=`pwd`
|
||||||
|
|
||||||
|
OBJ=gnomeos-initrd.img
|
||||||
|
if ! test -f ${OBJ}; then
|
||||||
|
echo "Error: couldn't find '$OBJ'. Run gnomeos-make-image.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d /ostree; then
|
||||||
|
echo "/ostree already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p fs
|
||||||
|
umount fs || true
|
||||||
|
mount -o loop gnomeos-filesystem.img fs
|
||||||
|
cp -a fs/ostree /
|
||||||
|
umount fs
|
||||||
|
initrd=`readlink gnomeos-initrd.img`
|
||||||
|
cp ${initrd} /boot
|
||||||
|
grubby --title "GNOME OS" --add-kernel=$kernel --copy-default --initrd=/boot/${initrd}
|
||||||
|
|
@ -24,7 +24,7 @@ set -x
|
||||||
SRCDIR=`dirname $0`
|
SRCDIR=`dirname $0`
|
||||||
WORKDIR=`pwd`
|
WORKDIR=`pwd`
|
||||||
|
|
||||||
DEPENDS="debootstrap qemu-img"
|
DEPENDS="debootstrap qemu-img grubby"
|
||||||
|
|
||||||
for x in $DEPENDS; do
|
for x in $DEPENDS; do
|
||||||
if ! command -v $x; then
|
if ! command -v $x; then
|
||||||
|
|
@ -133,9 +133,14 @@ fi
|
||||||
|
|
||||||
cp ${SRCDIR}/ostree_switch_root ${WORKDIR}
|
cp ${SRCDIR}/ostree_switch_root ${WORKDIR}
|
||||||
|
|
||||||
|
kernel=`grubby --default-kernel`
|
||||||
|
kv=$(basename $kernel | sed -e s,vmlinuz-,,)
|
||||||
|
|
||||||
OBJ=gnomeos-initrd.img
|
OBJ=gnomeos-initrd.img
|
||||||
|
VOBJ=gnomeos-initrd-${kv}.img
|
||||||
if ! test -f ${OBJ}; then
|
if ! test -f ${OBJ}; then
|
||||||
rm -f ${OBJ}.tmp
|
rm -f ${OBJ}.tmp ${VOBJ}.tmp
|
||||||
$DRACUT -l -v --include `pwd`/ostree_switch_root /sbin/ostree_switch_root ${OBJ}.tmp
|
$DRACUT -l -v --include `pwd`/ostree_switch_root /sbin/ostree_switch_root ${VOBJ}.tmp
|
||||||
mv ${OBJ}.tmp ${OBJ}
|
mv ${VOBJ}.tmp ${VOBJ}
|
||||||
|
ln -sf ${VOBJ} gnomeos-initrd.img
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# -*- indent-tabs-mode: nil; -*-
|
||||||
|
# Run built image in QEMU
|
||||||
|
#
|
||||||
|
# Copyright (C) 2011 Colin Walters <walters@verbum.org>
|
||||||
|
#
|
||||||
|
# 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; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
SRCDIR=`dirname $0`
|
||||||
|
WORKDIR=`pwd`
|
||||||
|
|
||||||
|
OBJ=gnomeos-initrd.img
|
||||||
|
if ! test -f ${OBJ}; then
|
||||||
|
echo "Error: couldn't find '$OBJ'. Run gnomeos-make-image.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
umount fs || true
|
||||||
|
exec qemu-kvm -kernel `grubby --default-kernel` -initrd gnomeos-initrd.img -hda gnomeos-filesystem.img -append "root=/dev/sda ostree=current"
|
||||||
Loading…
Reference in New Issue