Results 1 to 8 of 8

Thread: Avoiding ejecting the CD at reboot

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Posts
    5

    Avoiding ejecting the CD at reboot

    Hi people.

    I'm done remastering my Knoppix CD, based on the excellent guides posted here. Thanks to everyone who contributed to them.

    However I would like to avoid Knoppix ejecting the CD at reboot.
    I know I can add the noeject at startup, but I would like it to be the standard, without having to type in noeject.
    Is there a settings file where I can specify this?

    I'm sorry if this has already been answered. I did a quick search for "eject" and did not find any suited explanation.

    Thanks in advance.

    Jimmy

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY USA
    Posts
    1,510
    Take a look at isolinux.cfg at (KnoppixCD-Root)/boot/isolinux/.
    (This example is from Knoppix 3.6)
    Edit that file with a text editor and see the following:
    Code:
    1:   DEFAULT linux24
    2:   APPEND ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 initrd=minirt24.gz nomce quiet BOOT_IMAGE=knoppix
    You will need to insert your noeject in line 2.
    I figured this out when I remastered Knoppix 3.7 which defaults to German (lang=de) and I changed it to US English (lang=us).
    I hope this helps.
    James

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    James: Thanks, your solution makes sense - I'll test it as soon as I get back from work. Thank you for being a very active responder here

    Cheers
    Jimmy

  4. #4
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    OK, this is what I did:

    1. mounted the boot.img file: mount -t msdos -o loop /path2boot.img /path2mountpoint

    2. Edited the syslinux.cfg to include the noeject in the various labels' Append.

    3. remastered, burned and rebooted.

    now the CD no longer ejects, but it still tells the user to remove the cd and press return.

    I can live with the message being displayed, but it would be nice to have the 'pressing return' removed, so a reboot can be done automatically.

    Any info on how to do this is much appreciated.

    Greetz

    Jimmy

  5. #5
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY USA
    Posts
    1,510
    Quote Originally Posted by Jimmy
    OK, this is what I did:
    .....
    CD no longer ejects, but it still tells the user to remove the cd and press return.

    I can live with the message being displayed, but it would be nice to have the 'pressing return' removed, so a reboot can be done automatically.

    Any info on how to do this is much appreciated.

    Greetz

    Jimmy
    I saw your post and decided to do some investigating. First I checked to see how Knoppix shutsdown. In a typical Knoppix system, runlevel 2 is root console access & runlevel 5 is for Full X enviornment. In a typical *nix system, runlevel 0 is for halting the system and & runlevel 6 is for rebooting. So I first went to /etc/rc6.d and noticed that it calls the script /etc/init.d/knoppix-reboot which contains the commands for killing the processes, unmounting the drives & rebooting the system. I also looked at /etc/rc0.d/knoppix-halt & it is very similar to knoppix-reboot. The last command in either script is to reboot or halt the machine. With that in mind I inspect the halt command which is a link to /sbin/init. I use the folloing command to get ascii strings from the binary.
    Code:
    strings /sbin/init
    I dumps a whole lot of ascii to the screen and about 50% down it shows the following text
    Code:
    [1;31mCan't unmount CD yet...
    [0;39m
    [1;36mCan't unmount CD, please reset.
    [0;39m
    [1;36mPlease remove CD, close cdrom drive and hit return.
    [1;39m
    [1;34mShutdown complete.
    So this proves that it is the init program and is displaying the "hit return" message. This also proves that the Knoppix developers are using a modified init.
    This site http://developer.linuxtag.net/knoppix/sources/ is the archive of all the custom knoppix code. So I downloaded http://developer.linuxtag.net/knoppi....84-186.tar.gz & extracted it to a temp directory. I used grep to determin the location of the hit return code.
    James@micro1 ~/knoptest/sysvinit-knoppix-2.84/src
    $ grep -R remove src/
    src/halt.c: char *msg1="Please remove CD, close cdrom drive and hit return.";
    src/init.c: * The entries that do not belong here at all are removed
    src/last.c: fprintf(stderr, "Perhaps this file was removed by the "
    src/last.c: * If we saw a shutdown/reboot record we can remove
    This is as far as I got. I figure either the automatic reboot you are looking for is either a really simple command in a script that I overlooked or that the autoreboot is hidden somewhere in the source code. You could try to get an original sysvinit-2.84 source code package and use diff to compare the changes made.
    I hope this helps.
    James

  6. #6
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    Thanks again James.

    Though I must be sleeping too much while doing some of this.
    Just below the "noeject" option in the cheatcodes is the "noprompt" which will disable the request for a keypress.

    Sorry for keeping you busy, I'll buy the next pint

    Hope this concludes the topic, and helps others as well.
    EDIT: It does the trick

    Greetz

    Jimmy

  7. #7
    Senior Member
    Join Date
    Nov 2003
    Posts
    171
    /etc/init.d/knoppix-reboot is the script.

    I am having a different problem though; when using squashfs there is no prompt and i would like it back.

    I have modified the script a few times without success, attempting to delay the umount of /KNOPPIX (which is provided by /dev/loop1 with squashfs) until just the right time.

  8. #8
    Junior Member
    Join Date
    Oct 2004
    Posts
    5
    Quote Originally Posted by kelmo
    /etc/init.d/knoppix-reboot is the script.

    I am having a different problem though; when using squashfs there is no prompt and i would like it back.

    I have modified the script a few times without success, attempting to delay the umount of /KNOPPIX (which is provided by /dev/loop1 with squashfs) until just the right time.
    I don't know how squashfs works, and it sounds like you're more on top of what-is-where than me, but a thing that pops into my mind (having played with the noprompt option) is to check if the syslinux.cfg (or the equivalent) in the boot.img has the "noprompt" setting set in any of the APPENDs.
    Most likely you've allready checked that, but I thought I'd add it anyways.

    Greetz

    Jimmy

Similar Threads

  1. How is done ejecting CD before reboot?
    By RobD in forum Customising & Remastering
    Replies: 0
    Last Post: 11-17-2005, 09:19 PM
  2. Problems Ejecting CDROM
    By Knopper12 in forum MS Windows & New to Linux
    Replies: 1
    Last Post: 12-16-2004, 04:31 AM
  3. ip set up goes away everytime I reboot.....
    By fabiand in forum Networking
    Replies: 2
    Last Post: 06-09-2004, 01:34 PM
  4. ejecting the CDrom I booted off of
    By doogie in forum General Support
    Replies: 2
    Last Post: 08-15-2003, 10:02 PM
  5. cd ejecting..
    By evilfix in forum General Support
    Replies: 3
    Last Post: 06-24-2003, 07:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


GIGABYTE A520M DS3H AC AMD AM4 Motherboard mATX picture

GIGABYTE A520M DS3H AC AMD AM4 Motherboard mATX

$59.99



Intel H310 LGA1151 8-9th Gen DDR4 M.2 NVMe mATX Motherboard IO Shield Battery picture

Intel H310 LGA1151 8-9th Gen DDR4 M.2 NVMe mATX Motherboard IO Shield Battery

$54.99



ASUS PRIME Z490-V Motherboard Intel Z490 10th gen DDR4 LGA 1200 ATX w/ IO Shield picture

ASUS PRIME Z490-V Motherboard Intel Z490 10th gen DDR4 LGA 1200 ATX w/ IO Shield

$84.99



ASUS B85M-G/B85M-G PLUS LGA1150 DDR3 Micro ATX Motherboard HDMI for Inter 4thCPU picture

ASUS B85M-G/B85M-G PLUS LGA1150 DDR3 Micro ATX Motherboard HDMI for Inter 4thCPU

$45.00



⁠Intel H81 Motherboard M.2 NVMe LGA 1150 mATX w/ IO Shield (Random Slot Color)⁠ picture

⁠Intel H81 Motherboard M.2 NVMe LGA 1150 mATX w/ IO Shield (Random Slot Color)⁠

$29.90



GIGABYTE B365 HD3 LGA1151 Intel 9th Gen motherboard picture

GIGABYTE B365 HD3 LGA1151 Intel 9th Gen motherboard

$59.99



ASRock B550M PRO4 AM4 AMD B550 SATA 6Gb/s Micro ATX AMD Motherboard picture

ASRock B550M PRO4 AM4 AMD B550 SATA 6Gb/s Micro ATX AMD Motherboard

$81.99



ASRock AMD BC-250 16GB 128GB SSD Used picture

ASRock AMD BC-250 16GB 128GB SSD Used

$220.00



Asus ROG Strix B460-H LGA 1200 ATX Intel 10th Gen DDR4 Motherboard picture

Asus ROG Strix B460-H LGA 1200 ATX Intel 10th Gen DDR4 Motherboard

$84.99



MSI B460M-A Pro DDR4 LGA 1200 Micro ATX Motherboard 10th Gen picture

MSI B460M-A Pro DDR4 LGA 1200 Micro ATX Motherboard 10th Gen

$59.99