General Linux Items / Commands II

##How Create a Boot ISO##

isolinux is used for booting the Red Hat Enterprise Linux installation CD. To create your own CD-ROM to boot the installation program, use the following instructions:

Copy the isolinux/ directory from the Red Hat Enterprise Linux CD #1 into a temporary directory (referred to here as <path-to-workspace>) using the following command:

cp -r <path-to-cd>/isolinux/<path-to-workspace>

Change directories to the <path-to-workspace> directory you have created:

cd <path-to-workspace>

Make sure the files you have copied have appropriate permissions:

chmod u+w isolinux/*

Finally, issue the following command to create the ISO image file:

mkisofs -o file.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/

 

The above command was split into two lines for printing purposes only. When you execute this command, be sure to type it as a single command, all on the same line.

Burn the resulting ISO image (named file.iso and located in <path-to-workspace>) to a CD-ROM as you normally would.

Burn the iso image you just created to a CD any way you like.

Drop the CD into the computer you want to install, and reboot the machine. When the boot prompt comes up type linux ks=cdrom:filename.cfg

Watch your machine install!

##How Create a Repo##

To install the RPM, you’ll need to type this command:

# yum install createrepo

Create a directory on a web server.

#  mkdir /var/www/html/repo/5/x86_64/

Copy your rpm’s to the directory you just created and run this command to create all the metadata required:

# createrepo /var/www/html/repo/5/x86_64/

Your local YUM repository has been created. Whenever you put in any new RPMs, you’ll have to run the above command, so that the new repository metadata gets updated.

Creating gpg keys for your new repo

# mkdir ~/.gnupg

You might get the error ‘mkdir: cannot create directory `/root/.gnupg’: File exists’

No problem, just means it is already there

# gpg --gen-key

gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.

This program comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it

under certain conditions. See the file COPYING for details.

Please select what kind of key you want:

(1) DSA and Elgamal (default)

(2) DSA (sign only)

(5) RSA (sign only)

Your selection?

Select 1

Your selection? 1

DSA keypair will have 1024 bits.

ELG-E keys may be between 1024 and 4096 bits long.

What keysize do you want? (2048)

Press Enter

Requested keysize is 2048 bits

Please specify how long the key should be valid.

0 = key does not expire

<n> = key expires in n days

<n>w = key expires in n weeks

<n>m = key expires in n months

<n>y = key expires in n years

Key is valid for? (0)

Press Enter

Key does not expire at all

Is this correct? (y/N)

Press y and enter

You need a user ID to identify your key; the software constructs the user ID

from the Real Name, Comment and Email Address in this form:

“Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>”

Real name:

As an example I used John Doe

Press Enter

Real name: John Doe

Email address:

Enter the maintainers email address. Example: john.doe@hq38.hohenfels.com

Real name: John Doe

Email address: John.doe@hq38.hohenfels.com

Comment:

Enter “Signing Key for Project Name” replace Project Name with the name of your project.
Press enter

You selected this USER-ID:

John Doe (Signing Key for Project Name) <john.doe@hq38.hohenfels.com>

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?

If it is all OK, Press O
Press Enter
Enter passphrase:
Enter your passphrase, you will need to remember this!
Press Enter
Repeat passphrase:
Enter the same passphrase again
Press Enter

We need to generate a lot of random bytes. It is a good idea to perform

some other action (type on the keyboard, move the mouse, utilize the

disks) during the prime generation; this gives the random number

generator a better chance to gain enough entropy.

++++++++++.+++++++++++++++++++++++++..+++++++++++++++..+++++.++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++….+++++.+++++++++++++++>+++++……>+++++……………………………………………………….+++++

Not enough random bytes available. Please do some other work to give

the OS a chance to collect more entropy! (Need 284 more bytes)

gpg: key 10D9424E marked as ultimately trusted

public and secret key created and signed.

gpg: checking the trustdb

gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model

gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u

pub 1024D/10D9424E 2011-05-12

Key fingerprint = A5CD 97A1 6EA6 DC01 CCC3 0A7B DEA6 CD67 10D9 424E

uid Enoch Root <root@vaausmul1.aac.va.gov>

sub 2048g/93C388B3 2011-05-12

# gpg --export --armor 10D9424E > /tmp/RPM-GPG-KEY-(Project abbreviation)
Example Project Abbreviations: PRE or SLC

Copy your new key to your new repo

# cp /tmp/ RPM-GPG-KEY-(Project abbreviation) /var/www/html/repo/5/x86_64/
# vi /root/.rpmmacros
and insert this at the top %_signature gpg

It should look like this:

%_signature gpg

%_gpg_name John Doe <john.doe.va.gov> (This will be your maintainers name and email address)

If it is not there, create a new file with the above info.

Then you can start resigning your custom channel rpm’s

#rpm –resign /var/www/html/repo/5/x86_64/putty-0.60-6.20100910svn.el5.1.x86_64.rpm

Enter pass phrase:

Done!

To Sync with the Nat Sat we will need the Pub ID marked in red above and the Key fingerprint marked in purple above as well as the URL to your key.

http://spacewalk.hohenfels.com/repo/5/x86_64/

10D9424E

A5CD 97A1 6EA6 DC01 CCC3 0A7B DEA6 CD67 10D9 424E

 

#Resizing images

mogrify -resize 800x600 *.jpg