rescuecd na USB kontra UEFI
Daniel Dawid Majewski
light-i w o2.pl
Pią, 18 Paź 2013, 12:57:42 CEST
W odpowiedzi na wiadomość z dnia 18.10.2013 09:50, od Jacek Osiecki:
> Witam raz jeszcze,
>
> To może ktoś ma pomysł jak uruchomić rescuecd przy użyciu GRUBa?
Pozwolę sobie odpowiedzieć załącznikami.
Jeden to konfig z pendrive, a drugi to mój skrypt instalacyjny do grub2.
Generalnie w twoim przypadku pic polega na :
initrd /rescue.cpi /custom.cpi
Natomiast w parametrach kernela informacja o initrd jest zbędna.
--
Pozdrawiam,
Daniel Dawid Majewski
jabber:light-i/pld-users.org
-------------- następna część ---------
#!/bin/bash
set default=0
set fallback="1 2"
set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue
set timeout=15
set root=(hd0,1)
insmod biosdisk
insmod pc
insmod font
insmod vbe
insmod gfxterm
insmod videotest
insmod tga
insmod png
insmod jpg
insmod gfxmenu
# Load fonts
loadfont /gruB/fonts/6x9.pf2
loadfont /gruB/fonts/6x12.pf2
loadfont /gruB/fonts/aqui.pf2
loadfont /gruB/fonts/cure.pf2
loadfont /gruB/fonts/gelly.pf2
loadfont /gruB/fonts/lime.pf2
loadfont /gruB/fonts/smoothansi.pf2
loadfont /gruB/fonts/Helvetica-8.pf2
loadfont /gruB/fonts/Helvetica-Bold-14.pf2
loadfont /gruB/fonts/Helvetica-Bold-18.pf2
loadfont /gruB/fonts/Helvetica-Bold-24.pf2
loadfont /gruB/fonts/UniversCondensed-10.pf2
loadfont /gruB/fonts/UniversCondensed-12.pf2
loadfont /gruB/fonts/UniversCondensed-14.pf2
loadfont /gruB/fonts/UniversCondensed-16.pf2
loadfont /gruB/fonts/UniversCondensed-18.pf2
loadfont /gruB/fonts/UniversCondensed-20.pf2
loadfont /gruB/fonts/UniversCondensed-24.pf2
set theme="/gruB/themes/pld-moonlight/theme.txt"
# set theme="/gruB/themes/proto/theme.txt"
# set theme="/gruB/themes/swiftarch/theme.txt"
# set theme="/gruB/themes/ubuntu2/theme.txt"
# set theme="/gruB/themes/ubuntu1/theme.txt"
# set theme="/gruB/themes/winter/theme.txt"
# set gfxmode=1280x800
set gfxmode=1024x768
# set menuviewer="terminal"
set menuviewer="gfxmenu"
set gfxterm_font="Fixed 12"
# background_image /gruB/images/Acer.png
menuentry "HD Boot" {
chainloader (hd1)+1
}
menuentry "PLD Linux Rescue x86_64 Ramdisk (Need 512MB RAM)|class=pld,linux,os" {
linux /boot/vmlinuz6 root=/dev/ram0
echo
echo "Wait few minutes - loading ramdisk..."
initrd /boot/rescue6.cpi /boot/custom.cpi
}
menuentry "PLD Linux Rescue i686 Ramdisk (Need 128MB RAM)|class=pld,linux,os" {
linux /boot/vmlinuz root=/dev/ram0
echo
echo "Wait few minutes - loading ramdisk..."
initrd /boot/rescue.cpi /boot/custom.cpi
}
menuentry "PLD Linux Rescue x86_64 Ramdisk (Need 512MB RAM) As second disk|class=pld,linux,os" {
set root=(hd1,1)
linux /boot/vmlinuz6 root=/dev/ram0
echo
echo "Wait few minutes - loading ramdisk..."
initrd /boot/rescue6.cpi /boot/custom.cpi
}
menuentry "PLD Linux Rescue i686 Ramdisk (Need 128MB RAM) As second disk|class=pld,linux,os" {
set root=(hd1,1)
linux /boot/vmlinuz root=/dev/ram0
echo
echo "Wait few minutes - loading ramdisk..."
initrd /boot/rescue.cpi /boot/custom.cpi
}
menuentry "HD Boot" {
chainloader (hd1)+1
}
menuentry "RAM Memory test" {
linux /boot/memtest
}
menuentry "Windows XP|class=windows xp, windows, os" {
chainloader (hd1,3)+1
}
menuentry "PLD Linux 3.0 (TH)|class=pld,linux,os" {
linux (hd1,2)/boot/vmlinuz root=/dev/sda2 ro 5
initrd (hd1,2)/boot/initrd
}
-------------- następna część ---------
#!/bin/sh
DEST_MOUNTPOINT=""
GRUB_MODLIB=""
GRUBEXPATH=""
GRUB_MODULES="biosdisk part_msdos ext2 search_fs_uuid"
#GRUB_MODULES="biosdisk part_msdos ext2 fs_uuid"
if [ "${1}" == "sda" ]; then
DEV_INSTALL="/dev/sda"
DEV_WITH_GRUB_IMAGES="/dev/sda2"
GRUB_DIR="/boot/grub"
elif [ "${1}" == "gm" ]; then
GRUB_DIR="/boot/grub2"
GRUB_MODLIB="/i386-pc"
GRUB_MODULES="ext2 pc biosdisk fs_uuid"
GRUBEXPATH="${DEST_MOUNTPOINT}${GRUB_DIR}/bin/"
elif [ "${1}" == "lgdrv" ]; then
DEV_INSTALL="/dev/disk/by-id/usb-WDC_WD32_00BEVT-00ZCT0_000000002FD5-0:0"
DEV_WITH_GRUB_IMAGES="/dev/disk/by-id/usb-WDC_WD32_00BEVT-00ZCT0_000000002FD5-0:0-part1"
DEST_MOUNTPOINT="/media/ExtHD/LGDrivePLD"
GRUB_DIR="/gruB"
elif [ "${1}" == "mint" ]; then
DEV_INSTALL="/dev/disk/by-id/usb-USB_2.0_Flash_Disk_09185700227A2C01-0:0"
DEV_WITH_GRUB_IMAGES="/dev/disk/by-id/usb-USB_2.0_Flash_Disk_09185700227A2C01-0:0-part1"
DEST_MOUNTPOINT="/media/Pendrives/Mint"
GRUB_DIR="/gruB"
GRUB_MODLIB="/i386-pc"
GRUB_MODULES="ext2 pc biosdisk fs_uuid"
GRUBEXPATH="/boot/grub2/bin/"
else
cat <<END
Options :
sda - install on /dev/sda and images are from actuall grub instalation
gm - install on /dev/sda and images are from old graphic menu path compilation
lgdrv - install on /dev/disk/by-id/usb-WDC_WD32_00BEVT-00ZCT0_000000002FD5-0:0
and images are on /dev/disk/by-id/usb-WDC_WD32_00BEVT-00ZCT0_000000002FD5-0:0-part1
mint - install on /dev/disk/by-id/usb-USB_2.0_Flash_Disk_09185700227A2C01-0:0
and images are from /dev/disk/by-id/usb-USB_2.0_Flash_Disk_09185700227A2C01-0:0-part1
old graphic menu path compilation.
END
exit 0
fi
grub-mkdevicemap --no-floppy --device-map=${DEST_MOUNTPOINT}${GRUB_DIR}/device.map
UUID=$(${GRUBEXPATH}grub-probe --device-map=${DEST_MOUNTPOINT}${GRUB_DIR}/device.map\
--target=fs_uuid --device ${DEV_WITH_GRUB_IMAGES})
echo "Installing on ${DEV_INSTALL}, Device with grub modules : ${DEV_WITH_GRUB_IMAGES}(UUID=${UUID})\nPrefix : \"(UUID=${UUID})${GRUB_DIR}${GRUB_MODLIB}\""
# -d, --directory=DIR use images and modules under DIR [default=/boot/grub2/i386-pc]
# -p, --prefix=DIR set grub_prefix directory [default=/boot/grub2]
# -m, --memdisk=FILE embed FILE as a memdisk image
# -o, --output=FILE output a generated image to FILE [default=stdout]
# -h, --help display this message and exit
# -V, --version print version information and exit
# -v, --verbose print verbose messages
${GRUBEXPATH}grub-mkimage --verbose\
--output=${DEST_MOUNTPOINT}${GRUB_DIR}${GRUB_MODLIB}/core.img \
--format=i386-pc\
--directory=${DEST_MOUNTPOINT}${GRUB_DIR}${GRUB_MODLIB}\
--prefix=\(UUID=${UUID}\)${GRUB_DIR}${GRUB_MODLIB} ${GRUB_MODULES}
# -O, --format=FORMAT i386-coreboot, i386-multiboot, i386-pc, i386-pc-pxe, i386-efi, i386-ieee1275, i386-qemu, x86_64-efi
# --compression=auto\
${GRUBEXPATH}grub-setup --verbose\
--directory=${DEST_MOUNTPOINT}${GRUB_DIR}${GRUB_MODLIB}\
--device-map=${DEST_MOUNTPOINT}${GRUB_DIR}/device.map ${DEV_INSTALL}
Więcej informacji o liście pld-users-pl