gnomeos: More tweaks to install/run scripts

The run script now allows using the current kernel+initrd.
This commit is contained in:
Colin Walters 2012-02-04 10:46:00 -05:00
parent 1aaf74651b
commit 4de5a36b24
3 changed files with 43 additions and 13 deletions

View File

@ -40,12 +40,21 @@ usage () {
ARCH=i686 ARCH=i686
BRANCH_PREFIX="gnomeos-3.4-${ARCH}-" BRANCH_PREFIX="gnomeos-3.4-${ARCH}-"
if ! test -d /ostree; then if ! test -d /ostree/repo/objects; then
mkdir /ostree mkdir -p /ostree
$SRCDIR/ostree-setup.sh /ostree $SRCDIR/ostree-setup.sh /ostree
fi 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 cd /ostree
for branch in runtime devel; do for branch in runtime devel; do
rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch}); rev=$(ostree --repo=$(pwd)/repo rev-parse ${BRANCH_PREFIX}${branch});
@ -60,5 +69,13 @@ rm -f current
ln -s ${BRANCH_PREFIX}runtime-current current ln -s ${BRANCH_PREFIX}runtime-current current
cp -a ./${BRANCH_PREFIX}${branch}-current/usr/sbin/ostree-init . 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

View File

@ -40,6 +40,8 @@ usage () {
OSTREE_REPO=$1 OSTREE_REPO=$1
shift shift
test -n "$OSTREE_REPO" || usage test -n "$OSTREE_REPO" || usage
TYPE=$1
shift
ARCH=i686 ARCH=i686
BRANCH_PREFIX="gnomeos-3.4-${ARCH}-" 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 for branch in runtime devel; do
rev=$(ostree --repo=repo rev-parse ${BRANCH_PREFIX}${branch}); rev=$(ostree --repo=repo rev-parse ${BRANCH_PREFIX}${branch});
if ! test -d ${BRANCH_PREFIX}${branch}-${rev}; then if ! test -d ${BRANCH_PREFIX}${branch}-${rev}; then
ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev} ostree --repo=repo checkout ${rev} ${BRANCH_PREFIX}${branch}-${rev}.tmp
ostbuild chroot-run-triggers ${BRANCH_PREFIX}${branch}-${rev} 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 fi
rm -f ${BRANCH_PREFIX}${branch}-current rm -f ${BRANCH_PREFIX}${branch}-current
ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current
@ -117,15 +123,22 @@ sync
umount fs umount fs
rmdir fs rmdir fs
ARGS="$@" ARGS="rd.plymouth=0 $@"
if ! echo $ARGS | grep -q 'init='; then if ! echo $ARGS | grep -q 'init='; then
ARGS="init=/ostree-init $ARGS" ARGS="init=/ostree-init $ARGS"
fi fi
if ! echo $ARGS | grep -q 'root='; then
ARGS="root=/dev/hda $ARGS"
fi
if ! echo $ARGS | grep -q 'ostree='; then if ! echo $ARGS | grep -q 'ostree='; then
ARGS="ostree=${BRANCH_PREFIX}runtime-current $ARGS" ARGS="ostree=${BRANCH_PREFIX}runtime-current $ARGS"
fi 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

View File

@ -52,9 +52,6 @@ chown 2:2 ./var/lib/gdm
touch ./var/shadow touch ./var/shadow
chmod 0600 ./var/shadow chmod 0600 ./var/shadow
mkdir repo
ostree --repo=repo init
cat >./var/passwd << EOF cat >./var/passwd << EOF
root::0:0:root:/:/bin/sh root::0:0:root:/:/bin/sh
dbus:*:1:1:dbus:/:/bin/false dbus:*:1:1:dbus:/:/bin/false
@ -65,3 +62,6 @@ root:*:0:root
dbus:*:1: dbus:*:1:
gdm:*:2: gdm:*:2:
EOF EOF
mkdir repo
ostree --repo=repo init