LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 05:01 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,283

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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, 06:59 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"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 07:01 PM.
 
Old 09-03-2013, 07:54 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,900

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
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 08:01 PM.
 
Old 09-05-2013, 04:30 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,283

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
[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 08:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:40 AM
Where should I add iwconfig options to make them permanent? peterx14 Linux - Wireless Networking 4 05-24-2010 05:02 PM
How do you make boot parameters permanent in Sugar? rimshot4 Linux - Newbie 1 02-02-2010 02:24 AM
How to make "acpi=off" a permanent boot option... hammanu Fedora 2 10-26-2007 04:52 PM
permanent module options: where to set? mehlkelm Debian 2 09-20-2005 03:18 AM

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

All times are GMT -5. The time now is 01:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration