[ostree] installer: Further work on booting with host kernel, modified dracut
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] installer: Further work on booting with host kernel, modified dracut
- Date: Wed, 8 Feb 2012 22:35:18 +0000 (UTC)
commit 2231bdac5209babdf0e4b0950cdbc173ce6e201a
Author: Colin Walters <walters verbum org>
Date: Wed Feb 8 17:34:08 2012 -0500
installer: Further work on booting with host kernel, modified dracut
gnomeos/yocto/gnomeos-install.sh | 24 ++++++++++++++++++++++++
gnomeos/yocto/gnomeos-run.sh | 10 +++++++---
2 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/gnomeos/yocto/gnomeos-install.sh b/gnomeos/yocto/gnomeos-install.sh
index 613d9c5..b9621f6 100755
--- a/gnomeos/yocto/gnomeos-install.sh
+++ b/gnomeos/yocto/gnomeos-install.sh
@@ -55,12 +55,15 @@ EOF
exit 1
fi
+uname=$(uname -r)
+
cd /ostree
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
rm -f ${BRANCH_PREFIX}${branch}-current
ln -s ${BRANCH_PREFIX}${branch}-${rev} ${BRANCH_PREFIX}${branch}-current
@@ -79,3 +82,24 @@ 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
+
+kernel=/boot/vmlinuz-${uname}
+if ! test -f "${kernel}"; then
+ cat <<EOF
+ Kernel does not exist: ${kernel}
+EOF
+ exit 1
+fi
+initrd_name=initramfs-ostree-${uname}.img
+initrd_tmpdir=$(mktemp -d '/tmp/gnomeos-dracut.XXXXXXXXXX')
+linux-user-chroot \
+ --mount-readonly / \
+ --mount-proc /proc \
+ --mount-bind /dev /dev \
+ --mount-bind /ostree/var /var \
+ --mount-bind ${initrd_tmpdir} /tmp \
+ --mount-bind /lib/modules/${uname} /lib/modules/${uname} \
+ /ostree/${BRANCH_PREFIX}devel-current \
+ dracut -f /tmp/${initrd_name} "${uname}"
+mv "${initrd_tmpdir}/${initrd_name}" "/boot/${initrd_name}"
+rm -rf $"{initrd_tmpdir}"
diff --git a/gnomeos/yocto/gnomeos-run.sh b/gnomeos/yocto/gnomeos-run.sh
index 9fede71..deb4389 100755
--- a/gnomeos/yocto/gnomeos-run.sh
+++ b/gnomeos/yocto/gnomeos-run.sh
@@ -97,6 +97,10 @@ gdm:*:2:
EOF
fi
+if test x${TYPE} = xcurrent; then
+ current_uname=$(uname -r)
+fi
+
cd ostree
ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_PREFIX}devel
for branch in runtime devel; do
@@ -105,7 +109,7 @@ for branch in runtime devel; do
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
+ cp -ar /lib/modules/${current_uname} ${BRANCH_PREFIX}${branch}-${rev}.tmp/lib/modules
fi
mv ${BRANCH_PREFIX}${branch}-${rev}{.tmp,}
fi
@@ -136,8 +140,8 @@ if test x$TYPE = xqemu; then
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"
+ KERNEL=/boot/vmlinuz-${current_uname}
+ INITRD_ARG="-initrd /boot/initramfs-ostree-${current_uname}.img"
fi
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]