]>
Raphaƫl G. Git Repositories - distgen/blob - lib/boot.sh
4 mount
--bind /dev
${MOUNTPOINT}/dev
7 mount
--bind /proc
${MOUNTPOINT}/proc
10 mount
--bind /sys
${MOUNTPOINT}/sys
13 mv ${MOUNTPOINT}/etc
/mtab
${MOUNTPOINT}/etc
/mtab.orig
16 #cat /proc/self/mounts | grep -E '^(/dev/m|devtmpfs)' | perl -pne 's%/media(/?)%$1%' | sort | uniq > /media/etc/mtab
17 perl
-pne "/^(devtmpfs \\/dev|\\/dev\\/(md|dm|mapper))/ || undef \$_; s%${MOUNTPOINT}/?%/%" /proc
/self
/mounts
> ${MOUNTPOINT}/etc
/mtab
19 # Extract last kernel version
20 KVER
=`chroot ${MOUNTPOINT} rpm -qa | perl -pne '/kernel-server-latest/||undef $_;s%^kernel-(server)-latest-([^-]+)-(.+)$%\2-\1-\3%'`
22 # Retrieve mdboot and mddata uuids
23 MDBOOTUUID
=`mdadm --detail /dev/md/${MDBOOT} | perl -pne '/UUID\s:\s/||undef $_;s/^\s+UUID\s:\s//'`
24 MDDATAUUID
=`mdadm --detail /dev/md/${MDDATA} | perl -pne '/UUID\s:\s/||undef $_;s/^\s+UUID\s:\s//'`
27 #XXX: request a non hostonly to get all kernel modules
28 #XXX: provide devices uuid to have md and luks ready
29 #XXX: force crypttab presence, mandatory to unlocking
30 #XXX: you may add ip=dhcp rd.neednet=1 for debug purpose
31 chroot
${MOUNTPOINT} dracut
-f -N --fstab --hostonly-cmdline --kernel-cmdline 'rd.luks.uuid='$LUKSDATAUUID' rd.md.uuid='$MDBOOTUUID' rd.md.uuid='$MDDATAUUID -I /etc
/crypttab
/boot
/initrd
-${KVER}.img
${KVER}
33 # Generate grub config
34 chroot
${MOUNTPOINT} grub2
-mkconfig -o /boot
/grub
2/grub.cfg
37 for i
in $LOOPB $LOOPA; do
38 chroot
${MOUNTPOINT} grub2
-install $i
42 umount
${MOUNTPOINT}/sys
45 umount
${MOUNTPOINT}/proc
48 umount
${MOUNTPOINT}/dev
51 mv -f ${MOUNTPOINT}/etc
/mtab.orig
${MOUNTPOINT}/etc
/mtab
54 umount
${MOUNTPOINT}/var
/lib
/mysql
57 umount
${MOUNTPOINT}/var
/spool
/mail
60 umount
${MOUNTPOINT}/home
63 umount
${MOUNTPOINT}/boot