diff --git a/ayarlar/grub/fonts/unicode.pf2 b/ayarlar/grub/fonts/unicode.pf2 new file mode 100644 index 000000000..359b6c88f Binary files /dev/null and b/ayarlar/grub/fonts/unicode.pf2 differ diff --git a/ayarlar/grub/grub.cfg b/ayarlar/grub/grub.cfg new file mode 100644 index 000000000..44a4cc9f0 --- /dev/null +++ b/ayarlar/grub/grub.cfg @@ -0,0 +1,13 @@ +insmod usbms +insmod usb_keyboard +insmod part_gpt +insmod part_msdos +insmod fat +insmod iso9660 +insmod udf +insmod ext2 +insmod reiserfs +insmod ntfs +insmod hfsplus +insmod linux +insmod chain diff --git a/ayarlar/grub/grub_milis.cfg.in b/ayarlar/grub/grub_milis.cfg.in new file mode 100644 index 000000000..2f21bd066 --- /dev/null +++ b/ayarlar/grub/grub_milis.cfg.in @@ -0,0 +1,45 @@ +set pager="1" +set locale_dir="/boot/grub/locale" + +if [ -e "${prefix}/${grub_cpu}-${grub_platform}/all_video.mod" ]; then + insmod all_video +else + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus +fi + +insmod font + +if loadfont "/boot/grub/fonts/unicode.pf2" ; then + insmod gfxterm + set gfxmode="auto" + + terminal_input console + terminal_output gfxterm + + insmod png + background_image "/boot/isolinux/@@SPLASHIMAGE@@" +fi + +if [ cpuid -l ]; then + menuentry "@@BOOT_TITLE@@ @@KERNVER@@ (@@ARCH@@)" { + set gfxpayload="keep" + linux /boot/kernel \ + root=live:CDLABEL=MILIS_LIVE ro \ + rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \ + vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ \ + locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ + initrd /boot/initramfs + } + menuentry "@@BOOT_TITLE@@ @@KERNVER@@ (@@ARCH@@) (RAM)" { + set gfxpayload="keep" + linux /boot/kernel \ + root=live:CDLABEL=MILIS_LIVE ro init=/sbin/init \ + rd.luks=0 rd.md=0 rd.dm=0 loglevel=4 gpt add_efi_memmap \ + vconsole.unicode=1 vconsole.keymap=@@KEYMAP@@ \ + locale.LANG=@@LOCALE@@ @@BOOT_CMDLINE@@ rd.live.ram + initrd /boot/initramfs + } +fi diff --git a/grub_efi_boot.sh b/grub_efi_boot.sh new file mode 100755 index 000000000..30145d331 --- /dev/null +++ b/grub_efi_boot.sh @@ -0,0 +1,64 @@ +: ${BASE_ARCH:=$(uname -m)} +: ${KEYMAP:=tr} +: ${LOCALE:=tr_TR.UTF-8} +: ${INITRAMFS_COMPRESSION:=xz} +: ${SQUASHFS_COMPRESSION:=xz} +: ${BOOT_TITLE:="Milis_Linux"} + +readonly CURDIR="$PWD" + +ISO_VOLUME="MILIS_LIVE" + +IMAGEDIR="iso_icerik" +IMAGEDIR=$(readlink -f $IMAGEDIR) +BOOT_DIR="$IMAGEDIR/boot" +ISOLINUX_DIR="$BOOT_DIR/isolinux" +GRUB_DIR="$BOOT_DIR/grub" +ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg" +SPLASH_IMAGE="$ISOLINUX_DIR/back.jpg" +#noaer vs yazabiliriz. +BOOT_CMDLINE="" +KERNELVERSION=`uname -r` +mkdir -p $GRUB_DIR +cp -f grub/grub.cfg $GRUB_DIR/ +cp -f grub/grub_milis.cfg.in $GRUB_DIR/grub_milis.cfg +sed -i -e "s|@@SPLASHIMAGE@@|$(basename ${SPLASH_IMAGE})|" \ + -e "s|@@KERNVER@@|${KERNELVERSION}|" \ + -e "s|@@KEYMAP@@|${KEYMAP}|" \ + -e "s|@@ARCH@@|$BASE_ARCH|" \ + -e "s|@@BOOT_TITLE@@|${BOOT_TITLE}|" \ + -e "s|@@BOOT_CMDLINE@@|${BOOT_CMDLINE}|" \ + -e "s|@@LOCALE@@|${LOCALE}|" $GRUB_DIR/grub_milis.cfg + +mkdir -p $GRUB_DIR/fonts +cp -f grub/fonts/unicode.pf2 $GRUB_DIR/fonts/ + +modprobe -q loop || : + +# EFI vfat imajı olusturuyoruz. +truncate -s 16M $GRUB_DIR/efiboot.img >/dev/null 2>&1 +mkfs.vfat -F12 -S 512 -n "grub_uefi" "$GRUB_DIR/efiboot.img" >/dev/null 2>&1 + +GRUB_EFI_TMPDIR="$(mktemp --tmpdir=/tmp -d)" +LOOP_DEVICE="$(losetup --show --find ${GRUB_DIR}/efiboot.img)" +mount -o rw,flush -t vfat "${LOOP_DEVICE}" "${GRUB_EFI_TMPDIR}" >/dev/null 2>&1 + +cp -a $IMAGEDIR/boot $LFS + +chroot $LFS grub-mkstandalone -- \ + --directory="/usr/lib/grub/x86_64-efi" \ + --format="x86_64-efi" \ + --output="/tmp/bootx64.efi" \ + "boot/grub/grub.cfg" +if [ $? -ne 0 ]; then + umount "$GRUB_EFI_TMPDIR" + losetup --detach "${LOOP_DEVICE}" + echo "Failed to generate EFI loader" + exit 1 +fi +mkdir -p ${GRUB_EFI_TMPDIR}/EFI/BOOT +cp -f $LFS/tmp/bootx64.efi ${GRUB_EFI_TMPDIR}/EFI/BOOT/BOOTX64.EFI +fi +umount "$GRUB_EFI_TMPDIR" +losetup --detach "${LOOP_DEVICE}" +rm -rf $GRUB_EFI_TMPDIR diff --git a/lfs-mekanizma b/lfs-mekanizma index 6fd441a48..9e1f7c8ef 100755 --- a/lfs-mekanizma +++ b/lfs-mekanizma @@ -999,9 +999,9 @@ chroot_gir(){ unmount_islemi() { umount $LFS/dev/shm - umount $LFS/run umount $LFS/dev/pts umount $LFS/dev + umount $LFS/run umount $LFS/proc umount $LFS/sys } @@ -1046,6 +1046,76 @@ baslatici_olustur(){ dracut -N --force --xz --add 'dmsquash-live pollcdrom' --omit systemd /boot/initramfs $kernelv } +grub_efi_boot(){ + + : ${BASE_ARCH:=$(uname -m)} + : ${KEYMAP:=tr} + : ${LOCALE:=tr_TR.UTF-8} + : ${INITRAMFS_COMPRESSION:=xz} + : ${SQUASHFS_COMPRESSION:=xz} + : ${BOOT_TITLE:="Milis_Linux"} + + ISO_VOLUME="MILIS_LIVE" + + IMAGEDIR="iso_icerik" + IMAGEDIR=$(readlink -f $IMAGEDIR) + BOOT_DIR="$IMAGEDIR/boot" + ISOLINUX_DIR="$BOOT_DIR/isolinux" + GRUB_DIR="$BOOT_DIR/grub" + ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg" + SPLASH_IMAGE="$ISOLINUX_DIR/back.jpg" + #noaer vs yazabiliriz. + BOOT_CMDLINE="" + KERNELVERSION=`uname -r` + mkdir -p $GRUB_DIR + cp -f ayarlar/grub/grub.cfg $GRUB_DIR/ + cp -f ayarlar/grub/grub_milis.cfg.in $GRUB_DIR/grub_milis.cfg + sed -i -e "s|@@SPLASHIMAGE@@|$(basename ${SPLASH_IMAGE})|" \ + -e "s|@@KERNVER@@|${KERNELVERSION}|" \ + -e "s|@@KEYMAP@@|${KEYMAP}|" \ + -e "s|@@ARCH@@|$BASE_ARCH|" \ + -e "s|@@BOOT_TITLE@@|${BOOT_TITLE}|" \ + -e "s|@@BOOT_CMDLINE@@|${BOOT_CMDLINE}|" \ + -e "s|@@LOCALE@@|${LOCALE}|" $GRUB_DIR/grub_milis.cfg + + mkdir -p $GRUB_DIR/fonts + cp -f ayarlar/grub/fonts/unicode.pf2 $GRUB_DIR/fonts/ + + modprobe -q loop || : + + # EFI vfat imajı olusturuyoruz. + truncate -s 16M $GRUB_DIR/efiboot.img >/dev/null 2>&1 + mkfs.vfat -F12 -S 512 -n "grub_uefi" "$GRUB_DIR/efiboot.img" >/dev/null 2>&1 + + GRUB_EFI_TMPDIR="$(mktemp --tmpdir=/tmp -d)" + LOOP_DEVICE="$(losetup --show --find ${GRUB_DIR}/efiboot.img)" + mount -o rw,flush -t vfat "${LOOP_DEVICE}" "${GRUB_EFI_TMPDIR}" >/dev/null 2>&1 + + cp -a $IMAGEDIR/boot $LFS + + chroot $LFS grub-mkstandalone -- \ + --directory="/usr/lib/grub/x86_64-efi" \ + --format="x86_64-efi" \ + --output="/tmp/bootx64.efi" \ + "boot/grub/grub.cfg" + if [ $? -ne 0 ]; then + umount "$GRUB_EFI_TMPDIR" + losetup --detach "${LOOP_DEVICE}" + echo "Failed to generate EFI loader" + exit 1 + fi + mkdir -p ${GRUB_EFI_TMPDIR}/EFI/BOOT + cp -f $LFS/tmp/bootx64.efi ${GRUB_EFI_TMPDIR}/EFI/BOOT/BOOTX64.EFI + fi + umount "$GRUB_EFI_TMPDIR" + losetup --detach "${LOOP_DEVICE}" + rm -rf $GRUB_EFI_TMPDIR + + +} + + + squashfs_olustur(){ unmount_islemi lfs_kontrol @@ -1053,7 +1123,7 @@ squashfs_olustur(){ cp /etc/bashrc $LFS/etc/bashrc cp ./ayarlar/mps.conf $LFS/etc/mps.conf cp ./rootfs/etc/rc.d/init.d/sysklogd $LFS/etc/rc.d/init.d/sysklogd - iso_etiket="malfsLive" + iso_etiket="MILIS_LIVE" rm iso_icerik/boot/kernel rm iso_icerik/boot/initramfs rm -r iso_icerik/LiveOS @@ -1086,7 +1156,7 @@ squashfs_olustur(){ iso_olustur(){ rm malfs-milis.iso - genisoimage -l -V malfsLive -R -J -pad -no-emul-boot -boot-load-size 4 -boot-info-table \ + genisoimage -l -V MILIS_LIVE -R -J -pad -no-emul-boot -boot-load-size 4 -boot-info-table \ -b boot/isolinux/isolinux.bin -c boot/isolinux/isolinux.cat -o malfs-milis.iso iso_icerik && isohybrid malfs-milis.iso }