User Tools

Site Tools


obtaining_system_installation_media

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

obtaining_system_installation_media [2019/07/10 18:50] (current)
admin created
Line 1: Line 1:
 +====== Obtaining System Installation Media ======
  
 +===== Official BlackWeb Linux CD/DVD-ROM Sets =====
 +
 +By far the easiest way to install BlackWeb Linux GNU/Linux is from an Official BlackWeb Linux CD/DVD-ROM Set. You can buy a set from a vendor. You may also download the CD/DVD-ROM images from a BlackWeb Linux mirror and make your own set, if you have a fast network connection and a CD/DVD burner (see the BlackWeb Linux CD page and BlackWeb Linux CD FAQ. If you have a BlackWeb Linux CD/DVD set and CDs/DVDs are bootable on your machine, which is the case on all modern PCs, you can skip right to Chapter 5. Much effort has been expended to ensure the most-used files are on the first CDs and DVDs, so that a basic desktop installation can be done with only the first DVD or - to a limited extent - even with only the first CD.
 +
 +As CDs have a rather limited capacity by today’s standards, not all graphical desktop environments are installable with only the first CD; for some desktop environments a CD installation requires either network connectivity during the installation to download the remaining files or additional CDs.
 +
 +If your machine doesn’t support CD booting (only relevant on very old PC systems), but you do have a CD set, you can use an alternative strategy such as hard disk, usb stick, net boot, or manually loading the kernel from the CD to initially boot the system installer. The files you need for booting by another means are also on the CD; the BlackWeb Linux network archive and CD folder organization are identical. So when archive file paths are given below for particular files you need for booting, look for those files in the same directories and subdirectories on your CD.
 +
 +Once the installer is booted, it will be able to obtain all the other files it needs from the CD.
 +
 +If you don’t have a CD set, then you will need to download the installer system files and place them on the hard disk or usb stick or a connected computer so they can be used to boot the installer.
 +
 +===== Downloading Files from BlackWeb Linux Mirrors =====
 +
 +To find the nearest (and thus probably the fastest) mirror, see the list of BlackWeb Linux mirrors.
 +
 +When downloading files from a BlackWeb Linux mirror using FTP, be sure to download the files in binary mode, not text or automatic mode.
 +
 +
 +====== Preparing Files for USB Memory Stick Booting ======
 +
 +To prepare the USB stick, you will need a system where GNU/Linux is already running and where USB is supported. With current GNU/Linux systems the USB stick should be automatically recognized when you insert it. If it is not you should check that the usb-storage kernel module is loaded. When the USB stick is inserted, it will be mapped to a device named /dev/sdX, where the “X” is a letter in the range a-z. You should be able to see to which device the USB stick was mapped by running the command dmesg after inserting it. To write to your stick, you may have to turn off its write protection switch.
 +
 +**Warning**
 +
 +The procedures described in this section will destroy anything already on the device! Make very sure that you use the correct device name for your USB stick. If you use the wrong device the result could be that all information on for example a hard disk could be lost.
 +
 +===== Preparing a USB stick using a hybrid CD or DVD image =====
 +
 +BlackWeb Linux CD and DVD images can now be written directly to a USB stick, which is a very easy way to make a bootable USB stick. Simply choose a CD or DVD image (such as the netinst, CD-1, DVD-1, or netboot) that will fit on your USB stick. See Section 4.1 to get a CD or DVD image.
 +
 +Alternatively,​ for very small USB sticks, only a few megabytes in size, you can download the mini.iso image from the netboot directory (at the location mentioned in Section 4.2.1).
 +
 +The CD or DVD image you choose should be written directly to the USB stick, overwriting its current contents. For example, when using an existing GNU/Linux system, the CD or DVD image file can be written to a USB stick as follows, after having made sure that the stick is unmounted:
 +
 +# cp BlackWeb Linux.iso /dev/sdX
 +
 +# sync
 +
 +The win32diskimager (http://​sf.net/​projects/​win32diskimager/​) utility can be used under other oper-ating systems to copy the image.
 +
 +Important: The image must be written to the whole-disk device and not a partition, e.g. /dev/sdb and not /dev/sdb1. Do not use tools like unetbootin which alter the image.
 +
 +
 +
 +Important: Simply writing the CD or DVD image to USB like this should work fine for most users.
 +
 +The other options below are more complex, mainly for people with specialised needs.
 +
 +
 +
 +The hybrid image on the stick does not occupy all the storage space, so it may be worth considering using the free space to hold firmware files or packages or any other files of your choice. This could be useful if you have only one stick or just want to keep everything you need on one device.
 +
 +Create a second, FAT partition on the stick, mount the partition and copy or unpack the firmware onto it. For example:
 + 
 +//# mount /dev/sdX2 /mnt
 +
 +# cd /mnt
 +
 +# tar zxvf /​path/​to/​firmware.tar.gz
 +
 +# cd /
 +
 +# umount /mnt//
 +
 +
 +
 +You might have written the mini.iso to the USB stick. In this case the second partition doesn’t have to be created as, very nicely, it will already be present. Unplugging and replugging the USB stick should make the two partitions visible.
 +
 +
 +===== Manually copying files to the USB stick =====
 +
 +An alternative way to set up your USB stick is to manually copy the installer files, and also a CD image to it. Note that the USB stick should be at least 1 GB in size (smaller setups are possible if you follow Section 4.3.3).
 +
 +There is an all-in-one file hd-media/​boot.img.gz which contains all the installer files (including the kernel) as well as syslinux and its configuration file .
 +
 +Note that, although convenient, this method does have one major disadvantage:​ the logical size of the device will be limited to 1 GB, even if the capacity of the USB stick is larger. You will need to repartition the USB stick and create new file systems to get its full capacity back if you ever want to use it for some different purpose.
 +
 +To use this image simply extract it directly to your USB stick:
 +
 +# zcat boot.img.gz > /dev/sdX
 +
 +
 +
 +After that, mount the USB memory stick (mount /dev/sdX /mnt), which will now have a FAT filesystem on it, and copy a BlackWeb Linux ISO image (netinst or full CD) to it. Unmount the stick (umount /mnt) and you are done.
 +
 +
 +===== Manually copying files to the USB stick — the flexible way =====
 +
 +If you like more flexibility or just want to know what’s going on, you should use the following method to put the files on your stick. One advantage of using this method is that — if the capacity of your USB stick is large enough — you have the option of copying any ISO image, even a DVD image, to it.
 +
 +===== Partitioning the USB stick =====
 +
 +We will show how to set up the memory stick to use the first partition, instead of the entire device.
 +
 +Note: Since most USB sticks come pre-configured with a single FAT16 partition, you probably won’t have to repartition or reformat the stick. If you have to do that anyway, use cfdisk or any other partitioning tool to create a FAT16 partition1, install an MBR using:
 +
 +# install-mbr /dev/sdX
 +
 +The install-mbr command is contained in the mbr BlackWeb Linux package. Then create the filesystem using:
 +
 +
 +
 +# mkdosfs /dev/sdX1
 +
 +Take care that you use the correct device name for your USB stick. The mkdosfs command is contained in the dosfstools BlackWeb Linux package.
 +
 +
 +
 +In order to start the kernel after booting from the USB stick, we will put a boot loader on the stick. Although any boot loader (e.g. lilo) should work, it’s convenient to use syslinux, since it uses a FAT16 partition and can be reconfigured by just editing a text file. Any operating system which supports the FAT file system can be used to make changes to the configuration of the boot loader.
 +
 +To put syslinux on the FAT16 partition on your USB stick, install the syslinux and mtools packages on your system, and do:
 +
 +# syslinux /dev/sdX1
 +
 +Again, take care that you use the correct device name. The partition must not be mounted when start-ing syslinux. This procedure writes a boot sector to the partition and creates the file ldlinux.sys which contains the boot loader code.
 +
 +===== Adding the installer image =====
 +
 +Mount the partition (mount /dev/sdX1 /mnt) and copy the following installer image files to the stick:
 +
 +• vmlinuz or linux (kernel binary)
 +
 +• initrd.gz (initial ramdisk image)
 +
 +You can choose between either the text-based or the graphical version of the installer. The latter can be found in the gtk subdirectory. If you want to rename the files, please note that syslinux can only process DOS (8.3) file names.
 +
 +Next you should create a syslinux.cfg configuration file, which at a bare minimum should contain the following two lines (change the name of the kernel binary to “linux” if you used a netboot image):
 +
 +default vmlinuz
 +
 +append initrd=initrd.gz
 +
 +For the graphical installer you should add vga=788 to the second line. Other parameters can be appended as desired.
 +
 +To enable the boot prompt to permit further parameter appending, add a prompt 1 line.
 +
 +If you used an hd-media image, you should now copy the ISO file of a BlackWeb Linux ISO image2 onto the stick. When you are done, unmount the USB memory stick (umount /mnt).
 +
 +====== Preparing Files for Hard Disk Booting ======
 +
 +The installer may be booted using boot files placed on an existing hard drive partition, either launched from another operating system or by invoking a boot loader directly from the BIOS.
 +
 +A full, “pure network” installation can be achieved using this technique. This avoids all hassles of removable media, like finding and burning CD images or struggling with too numerous and unreliable floppy disks.
 +
 +===== Hard disk installer booting from Linux using LILO or GRUB =====
 +
 +This section explains how to add to or even replace an existing linux installation using either LILO or GRUB.
 +
 +At boot time, both bootloaders support loading in memory not only the kernel, but also a disk image.
 +
 +This RAM disk can be used as the root file-system by the kernel.
 +
 +Copy the following files from the BlackWeb Linux archives to a convenient location on your hard drive (note that LILO can not boot from files on an NTFS file system), for instance to /​boot/​newinstall/​.
 +
 +• vmlinuz (kernel binary)
 +
 +• initrd.gz (ramdisk image)
 +
 +===== Hard disk installer booting from DOS using loadlin =====
 +
 +This section explains how to prepare your hard drive for booting the installer from DOS using loadlin.
 +
 +Copy the following directories from a BlackWeb Linux CD image to c:\.
 +
 +• /​install (kernel binary and ramdisk image)
 +
 +• /tools (loadlin tool)
 +
 +====== Preparing Files for TFTP Net Booting ======
 +
 +If your machine is connected to a local area network, you may be able to boot it over the network from another machine, using TFTP. If you intend to boot the installation system from another machine, the boot files will need to be placed in specific locations on that machine, and the machine configured to support booting of your specific machine.
 +
 +You need to set up a TFTP server, and for many machines a DHCP server, or BOOTP server.
 +
 +BOOTP is an IP protocol that informs a computer of its IP address and where on the network to obtain a boot image. The DHCP (Dynamic Host Configuration Protocol) is a more flexible, backwards-compatible extension of BOOTP. Some systems can only be configured via DHCP.
 + 
 +The Trivial File Transfer Protocol (TFTP) is used to serve the boot image to the client. Theoretically,​ any server, on any platform, which implements these protocols, may be used. In the examples in this section, we shall provide commands for SunOS 4.x, SunOS 5.x (a.k.a. Solaris), and GNU/Linux.
 +
 +Note: For a BlackWeb Linux GNU/Linux server we recommend tftpd-hpa. It’s written by the same author as the syslinux bootloader and is therefore least likely to cause issues. A good alternative is atftpd.
 +
 +
 +===== Setting up a DHCP server =====
 +
 +One free software DHCP server is ISC dhcpd. For BlackWeb Linux GNU/Linux, the isc-dhcp-server package is recommended. Here is a sample configuration file for it (see /​etc/​dhcp/​dhcpd.conf):​
 +
 +option domain-name "​example.com";​
 +
 +option domain-name-servers ns1.example.com;​ option subnet-mask 255.255.255.0;​ default-lease-time 600; max-lease-time 7200;
 +
 +server-name "​servername";​
 +
 +subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.200 192.168.1.253;​ option routers 192.168.1.1;​
 +
 +}
 +
 +host clientname {
 +
 +filename "/​tftpboot.img";​
 +
 +server-name "​servername";​
 +
 +next-server servername;
 +
 +hardware ethernet 01:​23:​45:​67:​89:​AB;​
 +
 +fixed-address 192.168.1.90;​
 +
 +}
 +
 +
 +
 +In this example, there is one server servername which performs all of the work of DHCP server, TFTP server, and network gateway. You will almost certainly need to change the domain-name op-tions, as well as the server name and client hardware address. The filename option should be the name of the file which will be retrieved via TFTP.
 +
 +After you have edited the dhcpd configuration file, restart it with /​etc/​init.d/​isc-dhcp-server restart.
 +
 +
 +===== Enabling PXE Booting in the DHCP configuration =====
 +
 +Here is another example for a dhcp.conf using the Pre-boot Execution Environment (PXE) method of TFTP.
 +
 +option domain-name "​example.com";​
 +
 +default-lease-time 600;
 + 
 +
 +max-lease-time 7200;
 +
 +allow booting;
 +
 +allow bootp;
 +
 +# The next paragraph needs to be modified to fit your case subnet 192.168.1.0 netmask 255.255.255.0 {
 +
 +range 192.168.1.200 192.168.1.253;​ option broadcast-address 192.168.1.255;​
 +
 +# the gateway address which can be different
 +
 +# (access to the internet for instance) option routers 192.168.1.1;​
 +
 +# indicate the dns you want to use
 +
 +option domain-name-servers 192.168.1.3;​
 +
 +}
 +
 +group {
 +
 +next-server 192.168.1.3;​
 +
 +host tftpclient {
 +
 +# tftp client hardware address
 +
 +hardware ethernet 00:​10:​DC:​27:​6C:​15;​ filename "​pxelinux.0";​
 +
 +}
 +
 +}
 +
 +Note that for PXE booting, the client filename pxelinux.0 is a boot loader, not a kernel image (see Section 4.5.4 below).
 +
 +
 +===== Setting up a BOOTP server =====
 +
 +There are two BOOTP servers available for GNU/Linux. The first is CMU bootpd. The other is actually a DHCP server: ISC dhcpd. In BlackWeb Linux GNU/Linux these are contained in the bootp and isc-dhcp-server packages respectively.
 +
 +To use CMU bootpd, you must first uncomment (or add) the relevant line in /​etc/​inetd.conf. On BlackWeb Linux GNU/Linux, you can run update-inetd --enable bootps, then /​etc/​init.d/​inetd reload to do so. Just in case your BOOTP server does not run BlackWeb Linux, the line in question should look like:
 +
 +bootps dgram udp wait root /​usr/​sbin/​bootpd bootpd -i -t 120
 +
 +Now, you must create an /​etc/​bootptab file. This has the same sort of familiar and cryptic format as the good old BSD printcap, termcap, and disktab files. See the bootptab manual page for more information. For CMU bootpd, you will need to know the hardware (MAC) address of the client. Here is an example /​etc/​bootptab:​
 +
 +
 +client:\
 +
 +hd=/​tftpboot:​\
 +
 +bf=tftpboot.img:​\
 +
 +ip=192.168.1.90:​\
 +
 +sm=255.255.255.0:​\
 +
 +sa=192.168.1.1:​\
 +
 +ha=0123456789AB:​
 + 
 +
 +You will need to change at least the “ha” option, which specifies the hardware address of the client.
 +
 +The “bf” option specifies the file a client should retrieve via TFTP; see Section 4.5.4 for more details.
 +
 +By contrast, setting up BOOTP with ISC dhcpd is really easy, because it treats BOOTP clients as a moderately special case of DHCP clients. Some architectures require a complex configuration for booting clients via BOOTP. If yours is one of those, read the section Section 4.5.1. Otherwise you will probably be able to get away with simply adding the allow bootp directive to the configura-tion block for the subnet containing the client in /​etc/​dhcp/​dhcpd.conf,​ and restart dhcpd with /​etc/​init.d/​isc-dhcp-server restart.
 +
 +===== Enabling the TFTP Server =====
 +
 +To get the TFTP server ready to go, you should first make sure that tftpd is enabled.
 +
 +In the case of tftpd-hpa there are two ways the service can be run. It can be started on demand by the system’s inetd daemon, or it can be set up to run as an independent daemon. Which of these methods is used is selected when the package is installed and can be changed by reconfiguring the package.
 +
 +Note: Historically,​ TFTP servers used /tftpboot as directory to serve images from. However, BlackWeb Linux GNU/Linux packages may use other directories to comply with the Filesystem Hierarchy Standard (http://​www.pathname.com/​fhs/​). For example, tftpd-hpa by default uses /srv/tftp. You may have to adjust the configuration examples in this section accordingly.
 +
 +
 +All in.tftpd alternatives available in BlackWeb Linux should log TFTP requests to the system logs by default. Some of them support a -v argument to increase verbosity. It is recommended to check these log messages in case of boot problems as they are a good starting point for diagnosing the cause of errors.
 +
 +===== Move TFTP Images Into Place =====
 +
 +Next, place the TFTP boot image you need, as found in Section 4.2.1, in the tftpd boot image di-rectory. You may have to make a link from that file to the file which tftpd will use for booting a particular client. Unfortunately,​ the file name is determined by the TFTP client, and there are no strong standards.
 +
 +For PXE booting, everything you should need is set up in the netboot/​netboot.tar.gz tarball. Simply extract this tarball into the tftpd boot image directory. Make sure your dhcp server is config-ured to pass pxelinux.0 to tftpd as the filename to boot.
 +
 +====== Automatic Installation Using the BlackWeb Linux Installer ======
 +
 +The BlackWeb Linux Installer supports automating installs via preconfiguration files. A preconfiguration file can be loaded from the network or from removable media, and used to fill in answers to questions asked during the installation process.
obtaining_system_installation_media.txt · Last modified: 2019/07/10 18:50 by admin

(C) BlackWeb Security 2017 - 2019