installer: Further work on booting with host kernel, modified dracut

This commit is contained in:
Colin Walters 2012-02-08 17:34:08 -05:00
parent f30325ba3a
commit 2231bdac52
2 changed files with 31 additions and 3 deletions

View File

@ -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}"

View File

@ -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