上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

kiyoshi's help thanks to Debian Kernel in English

KIYOSHI'S help
Kexec Integrated Yakky Open-Source Helper Init Script


TOUGH LINUX KERNEL LOADER
USING DEBIAN KERNEL

Thanks to Debian kernel, kexec and dialog




The information in this page is distributed in the hope that it will be useful but without any warranty.
The author (Kiyoshi SUZUKI) does not accept responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all.
No warranty is made about the information in this page.
The author does not make amends for the trouble caused by the information in this page.
Use at your own risk.




Table of contents:

What's this?

How to generate kiyoshi's help on your working Debian

How to enable kiyoshi's help on your working Debian

How to boot linux distributions using kiyoshi's help

Currently unavailable: How to download bootable CD iso file

How to strengthen kiyoshi's help

How to make bootable CD

License and acknowledgement



What's this?



kiyoshi's help is messy init script written by Kiyoshi SUZUKI in Fukui, JAPAN, which helps booting the linux distributions.

You can make your original kernel loader based on Linux kernel and kexec-tools with kiyoshi's help.


kiyoshi's help can:

Boot linux distributions by using any of the following configuration files:
  • GRUB2 configuration file /boot/grub/grub.cfg
  • GRUB LEGACY configuration file /boot/grub/menu.lst
  • SYSLINUX configuration file /boot/syslinux/syslinux.cfg
  • ISOLINUX configuration file /boot/isolinux/isolinux.cfg
  • EXTLINUX configuration file /boot/extlinux/extlinux.conf
  • LILO configuration file /etc/lilo.conf


  • Boot Debian or Ubuntu by selecting the partition Debian or Ubuntu are installed on, using symlink /vmlinuz and /initrd.img

    Boot Ubuntu installed by Wubi by selecting the partitions containing /ubuntu/disks/root.disk

    Boot linux distributions by typing custom command line (bash like)

    Loop mount iso files or file-system files and start booting linux distributions inside the loop-mounted file.

    kiyoshi's help searches and lists automatically the partitions mountable, just after your pressing ENTER key. You can select the partition to use. After you select the partition, you can select one from the following: 1) make kiyoshi's help automatically search the configuration files of some kernel loader. 2) select manually configuration/kernel/initramfs files. 3) select file to loop mount. 4) use shell (busybox).

    kiyoshi's help can boot linux distributions,

    Even if the linux distribution is installed on the media from which BIOS does not support the boot,for example, USB-devices, USB-3.0-devices, or on BTRFS (not bootable from GRUB2), or on LVM

    Even if the other boot loader (or kernel loader) cannot boot the linux distributions because of trouble,

    Even if the other boot loaders are not installed on MBR or PBR of the media.


    To use kiyoshi's help, you can generate kiyoshi's help on your running Debian, and enable kiyoshi's help

    How to use kiyoshi's help is written here.




    How to generate kiyoshi's help on your working Debian



    Open terminal, for example, by clicking "Application" -> "Accsessory" -> "Terminal"

    Type
    su
    [root password, if asked]
    apt-get update
    apt-get install kexec-tools dialog leafpad


    Then, restart Debian to activate kexec-tools by
    coldreboot


    CAUTION! If you installed kexec-tools, cold reboot only can be done by "coldreboot" command by default. If you want to use "shutdown" command to cold reboot, change the following line in /etc/default/kexec
    LOAD_KEXEC=true

    into
    LOAD_KEXEC=false



    After rebooting, open text editor, for example, by clicking "Application" -> "Accsessory" -> "Text Editor" or by typing
    leafpad

    in terminal.

    Paste the contents of

    makekiyoshishelp.sh for Debian Wheezy (Ver.7)

    into the opened text editor.

    Save to the file for example, "makekiyoshishelp.sh" in your home directory (/home/USER_ACCOUNT)

    Open terminal, for example, by clicking "Application" -> "Accsessory" -> "Terminal"

    Type
    su
    bash /home/USER_ACCOUNT/makekiyoshishelp.sh


    A text editor window will open.

    Replace all contents of the opened text editor window by the contents of the following file: init

    init for Debian Jessie.


    Save the file, quit the text editor, then the following message will be shown in the terminal.

    initrd.img-kiyoCs is generated in
    ... Please use it with /boot/vmlinuz-...

    The kiyoshi's help (initrd.img-kiyoCs) is generated in the current directory.

    The contents of initrd.img-kiyoCs is in the directory "initrd" in the current directory.

    You can erase the "initrd" directory in the current directory.



    How to enable kiyoshi's help on your working Debian



    kiyoshi's help and its initramfs(initrd.img-kiyoCs) cannot work without kernel.

    So, you must have Debian kernel (/boot/vmlinuz-
    ...) and initrd.img-kiyoCs read at boot time in order to use kiyoshi's help.

    One way is to make boot CD or DVD with the method described in "How to make bootable CD".

    The other way is setting up the current active kernel loader.
    If you have kernel loader (for example, grub2, grub legacy, syslinux, isolinux, extlinux, lilo, grub4dos) installed in internal hard disk in your computer, you can set up the kernel loader to read Debian kernel and initrd.img-kiyoCs.

    Copy the working Debian kernel and initrd.img-kiyoCs into a partition on the internal hard disk, which your kernel loader can access at boot time.

    To check the version of the Debian kernel, type the following in the terminal:

    Type
    uname -r


    The kernel version will be for example,

    2.6.32-5-686

    In the above case, the working kernel may be:

    /boot/vmlinuz-
    2.6.32-5-686

    # GRUB2 #


    In the terminal, type the following:

    su
    nano /etc/grub.d/40_custom


    If your password is asked, please type.

    At the end of the edited file, add the following:


    menuentry "kiyoshi's help thanks to Debian kernel and kexec-tools" {
    set root=(hd
    %,@)
    linux /PATH/TO/vmlinuz-
    2.6.32-5-686
    initrd /PATH/TO/initrd.img-kiyoCs
    }

    You must change "
    2.6.32-5-686" to the version of the working Debian kernel.

    % should be the number of the media (hard disk, USB flash, and so on) where initrd.img-kiyoCs is copied. The number of the first media is "0". The number of the second media is "1".

    @ should be the number of the partition where initrd.img-kiyoCs is copied.

    PATH/TO/ should be the path for the directory which contains the copied kernel and initrd.img-kiyoCs. If you copied them onto the top (root) directory of the partition, omit the above PATH/TO/.

    Finally, type the following in the terminal:

    su
    update-grub


    This will enable the entry in GRUB2.


    # GRUB legacy & GRUB4DOS #


    In the terminal, type the following:

    su
    gedit /boot/grub/menu.lst

    If gedit is not installed, you can use leafpad or another text editor. nano or vi is OK, if you can manipulate correctly.

    If your password is asked, please type.

    At the end of the openned text editor window, add the following:

    title kiyoshi's help thanks to Debian kernel and kexec-tools
    root=(hd
    %%,@@)
    kernel /PATH/TO/vmlinuz-
    2.6.32-5-686
    initrd /PATH/TO/initrd.img-kiyoCs


    You must change "
    2.6.32-5-686" to the version of the working Debian kernel.

    %% should be the number of the media (hard disk, USB flash, and so on) where initrd.img-kiyoCs is copied. The number of the first media is "0". The number of the second media is "1".

    @@ should be the number of the partition where initrd.img-kiyoCs is copied. The number of the first partition is "0". The number of the second partition is "1".

    PATH/TO/ should be the path for the directory which contains the copied kernel and initrd.img-kiyoCs. If you copied them onto the top (root) directory of the partition, omit the above PATH/TO/.


    How to boot linux distributions using kiyoshi's help


    On boot, load kernel vmlinuz-... and initrd.img-kiyoCs, either by grub2, grub legacy and so forth, or select "kiyoshi's help..." in booting with bootable CD.

    After kernel and initramfs are loaded and booted, kiyoshi's help (init script) starts running.
    Many lines may be displayed.
    If you think enough time passed to detect the media where linux distributions you want to boot is installed, press ENTER key.

    A quasi-window opened and lists the partitions detected.
    Select the partition.

    Select the type of things you want to do.
    For example,
    Search Grub, Sys(iso,ext)linux, Lilo setting or Wubi
    or
    Use shell (busybox)
    You can select or deselect by pushing space key.
    If you deselect all, Debian and/or Ubuntu kernel will be searched.

    If you select "Search", you will see the select menu. Select "select title."
    Detected booting option (menu) will be shown.
    Select one of the detected booting options.
    The contents of the booting option will be shown. The detected boot parameters, i.e., kernel, initramfs, and kernel options will be displayed.
    If you think they are good, select yes (press enter key).
    If you think something is wrong, you can change the parameters. Select c by DOWN key and type the modified parameters.

    If you select "Use shell (busybox)", you drop in to busybox, small shell interface.
    You can use kexec command, such as
    mount -t auto /dev/[device file name such as sda1] /mnt
    kexec -l /mnt
    [kernel file name with full path] --initrd=/mnt[initramfs file name with full path] --append="[options given to kernel]"
    kexec -e

    Please be noticed that full path is not relative path, but is absolute path which starts with "/".
    It may be useful to push TAB key for automatic complement.
    You can use "ls", "blkid", "cat" and so on.
    For the commands available, please refer to busybox online manual.



    Currently unavailable: How to download bootable CD iso file



    Downloadable zip-compressed iso image file (currently using debian kernel vmlinuz-2.6.32-5-686) is available at
    http://www.megaupload.com/

    You will get
    kiyoshishelp.iso

    You can check whether the downloaded file is the same as the original one or not,
    by
    sha1sum kiyoshishelp.iso


    Tha sha1sum value of the original file:
    kiyoshishelp.iso
    is
    03402345602b48b853709d8b7035f0c4a8ac15af

    Burn
    kiyoshishelp.iso
    to CD-R, or DVD-R, and boot with the burned CD or DVD.

    The downloadable boot CD iso file image utilize the great kernel loader "GRUB4DOS".




    How to strengthen kiyoshi's help



    You can strengthen the ability of kiyoshi's help to recognize the partition where linux is installed.
    The way is to add the correct modules to initramfs.
    First, you must recognize the partition where the linux distribution you want to boot is installed, in running Debian.
    Then make sure what modules are in use, by typing in the terminal,
    lsmod


    You can set necessary modules to be added in initramfs, by adding the lines in /etc/initramfs-tools/modules.
    su
    gedit /etc/initramfs-tools/modules

    If gedit is not installed, you can use leafpad or another text editor. nano or vi is OK, if you can manipulate correctly.

    Add the module file name, one for each line, omitting path name and ".ko".
    For example,for Debian Squeeze (with kernel version < 2.6.34)
    xhci
    usbhid
    hid
    usb_storage
    btrfs
    lvm2



    And at last, you should update initramfs, by typing:
    su
    update-initramfs -u


    It should be noticed that the started linux cannot boot correctly if the initramfs lacks the correct modules to recognize the partition even if kiyoshi's help can load the correct linux kernel and initramfs.



    How to make bootable CD



    First, generate an initramfs file with kiyoshi's help init script named initrd.img-kiyoCs by the method described in "How to generate kiyoshi's help on your working Debian".

    Download grub4dos-0.4.4.zip and decompress to generate a directory named "grub4dos-0.4.4".

    Make a directory and name it "iso_root".
    Copy the following 4 files into the made directory "iso_root".
  • initrd.img-kiyoCs

  • /boot/vmlinuz-... (current working kernel)

  • grldr (in the decompressed "grub4dos-0.4.4" directory)

  • menu.lst (in the decompressed "grub4dos-0.4.4" directory)


  • The version of the current working kernel is shown by typing the following in terminal.
    uname -r


    Start editing the copied "menu.lst" file by double-clicking the file or typing the following in terminal.
    su
    gedit
    [full path of the copied "menu.lst" file]/menu.lst

    If gedit is not installed, you can use leafpad or another text editor. nano or vi is OK, if you can manipulate correctly.

    Add the following lines before the first line starting with "title".
    title kiyoshi's help thanks to Debian kernel and kexec-tools
    kernel /vmlinuz-
    ...
    initrd /initrd.img-kiyoCs



    Please type the correct file name of the copied kernel, such as "
    vmlinuz-2.6.32-5-686" instead of "vmlinuz-...".

    In terminal, change directory to the parent directory which contains the "iso_root" directory and type the following.
    genisoimage -R -b grldr -no-emul-boot -boot-load-size 4 -o kiyoshishelp.iso iso_root

    An iso image file named kiyoshishelp.iso will be generated. It is the bootable CD iso image file. Burn it to CD-R and boot with the burned CD.
    If genisoimage is not installed, type the following in terminal
    su
    apt-get install genisoimage





    License and acknowledgement


    The author (Kiyoshi SUZUKI) is not familiar with the license of Debian.

    The author did not change any binary of Debian. The author only changed the init in the initramfs file (initrd.img) and deleted some files in the initramfs file (initrd.img) of Debian.

    The bootable CD image contains the great kernel loader "GRUB4DOS".

    The author is grateful to disklessfun for his telling how to incorpolate kexec function into initramfs of Ubuntu.

    If you think the author violated the license of somebody, please let the author know by writing the comments in this blog.



    This blog is last updated at 2016/7/18.

テーマ : Linux
ジャンル : コンピュータ

プロフィール

kiyoshi

Author:kiyoshi
FC2ブログへようこそ!

最新記事
最新コメント
最新トラックバック
月別アーカイブ
カテゴリ
検索フォーム
RSSリンクの表示
リンク
ブロとも申請フォーム

この人とブロともになる

QRコード
QRコード
since 2011/9/25
現在の閲覧者数:
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。