[ostree] gnomeos: More tweaks to install/run scripts
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] gnomeos: More tweaks to install/run scripts
- Date: Sat, 4 Feb 2012 15:47:13 +0000 (UTC)
commit 4de5a36b243a2be95d3766eda341a35fd918e1cb
Author: Colin Walters <walters verbum org>
Date: Sat Feb 4 10:46:00 2012 -0500
gnomeos: More tweaks to install/run scripts
The run script now allows using the current kernel+initrd.
gnomeos/yocto/gnomeos-install.sh | 23 ++++++++++++++++++++---
gnomeos/yocto/gnomeos-run.sh | 27 ++++++++++++++++++++-------
gnomeos/yocto/ostree-setup.sh | 6 +++---
3 files changed, 43 insertions(+), 13 deletions(-)
---
diff --git a/gnomeos/yocto/gnomeos-install.sh b/gnomeos/yocto/gnomeos-install.sh
index 8d906e3..613d9c5 100755
--- a/gnomeos/yocto/gnomeos-install.sh
+++ b/gnomeos/yocto/gnomeos-install.sh
@@ -40,12 +40,21 @@ usage () {
ARCH=i686
BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
-if ! test -d /ostree; then
- mkdir /ostree
+if ! test -d /ostree/repo/objects; then
+ mkdir -p /ostree
$SRCDIR/ostree-setup.sh /ostree
fi
+#ostree pull http://ostree.gnome.org/3.4/repo gnomeos-3.4-i686-{runtime,devel}
+if ! test -f /ostree/repo/refs/heads/gnomeos-3.4-i686-runtime; then
+ cat <<EOF
+You must get a repo from somewhere...e.g.:
+ cd /ostree && rsync --progress -ave ssh master.gnome.org:/home/users/walters/ostree/repo .
+EOF
+ exit 1
+fi
+
cd /ostree
for branch in runtime devel; do
rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch});
@@ -60,5 +69,13 @@ rm -f current
ln -s ${BRANCH_PREFIX}runtime-current current
cp -a ./${BRANCH_PREFIX}${branch}-current/usr/sbin/ostree-init .
+cd -
-cp $SRCDIR/15_ostree /etc/grub.d/
+if test -d /etc/grub.d; then
+ cp $SRCDIR/15_ostree /etc/grub.d/
+else
+ cat <<EOF
+GRUB 2 not detected; you'll need to edit e.g. /boot/grub/grub.conf manually
+Kernel has been installed as /boot/bzImage-gnomeos.bin
+EOF
+fi
diff --git a/gnomeos/yocto/gnomeos-run.sh b/gnomeos/yocto/gnomeos-run.sh
index b0ae93e..9fede71 100755
--- a/gnomeos/yocto/gnomeos-run.sh
+++ b/gnomeos/yocto/gnomeos-run.sh
@@ -40,6 +40,8 @@ usage () {
OSTREE_REPO=$1
shift
test -n "$OSTREE_REPO" || usage
+TYPE=$1
+shift
ARCH=i686
BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
@@ -100,8 +102,12 @@ ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_P
for branch in runtime devel; do
rev=$(ostree --repo=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}
+ ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}.tmp
+ ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev}.tmp
+ if test x$TYPE = xcurrent; then
+ cp -ar /lib/modules/`uname -r` ${BRANCH_PREFIX}${branch}-${rev}.tmp/lib/modules
+ fi
+ mv ${BRANCH_PREFIX}${branch}-${rev}{.tmp,}
fi
rm -f ${BRANCH_PREFIX}${branch}-current
ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current
@@ -117,15 +123,22 @@ sync
umount fs
rmdir fs
-ARGS="$@"
+ARGS="rd.plymouth=0 $@"
if ! echo $ARGS | grep -q 'init='; then
ARGS="init=/ostree-init $ARGS"
fi
-if ! echo $ARGS | grep -q 'root='; then
- ARGS="root=/dev/hda $ARGS"
-fi
if ! echo $ARGS | grep -q 'ostree='; then
ARGS="ostree=${BRANCH_PREFIX}runtime-current $ARGS"
fi
+if test x$TYPE = xqemu; then
+ ARGS="root=/dev/hda $ARGS"
+ KERNEL=./tmp-eglibc/deploy/images/bzImage-qemux86.bin
+else
+ if test x$TYPE = xcurrent; then
+ ARGS="root=/dev/sda $ARGS"
+ KERNEL=/boot/vmlinuz-`uname -r`
+ INITRD_ARG="-initrd /boot/initramfs-`uname -r`.img"
+ fi
+fi
-exec qemu-kvm -kernel ./tmp-eglibc/deploy/images/bzImage-qemux86.bin -hda gnomeos-fs.img -net user -net nic,model=virtio -m 512M -append "$ARGS" -monitor stdio
+exec qemu-kvm -kernel ${KERNEL} ${INITRD_ARG} -hda gnomeos-fs.img -net user -net nic,model=virtio -m 512M -append "$ARGS" -monitor stdio
diff --git a/gnomeos/yocto/ostree-setup.sh b/gnomeos/yocto/ostree-setup.sh
index 584c3a9..fa14d8d 100755
--- a/gnomeos/yocto/ostree-setup.sh
+++ b/gnomeos/yocto/ostree-setup.sh
@@ -52,9 +52,6 @@ chown 2:2 ./var/lib/gdm
touch ./var/shadow
chmod 0600 ./var/shadow
-mkdir repo
-ostree --repo=repo init
-
cat >./var/passwd << EOF
root::0:0:root:/:/bin/sh
dbus:*:1:1:dbus:/:/bin/false
@@ -65,3 +62,6 @@ root:*:0:root
dbus:*:1:
gdm:*:2:
EOF
+
+mkdir repo
+ostree --repo=repo init
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]