LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-03-2013, 04:01 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Question: SysRescueCD boot options - how to make permanent?


I want to ceate a slightly customized version of SysRescueCD that always sets the root password to something I previously specified every time it boots from the CD. I know about adding the "rootpass" boot option manually when booting from CD, but what I want is for the password to be set by default (hardcoded onto the CD) without any manual boot option editing required.

Actually, I want to add the following boot options permanently: rootpass=1234 docache dodhcp

( dodhcp is probably there by default already )

I cannot find in the SysRescueCD documentation where exactly I would do this. I am guessing that I will need to loop mount the iso image and copy all the files to a location on my harddrive, then edit some config file (where?) to add my desired boot options. Then create a new iso from the edited stuff and burn it. I have snooped around on a SysRescueCD image and found isolinux.cfg, isolinux.old and grub-371.cfg thus far. All of those look like potentials for editing. Each has multiple boot choices, so I'd potentially have to add my custom boot options in multiple places in multiple files. Is there a better way?

I will also be adding an auto-update for a DDNS entry every time the CD boots, but I already know how to do that via "autorun" scripting.

What I am creating here is a type of rescue disk for use by a computer illiterate. They boot with this CD, and then I get their IP address from the known DDNS entry and ssh into their box using the root password I hardcoded via boot options. Then I can fix whatever I need to for them once I have ssh access.
 
Old 09-03-2013, 05:59 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"edit some config file (where?) to add my desired boot options."

I think that you pass the boot parameters as parameters on the linux command given to syslinux. syslinux uses the file syslinux.cfg to determine what linux to boot and what parameters to pass to linux. Here is an explanation of how to do that:

http://www.syslinux.org/wiki/index.p...re_SYSLINUX.3F


------------------------
Steve Stites

Last edited by jailbait; 09-03-2013 at 06:01 PM.
 
Old 09-03-2013, 06:54 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
I am guessing that I will need to loop mount the iso image and copy all the files to a location on my harddrive, then edit some config file (where?) to add my desired boot options.
That's pretty much it. Create a mount point for the SystemRescueCD, loop mount it there, create another directory (in your /home/user) and copy all the directories/files there. Make sure you have read/write and/or ownnership. On the version of systemrescuecd I have, the file to be modified would be the isolinux.cfg file, probably the same for yours. Take a look at the file and compare it to what you see when you boot it. You should see three lines for each menu entry, Linux, INTIRD and APPEND. Note the boot options are all on the APPEND line. That's where I would add them. You would then need to run the mkisofs command on the directory to which you copied all the directories/files in your /home/user directory. Make sure you unmount the loop mounted filesystem.

I imagine you could boot the CD and manually enter the commands a hundred or more times in the time it takes to do this, but...
If that's not what you are looking for, post back.

Last edited by yancek; 09-03-2013 at 07:01 PM.
 
Old 09-05-2013, 03:30 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Original Poster
Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
[solved]

(1) Mounted the original ISO to a mountpoint
Code:
mkdir mountpoint
mount -o loop ./systemrescuecd-x86-3.7.1.iso ./mountpoint
(2) Copied all directory structure and files from this mountpoint to a new directory structure
Code:
mkdir ./new_structure
cd ./mountpoint
cp -av * ../new_structure/.
(3) In the copied structure, edited isolinux/isolinux.cfg to add the boot options I wanted:

isolinux.cfg before editing:
Code:
...
TIMEOUT 900
...
LABEL rescuecd_std
MENU LABEL 1) SystemRescueCd: default boot options
KERNEL ifcpu64.c32
APPEND rescue64 scandelay=1 -- rescue32 scandelay=1
TEXT HELP
Boot standard kernel with default options (should always work). You should
use this entry if you don't know which one to use. You can press [TAB] and
add extra boot options after rescue32 or/and rescue64 if required
ENDTEXT
...
isolinux.cfg after editing:
Code:
...
TIMEOUT 50
...
LABEL rescuecd_std
MENU LABEL 1) SystemRescueCd: default boot options
KERNEL ifcpu64.c32
APPEND rescue64 scandelay=1 rootpass=the_new_password setkmap=us dodhcp docache ar_ignorefail ar_nowait -- rescue32 scandelay=1 rootpass=the_new_password setkmap=us dodhcp docache ar_ignorefail ar_nowait
TEXT HELP
Boot standard kernel with default options (should always work). You should
use this entry if you don't know which one to use. You can press [TAB] and
add extra boot options after rescue32 or/and rescue64 if required
ENDTEXT
...
(4) At the root of the copied directory structure, created a new file named "autorun":

Code:
#!/bin/bash

# You must create your "DOMAIN" manually on the freedns website, http://freedns.afraid.org
DOMAIN='my_domain_name.anydns.com'
NAME_SERVER='ns1.afraid.org'
CHECK_URL='http://freedns.afraid.org/dynamic/check.php'

# You must get the "UPDATE_URL" specific for your "DOMAIN" from the freedns website
UPDATE_URL='http://freedns.afraid.org/dynamic/update.php?jhH7*%^JRdik*67VjrLKJ.<Iugy%oKJB:jlhh9y6io75vRGoYB[piJ;IJ_(*y806Ot65lL&ll'

current_ip=`wget -q -O - $CHECK_URL | grep Detected | sed s/[^0-9.]//g`
registered_ip=`nslookup $DOMAIN $NAME_SERVER | tail -2 | grep Address | sed s/[^0-9.]//g`

if [ "$registered_ip" == "" -o "$current_ip" == "" -o "$registered_ip" != "$current_ip" ]
then
	wget -q -O /dev/null "$UPDATE_URL"
fi

cat > /usr/bin/checkip <<EOF
#!/bin/bash
wget -q -O - $CHECK_URL | grep Detected | sed s/[^0-9.]//g
EOF
chmod 555 /usr/bin/checkip

cat > /usr/bin/checkdns <<EOF
#!/bin/bash
nslookup $DOMAIN $NAME_SERVER | tail -2 | grep Address | sed s/[^0-9.]//g
EOF
chmod 555 /usr/bin/checkdns

cat > /usr/bin/updatedns <<EOF
#!/bin/bash
wget -q -O /dev/null "$UPDATE_URL"
EOF
chmod 555 /usr/bin/updatedns

exit 0
5) Made the new autorun file executable ("chmod 555 ./autorun")

6) Created a new ISO image from the copied/modified directory structure:
Code:
mkisofs -o /tmp/custom_sysrescuecd.iso \
        -b isolinux/isolinux.bin \
        -c isolinux/boot.cat \
        -no-emul-boot \
        -boot-load-size 4 \
        -boot-info-table \
        -J \
        -R \
        -V custom_sysrescuecd \
        .
7) Burned the new ISO to a CD (I used Brasero, but could have done it from the commandline using cdrecord, wodim, etc.)

Last edited by haertig; 09-05-2013 at 07:13 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount options 'noatime' and 'commit=' make trouble at boot time. stf92 Slackware 2 06-08-2013 10:40 AM
Where should I add iwconfig options to make them permanent? peterx14 Linux - Wireless Networking 4 05-24-2010 04:02 PM
How do you make boot parameters permanent in Sugar? rimshot4 Linux - Newbie 1 02-02-2010 01:24 AM
How to make "acpi=off" a permanent boot option... hammanu Fedora 2 10-26-2007 03:52 PM
permanent module options: where to set? mehlkelm Debian 2 09-20-2005 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration