![]() |
![]() |
![]() |
![]() |
![]() |
Inhaltsverzeichnis |
Notice:
the procedures described in this tutorial are to be considered "as is", without any warranty. There is no relationship between the original distro Slackware (great distro!) and the ideas contained in this article.
I think that the usbboot.img idea, as system to make a bootable USB-stick, has to be overcome, It is slow as boot time and uses a proprietary FAT filesystem. The only reason whereby Slackware team mantains this system in use is, perhaps, because the windows users cannot run bash scripts in their own system.
But to run a simple bash script is sufficient any Linux system, also the mini-system inside the Slackware DVD, so, also windows users that have at least a PC with DVD reader can run an external script.
This is a simple script that can make a bootable USB-stick (or USD-HD) similar at Slackware installation DVD, that may contains also the packages to perform Slackware installation in computers without DVD reader. Download the script File:UsbslackDVDboot.sh
Rev.03 - 2013-03-13 some improvments. Notes:
#Uncomment below if you get errors type: Warning: '/proc/partitions' does not match '/dev' directory structure. cp -Rpdf /dev/* $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/dev/
usbslackDVDboot.sh this is the code: |
---|
#!/bin/sh # usbslackDVD.sh - Make a bootable USB-stick (or USB-HD) from Slackware # copyleft Fabio Zorba 2012-2013 # rev.03 - 2013-03-13 # Note: Slackware14 kernel needs LILO version 23.2 to boot SLACK_INSTALL_PATH="SlackDVD" USB_TEMP_MOUNTPOINT="../USB_SLACK_TEMP_MOUNTPOINT" if [ $# -eq 2 ] ; then ROOT_DEV=/dev/$1 #-------- check device --------- case "$1" in sda) BOOT_DEVICE="/dev/sda$2" ;; sdb) BOOT_DEVICE="/dev/sdb$2" ;; sdc) BOOT_DEVICE="/dev/sdc$2" ;; sdd) BOOT_DEVICE="/dev/sdd$2" ;; sde) BOOT_DEVICE="/dev/sde$2" ;; sdf) BOOT_DEVICE="/dev/sdf$2" ;; sdg) BOOT_DEVICE="/dev/sdg$2" ;; sdh) BOOT_DEVICE="/dev/sdh$2" ;; *) BOOT_DEVICE="not_in_list" ;; esac if [ "a$BOOT_DEVICE" = "anot_in_list" ] ; then echo "Error device $ROOT_DEV, valid names are: sda,sdb,sdc,sdd,sde,sdf,sdh ... exit" exit fi echo " --------------------------------------------------- You selected $BOOT_DEVICE device to install SLACK filesystem. Warning ! All data in selected device may be LOST " echo -n "type 'okay' to proceed : " read NNN if [ "a$NNN" = "aokay" ] ; then EXIST_DEVICE=`ls $BOOT_DEVICE` if [ "a$EXIST_DEVICE" == "a" ] ; then echo "Error device $BOOT_DEVICE not exists ... exit" exit fi #Check if Slackware DVD is present in system DVD_MOUNTPOINT=`mount | grep iso9660 | cut -d" " -f3` if [ ! -d $DVD_MOUNTPOINT/slackware ] ; then echo " Error Slackware DVD not found or not mounted ... exit try to mount by hand: mount /dev/sr0 /mnt/cdrom or mount /dev/hda /mnt/cdrom " exit fi USB_MOUNTPOINT=`mount | grep $BOOT_DEVICE | cut -d" " -f3` if [ "a$USB_MOUNTPOINT" == "a" ] || [ ! -d $USB_MOUNTPOINT ] ; then echo "Format the partition $BOOT_DEVICE ? [ENTER=no]" echo -n "... or type 'okay' to proceed with formatting: " read NNN if [ "a$NNN" = "aokay" ] ; then mkfs.ext2 $BOOT_DEVICE fi mkdir $USB_TEMP_MOUNTPOINT mount $BOOT_DEVICE $USB_TEMP_MOUNTPOINT IS_USB_MOUNTED=`mount | grep $USB_TEMP_MOUNTPOINT` if [ "a$IS_USB_MOUNTED" = "a" ] ; then echo "Error: $ROOT_DEV device not mounted in $USB_TEMP_MOUNTPOINT ... exit" exit fi else echo "$BOOT_DEVICE already mounted in $USB_MOUNTPOINT, I will install inside this one ..." USB_TEMP_MOUNTPOINT=$USB_MOUNTPOINT fi echo "Make usb-disk devices" mkdir -p $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH mkdir -p $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/boot mkdir -p $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/dev mkdir -p $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/etc echo "Copying files ..." cp -f $DVD_MOUNTPOINT/kernels/hugesmp.s/bzImage $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/boot cp -f $DVD_MOUNTPOINT/isolinux/initrd.img $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/boot #Add Slackware packages to root of partition echo "Copy Slackware packages to $BOOT_DEVICE ? [ENTER=no]" echo -n "type 'yes' to begin copying files: " read NNN if [ "a$NNN" = "ayes" ] ; then echo "Copying Slackware packages ..." cp -Rf $DVD_MOUNTPOINT/slackware $USB_TEMP_MOUNTPOINT/ fi #Make usb devices in /dev because Lilo needs them START=0 MINOR=0 for DISK in "a" "b" "c" "d" "e" "f" "g" "h" do MINOR=$START for i in 0 1 2 3 4 5 6 do if [ $i -eq 0 ] ; then mknod $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/dev/sd$DISK b 8 $MINOR else mknod $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/dev/sd$DISK$i b 8 $MINOR fi let MINOR=$MINOR+1 done let START=$START+16 done #Uncomment below if you get errors type: #Warning: '/proc/partitions' does not match '/dev' directory structure. cp -Rpdf /dev/* $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/dev/ echo "LILO will be installed to $ROOT_DEV by default ..." echo echo -n "You may select another device [enter=default] : " read ELSE_ROOT_DEV if [ "a$ELSE_ROOT_DEV" != "a" ] ; then ROOT_DEV=$ELSE_ROOT_DEV fi echo echo "flushing disk cache before install Lilo ... please wait ..." echo " # LILO configuration file # generated by Zoros # # Start LILO global section # Append any additional kernel parameters: boot = $ROOT_DEV prompt compact lba32 vga = normal timeout = 50 # Linux bootable partition config begins image = /boot/bzImage initrd=/boot/initrd.img label = SlackDVD read-write # Linux bootable partition config ends " > $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH/etc/lilo.conf lilo -P ignore -r $USB_TEMP_MOUNTPOINT/$SLACK_INSTALL_PATH if [ "a$USB_MOUNTPOINT" == "a" ] ; then umount $USB_TEMP_MOUNTPOINT rmdir $USB_TEMP_MOUNTPOINT fi fi else echo " This script make a bootable USB-Stick (or HD) from Slackware DVD ... Pay attention: all data in selected device may be lost. Usage: $0 device [sdb,sdb,sdc...] n.partition [1,2,3...] " fi
|
Note: the script is not wide scale tested, but so far it has worked well on several PCs
To make a bootable USB-stick, you must mount Slackware DVD in your system before run the script. You must be sure that you known exactly the name of USB disk connected to your PC: the script can format the disk, so all data in target device will be lost.
However, you can make the bootable USB-stick without formatting, infact the script will install entire system in a folder named "SlackDVD". The script will not format the USB device if this is already mounted, but, in every case, the script will copy the right files and will install the boot manager Lilo.
$su - # fsisk -l Disk /dev/sda: 251.0 GB, 251000193024 bytes 255 heads, 63 sectors/track, 30515 cylinders, total 490234752 sectors ... Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors ... Disk /dev/sdc: 4022 MB, 4022337024 bytes 255 heads, 63 sectors/track, 489 cylinders, total 7856127 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x516cb889 Device Boot Start End Blocks Id System /dev/sdc1 63 7438094 3719016 83 Linux /dev/sdc2 * 7438095 7855784 208845 b W95 FAT32 #
in this example the usb device is /dev/sdc1, already formatted with ext2 ... in this case you can also mount also the device, or to be sure that is umounted, so the script will begin formatting it.
./usbslackDVDboot.sh sdc 1
then follow the program instructions, have fun!
When using the Slackware installer to create the usb-stick you have to make additional operations, in particular install "lilo", because it is not present in the system by default. Here is an example:
mkdir /slackcdrom mount /dev/sr0 /slackcdrom installpkg /slackcdrom/slackware/a/lilo-*.txz
and, of course, copy the script usbslackDVDboot.sh in the home directory, /root for example
Zoros 00:45, 10 October 2012 (CEST)