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%'`
23 #XXX: force non hostonly else it don't store commandline : rd.luks.uuid rd.md.uuid ip=dhcp rd.neednet=1
24 DRACUT_SKIP_FORCED_NON_HOSTONLY
=1 chroot
${MOUNTPOINT} mkinitrd
-f /boot
/initrd
-${KVER}.img
${KVER}
26 # Generate grub config
27 chroot
${MOUNTPOINT} grub2
-mkconfig -o /boot
/grub
2/grub.cfg
30 for i
in $LOOPB $LOOPA; do
31 chroot
${MOUNTPOINT} grub2
-install $i
35 umount
${MOUNTPOINT}/sys
38 umount
${MOUNTPOINT}/proc
41 umount
${MOUNTPOINT}/dev
44 mv -f ${MOUNTPOINT}/etc
/mtab.orig
${MOUNTPOINT}/etc
/mtab
47 umount
${MOUNTPOINT}/home
50 umount
${MOUNTPOINT}/boot