Start_here script for porteus

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Start_here script for porteus

Post#1 by brokenman » 04 Feb 2011, 00:32

If someone would be willing to write a couple of scripts for boot folder i would appreciate it.

A batch file for windows users and an .sh for linux users. They would both reside within the boot folder and would be named start_here.xxx

When clicked on (or called from console) they would provide a menu:

1. Read install Porteus manual
2. Advice for installing on FAT32
3. Install Porteus to USB device
4. Exit
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#2 by Ahau » 04 Feb 2011, 01:04

I would certainly be willing to help with assembling the documentation that will go into the text files, but I'm not much help in the scripting department...
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Start_here script for porteus

Post#3 by brokenman » 04 Feb 2011, 08:40

That's great! I am thinking of melding all of the documentation in the boot folder into one document perhaps called INSTRUCTIONS.TXT. It would contain information about how to install porteus, FAT32 issues and save.dat, cheatcodes and anything else you can think of. I think it would clean things up a little.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#4 by Ahau » 07 Feb 2011, 18:52

@brokenman
As I start assembling documentation, I want to make sure that I'm heading in the right direction.

1. would be the main body of the install, for CD, USB, and perhaps frugal (if I can get some help writing a how-to for this section)
2. would be mostly about creating a .dat container (sounds like this may be implemented through linuxrc on FAT/NTFS, as the latest kernel is getting pissy with posixvol--correct?)
3. would run the porteus-usb script to do the actual install (not valid in windows). Or, would it copy the files and call the bootinst.bat/.sh? Or, would 1. above not give instructions for USB install, and those instructions would be here?

Thanks for the clarification...I don't want to draft something up in the completely wrong format.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Start_here script for porteus

Post#5 by Hamza » 07 Feb 2011, 18:57

Hello,

@brokenman
Maybe , when i have a time :D , i will try to writing a shell script for installation of Porteus
and , this script need to be compatible with LXDE and KDE Desktop for Dialog (KDialog or XDialog) ?

Regards,
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Start_here script for porteus

Post#6 by brokenman » 08 Feb 2011, 04:00

1. would be the main body of the install, for CD, USB, and perhaps frugal (if I can get some help writing a how-to for this section)
Correct
2. would be mostly about creating a .dat container (sounds like this may be implemented through linuxrc on FAT/NTFS, as the latest kernel is getting pissy with posixvol--correct?)
Correct again. Since i posted last, this will now be taken care of in linuxrc but users will still need to know how to edit porteus.cfg after it is created. They will be pushed into fresh mode after save.dat is created.
3. would run the porteus-usb script to do the actual install (not valid in windows). Or, would it copy the files and call the bootinst.bat/.sh? Or, would 1. above not give instructions for USB install, and those instructions would be here?
There will probably write a start_here.bat & start_here.sh and both will call the same documentation.

@Karis
I have included Xdialog in beta release. This will work for at least KDE/LXDE.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#7 by Ahau » 08 Feb 2011, 21:35

Here's my rough draft of an installation guide, to be called from your script. I'm also thinking a version could live in the documentation section of the website and here on the forum (maybe in multiple languages?).

I'd love feedback, suggestions for additions or deletions, clarifications, etc. I want this to be comprehensive yet simple and easy to understand.

I'd also like some help with the 'frugal install' section, so that I can have some instructions for installing alongside windows, on a netbook, for example. I don't have a netbook (or any computer on which I can install Porteus alongside Windows), so cannot test this myself.


***************************************
* Official Porteus Installation Guide *
***************************************

Introduction:
-----------------

Porteus is a linux distribution that runs live, without being 'installed' natively, in the same way most other operating systems are. Porteus creates it's file system on the fly, within seconds, every time it is started up. This allows it to be run from many different kinds of media, including:

1)Writeable CD's or DVD's
2)USB Flash Drives (aka Pendrives)
3)External or Internal Hard Drives
4)Other writeable media, including flash cards, mp3 players, etc. (these installations are not covered by this Guide).

Porteus comes in the form of an ISO image file. An ISO file is an 'image' of what should be on a CD/DVD. This file can be burned as a CD or DVD, or it can be mounted as a file system or upacked to gain access to the files for installations other than CD/DVD. Burning the file to a CD is the easiest method of installation, but none of the changes you make (or files that you download) will be saved once the system is rebooted. Installing Porteus to a flash drive or hard drive will allow you to save your changes and add new files and programs easily.

Downloading Porteus
-----------------------

Porteus has two editions: 32-bit (i486) and 64-bit (x86_64). If you are running a 64-bit computer system, then you can download either edition. If you are running a 32-bit system, then you must download the 32-bit edition. Both editions can be downloaded by going to http://www.porteus.org, hovering over the 'Download' tab at the top of the webpage, and selecting your edition from the dropdown menu. You will be presented with an Index menu from our server. Click on "current", and then click on the porteus .iso file to download it.

Once your download is complete, you should also download the md5sums.txt file (from the same directory as the .iso file you just downloaded) and check to make sure the Md5 sum of your .iso file matches the Md5 sum listed in the md5sums.txt file. This will ensure that the .iso file was not corrupted while being downloaded. If your Md5 sum does not match, you should delete the .iso file and download it again, or Porteus may not run properly. If you do not already have software to check the Md5 Sum, you can use some freely available software such as winMd5.

*******************************************
* Burning an ISO file to a CD or DVD Disk *
*******************************************

Most CD/DVD creation software has a function to 'burn an image to disk'. Please be aware that this is not the same as simply burning a file to disk or creating a 'data disk'. The end result should not be a disk that contains the .iso file, e.g. 'porteus-v10-i486.iso'. The end result should be a disk that contains two folders: one called 'boot' and one called 'porteus'.

If your current CD/DVD creation software doesn't contain the function to 'burn an image to disk' then you can use some freely available software such as imgburn.

Steps to install (varies by CD creation program):
----------------------------------------------------

1) Insert a blank writeable CD or DVD.

2) Start your CD/DVD creation software and select 'burn image' or 'burn image to disk'

3) Navigate to and select the Porteus .iso file

4) Burn the file to the disk.

5) Check the CD to make sure it contains the 'boot' and 'porteus' folders.

5) Reboot your computer, leaving the disk in your computer.

In order for your computer to run Porteus from a disk, you must make sure that your BIOS is set to boot to your CDROM device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*******************************************
* Installing Porteus to a USB Flash Drive *
*******************************************

~~~~~~~~~~~~~~~~~
| From Windows: |
~~~~~~~~~~~~~~~~~

Porteus is installed to a flash drive by copying the files from the .iso file to the flash drive and then making the drive bootable. Please note that you must be logged in as an administrator (or run the included batch file with administrative priveleges) in order to make your drive bootable from Windows.

In order to install Porteus to a flash drive, you must first extract the porteus .iso file so that you can copy the included folders ('boot' and 'porteus') to your flash drive. This can be done with archival software, similar to unzipping a .zip file. If your existing archival software cannot extract an .iso file, then try installing the free application 7zip. Once it is installed, you can right click on the .iso file, choose 7zip from the menu, and select the option to extract the file.

(*NOTE* you can also use a program called wincdemu, which will allow you to double click on the .iso file and then access the folders inside it as if it were a CD mounted in your CD drive).

If you have already created a bootable Porteus CD, you can also insert that CD and copy the files from there.

Steps to install:
---------------------

1) Insert your flash drive and open it to view the contents. Make a note of the Drive Letter assigned to this drive (e.g. E:\)

2) Copy the folders 'boot' and 'porteus' from the .iso file to the top-level directory of your flash drive (meaning the files should not be placed inside any other folders on the drive. For example, they should be located at E:\boot and E:\porteus, assuming your flash drive is device E:\).

3) Navigate into the boot folder that you just copied to your flash drive. You should see a batch file there called start_here.bat. Right click on this file (make sure it is start_here.bat and not start_here.sh) and choose to run it as an administrator. A black window (command prompt) should appear with a menu.

4) From the menu, select 'Install Porteus to USB device', though it is highly recommended that you read the section 'Advice for Installing on Windows Filesystems' first.

5) Follow the instructions given from here, and be sure to confirm that the correct drive letter is being made bootable. This is important as the batch file will write to the master boot record (MBR) on the first sector of the device from which the script is run. Your flash drive will not be made bootable if you write to the MBR of another device, and it could make it so that your computer will no longer boot to Windows.

6) After running the batch file, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*NOTE* If you are having problems making your drive bootable from within Windows or if you do not have administrative priveleges, try burning Porteus to a CD or DVD using the instructions above, and then follow the instructions to install Porteus to a USB flash drive from Linux, below.

~~~~~~~~~~~~~~~
| From Linux: |
~~~~~~~~~~~~~~~

Installing Porteus through Linux is similar to installing through Windows. You must have root (super user) priveleges on your system in order to run the installation script.

Before installing, you must extract or mount the .iso file in order to copy the /boot and /porteus directories to your target device. Some archiving programs are capable of extracting the .iso, or you can simply mount it with the following commands:

mkdir /mnt/loop
mount -o loop /path/to/file.iso /mnt/loop

If you are using Porteus for this installation, you can simply enter:

mloop /path/to/file.iso

And you can then navigate to /mnt/loop to access the necessary files. If you are running from a Porteus CD, you can navigate to /mnt/sr0/ and copy the files from there.

Steps to Install:
---------------------

1) Insert your flash drive. If a window automatically pops up when you plug it in, click to open the device. This will mount your flash drive and you can see it's path by opening a console and typing:

mount

If the device is not mounted automatically, then you can open a console and type:

fdisk -l

to get the path, and then:

mount /dev/sdb1 (assuming sdb1 is the correct path given by fdisk)

Make note of the device's name, as this is the device which will need to be modified by a script later in the process.

2) Copy the files /boot and /porteus from the Porteus .iso file (or from a Porteus CD) to the root directory of your flash drive (meaning the files should not be placed inside any other folders on the drive. For example, they should be located at /mnt/sdb1/boot and /mnt/sdb1/porteus, assuming your flash drive is device sdb1, and is mounted at /mnt/sdb1).

3) Open a console and change directories to the boot folder that you just copied into the flash drive, e.g.

cd /mnt/sdb1/boot

Execute the start_here.sh script:

./start_here.sh

*Note* If you are not running as root already, you must use the sudo command and enter your root password before starting this script, or it will not be able to configure your device properly.

This script will bring up a menu.

4) From the menu, select 'Install Porteus to USB device'. It is highly recommended that you read the section 'Advice for installing on Windows Filesystems' first, if you are planning on installing Porteus to a partition that is formatted with a Windows filesystem (e.g. FAT32 or NTFS).

5) Follow the instructions given by the script from here, and be sure to confirm that the correct device is being made bootable. This is important as the script will write to the master boot record (MBR) on the first sector of the device from which the script is run. Your flash drive will not be made bootable if you write to the MBR of another device, and it could make it so that your computer will no longer boot.

6) After running the script, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*****************************************************
* Installations to Internal or External Hard Drives *
*****************************************************

Porteus can be installed to Hard drives, but it should be left in its' compressed state (otherwise known as a 'Frugal' installation). Installing extracted files to a hard drive is not supported; it is suggested that you install Slackware Linux instead if you wish to have an Operating System installed to your system natively.

Creating a 'Frugal' installation is very similar to installing on a USB drive. Porteus can be installed on it's own partition, or it can be installed side by side with Windows or another Linux OS on the same partition. If you are installing Porteus on a partition that is formatted with a Windows filesystem (e.g. FAT32 or NTFS), it is highly recommended that you read the 'Advice for installing on Windows Filesystems' entry in the /boot/start_here.sh script prior to completing your installation.

If Porteus is the only Operating System that you are installing to a device (internal or external), follow the instructions given above for installing to a USB flash drive, making sure you tell the start_here script to write to the Master Boot Record of the desired drive.

For directions on installing Porteus to a device that will also run other operating systems, please visit the documentation section and/or the community forum at the Porteus website, at http://porteus.org. These installations are highly variable depending on whether or not Windows needs to be installed on the device, and on what bootloader is used for the system.


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ APPENDIX A: Configuring your boot settings in BIOS $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

In order to boot Porteus from a device other than your computer's hard drive, you must make sure that your BIOS is set to boot to that device before booting to the first hard disk.

To enter the BIOS of your machine, you will need to press a particular key during your computer's startup procedure. The exact key varies from computer to computer, but is typically shown briefly during startup, and it is usually one of the following keys:
F1, F2, F12, Esc, Tab, etc.

Once you press the specified key, you will be shown the BIOS menu. While in BIOS, the legend for using the keyboard is at the bottom of the screen. Inside the BIOS menu, you should look for your 'boot order' option, and set your desired device (CDROM or USB device) to the top of the list. Once you have changed your boot order, press F10 to save your changes and exit. If you are planning to boot to a USB device, make sure it is plugged in when you enter your BIOS, as some systems will only show the USB option when a USB device is present.

Many machines also have another key to press during startup that allows you to choose which device to boot from, without entering the BIOS. While this is very handy, at some stage you will probably want to change the BIOS setting so you don't have to keep pressing this button at every boot. Be aware if your machine contains sensitive data and is used by other people that leaving the setting to 'boot from USB' presents a security risk. Others could also plug in a device and boot to their own OS and access the information on your hard drive.

No Boot from USB in BIOS?
-------------------------

Don't panic just yet, you may still be able to boot from your USB device. Porteus contains a boot loader called Plop. Using this boot loader, you can plug in your USB device as well as a Porteus CD. Boot to the CD and when the Porteus menu comes up, highlight the Plop Boot Manager and press enter to start up Plop. Within Plop, you can select 'USB', and press enter to boot from the USB device


Many thanks to brokenman, as this document is mostly plagiarized from his documentation on the website :)
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Start_here script for porteus

Post#8 by fanthom » 09 Feb 2011, 00:59

Code: Select all

 Burning the file to a CD is the easiest method of installation, but none of the changes you make (or files that you download) will be saved once the system is rebooted.
not true - you can boot form CD and save changes on external writable media, ie. 'changes=/dev/sda1/porteus_changes'. please mention that and about other useful parameters from /porteus/cheatcodes.txt

Code: Select all

it is highly recommended that you read the section 'Advice for Installing on Windows Filesystems' first.
be aware that we dont have slaxsave.dat containers supplied by default as it was removed just today. Please mention that when MS filesystem is discovered by init script then user will be prompted for creating .dat image files with desired size (info about free size which is available is displayed automatically). Please explain what .dat image is, why it is necessary, how to get inside .dat file by using 'mount -o loop' command and only for advanced linux users - how to clean it up.

Code: Select all

Your flash drive will not be made bootable if you write to the MBR of another device, and it could make it so that your computer will no longer boot to Windows.
we should be able to prevent it when switching to G4D is done :) please leave it as for now.

no other issues found. VERY GOOD JOB guys.
:Bravo: :beer:
Please add [Solved] to your thread title if the solution was found.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Start_here script for porteus

Post#9 by brokenman » 09 Feb 2011, 03:43

Excellent job. Very clear and concise. No doubt we will find some tweaks as we go along. Perhaps add some stuff in about running the start_here script ( i can do this) and about bootloaders once we know more.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#10 by Ahau » 09 Feb 2011, 15:24

fanthom wrote:be aware that we dont have slaxsave.dat containers supplied by default as it was removed just today. Please mention that when MS filesystem is discovered by init script then user will be prompted for creating .dat image files with desired size (info about free size which is available is displayed automatically). Please explain what .dat image is, why it is necessary, how to get inside .dat file by using 'mount -o loop' command and only for advanced linux users - how to clean it up.
Thanks, fanthom! I've started on your suggestions (please be advised, they are only making the document longer :lol: ). When you say "when MS filesystem is discovered by init script"-- this will occur during the first bootup after they install, and they will need to create a .dat image file, get forced into always fresh mode, then edit changes= in their menu.lst, correct?

Also...I may need an "advanced linux user" to explain how to clean up the .dat :D

mloop will work for those accessing .dat files from within porteus, correct?
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
X-Factor
Black ninja
Black ninja
Posts: 88
Joined: 29 Dec 2010, 23:19
Location: bali, indonesia

Re: Start_here script for porteus

Post#11 by X-Factor » 09 Feb 2011, 16:07

@ahau

found these on my uncle notes

http://www.slax.org/forum.php?action=vi ... ntID=38664
http://www.slax.org/forum.php?action=vi ... ntID=65147

bb n fanthom seems to me in it.

CYA in 2 days :)
I've been confine to my quarter
http://img143.imageshack.us/i/medusathing.jpg/

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Start_here script for porteus

Post#12 by brokenman » 09 Feb 2011, 22:23

and they will need to create a .dat image file, get forced into always fresh mode, then edit changes= in their menu.lst, correct?
The initial .dat file is created automatically after the user chooses a size (512Mb - 1024Mb) then they are forced into fresh mode where they must change the porteus.cfg file to point to the save.dat file. (changes=)

The mloop script may mount read only. Since Porteus has an extra loop upon boot you can use: mount -no loop save.dat /mnt/loop.
(The -n fores the mount)
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#13 by Ahau » 10 Feb 2011, 16:32

Is a full path needed to save.dat? e.g.:

mkdir /mnt/loop
mount -no /mnt/live/mnt/sdb1/porteus/save.dat /mnt/loop

Or, will porteus be able to find it with just:

mount -no save.dat /mnt/loop (I've left it as you stated for my next draft version).

Here's my install guide, version 0.2:
(major changes in bold--btw, I'm up to 18KB :shock: )

***************************************
* Official Porteus Installation Guide *
***************************************

Introduction:
-----------------

Porteus is a linux distribution that runs live, without being 'installed' natively, in the same way most other operating systems are. Porteus creates it's file system on the fly, within seconds, every time it is started up. This allows it to be run from many different kinds of media, including:

1)Writeable CD's or DVD's
2)USB Flash Drives (aka Pendrives)
3)External or Internal Hard Drives
4)Other writeable media, including flash cards, mp3 players, etc. (these installations are not covered by this Guide).

Porteus comes in the form of an ISO image file. An ISO file is an 'image' of what should be on a CD/DVD. This file can be burned as a CD or DVD, or it can be mounted as a file system or upacked to gain access to the files for installations other than CD/DVD. Burning the file to a CD is the easiest method of installation, but none of the changes you make (or files that you download) will be saved once the system is rebooted*. Installing Porteus to a flash drive or hard drive will allow you boot up more quickly, save changes to your flashdrive and add new files and programs easily.

*Note that changes to your system can be saved to external media when running Porteus (from a CD or otherwise), using the 'changes=' cheatcode, and specifying the path to the desired storage location. You can find more information on this and many other useful cheatcodes in the file /porteus/cheatcodes.txt.
Downloading Porteus
-----------------------

Porteus has two editions: 32-bit (i486) and 64-bit (x86_64). If you are running a 64-bit computer system, then you can download either edition. If you are running a 32-bit system, then you must download the 32-bit edition. Both editions can be downloaded by going to http://www.porteus.org, hovering over the 'Download' tab at the top of the webpage, and selecting your edition from the dropdown menu. You will be presented with an Index menu from our server. Click on "current", and then click on the porteus .iso file to download it.

Once your download is complete, you should also download the md5sums.txt file (from the same directory as the .iso file you just downloaded) and check to make sure the Md5 sum of your .iso file matches the Md5 sum listed in the md5sums.txt file. This will ensure that the .iso file was not corrupted while being downloaded. If your Md5 sum does not match, you should delete the .iso file and download it again, or Porteus may not run properly. If you do not already have software to check the Md5 Sum, you can use some freely available software such as winMd5.

*******************************************
* Burning an ISO file to a CD or DVD Disk *
*******************************************

Most CD/DVD creation software has a function to 'burn an image to disk'. Please be aware that this is not the same as simply burning a file to disk or creating a 'data disk'. The end result should not be a disk that contains the .iso file, e.g. 'porteus-v10-i486.iso'. The end result should be a disk that contains two folders: one called 'boot' and one called 'porteus'.

If your current CD/DVD creation software doesn't contain the function to 'burn an image to disk' then you can use some freely available software such as imgburn.

Steps to install (varies by CD creation program):
----------------------------------------------------

1) Insert a blank writeable CD or DVD.

2) Start your CD/DVD creation software and select 'burn image' or 'burn image to disk'

3) Navigate to and select the Porteus .iso file

4) Burn the file to the disk.

5) Check the CD to make sure it contains the 'boot' and 'porteus' folders.

5) Reboot your computer, leaving the disk in your computer.

In order for your computer to run Porteus from a disk, you must make sure that your BIOS is set to boot to your CDROM device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*******************************************
* Installing Porteus to a USB Flash Drive *
*******************************************

~~~~~~~~~~~~~~~~~
| From Windows: |
~~~~~~~~~~~~~~~~~

Porteus is installed to a flash drive by copying the files from the .iso file to the flash drive and then making the drive bootable. Please note that you must be logged in as an administrator (or run the included batch file with administrative priveleges) in order to make your drive bootable from Windows.

In order to install Porteus to a flash drive, you must first extract the porteus .iso file so that you can copy the included folders ('boot' and 'porteus') to your flash drive. This can be done with archival software, similar to unzipping a .zip file. If your existing archival software cannot extract an .iso file, then try installing the free application 7zip. Once it is installed, you can right click on the .iso file, choose 7zip from the menu, and select the option to extract the file.

(*NOTE* you can also use a program called wincdemu, which will allow you to double click on the .iso file and then access the folders inside it as if it were a CD mounted in your CD drive).

If you have already created a bootable Porteus CD, you can also insert that CD and copy the files from there.

Steps to install:
---------------------

1) Insert your flash drive and open it to view the contents. Make a note of the Drive Letter assigned to this drive (e.g. E:\)

2) Copy the folders 'boot' and 'porteus' from the .iso file to the top-level directory of your flash drive (meaning the files should not be placed inside any other folders on the drive. For example, they should be located at E:\boot and E:\porteus, assuming your flash drive is device E:\).

3) Navigate into the boot folder that you just copied to your flash drive. You should see a batch file there called start_here.bat. Right click on this file (make sure it is start_here.bat and not start_here.sh) and choose to run it as an administrator. A black window (command prompt) should appear with a menu.

4) From the menu, select 'Install Porteus to USB device'. Follow the instructions given by the script, and be sure to confirm that the correct drive letter is being made bootable. This is important as the batch file will write to the master boot record (MBR) on the first sector of the device from which the script is run. Your flash drive will not be made bootable if you write to the MBR of another device, and it could make it so that your computer will no longer boot to Windows.

5) After running the batch file, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*NOTE* If you are having problems making your drive bootable from within Windows or if you do not have administrative priveleges, try burning Porteus to a CD or DVD using the instructions above, and then follow the instructions to install Porteus to a USB flash drive from Linux, below.

*NOTE* The first time you boot into Porteus, it will detect that your flashdrive is formatted with a Windows filesystem (e.g. FAT or NTFS), and will prompt you to create a 'save.dat' file container. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.
~~~~~~~~~~~~~~~
| From Linux: |
~~~~~~~~~~~~~~~

Installing Porteus through Linux is similar to installing through Windows. You must have root (super user) priveleges on your system in order to run the installation script.

Before installing, you must extract or mount the .iso file in order to copy the /boot and /porteus directories to your target device. Some archiving programs are capable of extracting the .iso, or you can simply mount it with the following commands:

mkdir /mnt/loop
mount -o loop /path/to/file.iso /mnt/loop

If you are using Porteus for this installation, you can simply enter:

mloop /path/to/file.iso

And you can then navigate to /mnt/loop to access the necessary files. If you are running from a Porteus CD, you can navigate to /mnt/sr0/ and copy the files from there.

Steps to Install:
---------------------

1) Insert your flash drive. If a window automatically pops up when you plug it in, click to open the device. This will mount your flash drive and you can see it's path by opening a console and typing:

mount

If the device is not mounted automatically, then you can open a console and type:

fdisk -l

to get the path of your flash drive (e.g., /dev/sdb1), and then:

mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1

(substitute sdb1 with the name of your device if it was listed differently in fdisk)

Make note of the device's name, as this is the device which will need to be modified by a script later in the process.

2) Copy the files /boot and /porteus from the Porteus .iso file (or from a Porteus CD) to the root directory of your flash drive (meaning the files should not be placed inside any other folders on the drive. For example, they should be located at /mnt/sdb1/boot and /mnt/sdb1/porteus, assuming your flash drive is device sdb1, and is mounted at /mnt/sdb1).

3) Open a console and change directories to the boot folder that you just copied into the flash drive, e.g.

cd /mnt/sdb1/boot

Execute the start_here.sh script:

./start_here.sh

*NOTE* If you are not running as root already, you must use the sudo command and enter your root password before starting this script, or it will not be able to configure your device properly.

This script will bring up a menu.

4) From the menu, select 'Install Porteus to USB device'. Follow the instructions given by the script from here, and be sure to confirm that the correct device is being made bootable. This is important as the script will write to the master boot record (MBR) on the first sector of the device from which the script is run. Your flash drive will not be made bootable if you write to the MBR of another device, and it could make it so that your computer will no longer boot.

5) After running the script, you should be able to boot Porteus from your flash drive. Reboot your computer, and make sure that your BIOS is set to boot from the USB device before it boots to your hard disk. If you are unsure how to change the boot order in your BIOS, please see Appendix A.

*NOTE* The first time you boot into Porteus, it will detect whether or not your flashdrive is formatted with a Windows filesystem (e.g. FAT or NTFS). If it is, you will be promted to create a 'save.dat' file container. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.

*NOTE* if you are using a Porteus CD to install Porteus on a flash drive, you can use the 'Porteus-2-USB' script, located in the application menu, under System Tools. This useful script automates the installation process. It will format your flash drive into two partitions, copy the Porteus files, and make your flash drive bootable.

*****************************************************
* Installations to Internal or External Hard Drives *
*****************************************************

Porteus can be installed to Hard drives, but it should be left in its' compressed state (otherwise known as a 'Frugal' installation). Installing extracted files to a hard drive is not supported; it is suggested that you install Slackware Linux instead if you wish to have an Operating System installed to your system natively.

Creating a 'Frugal' installation is very similar to installing on a USB drive. Porteus can be installed on it's own partition, or it can be installed side by side with Windows or another Linux OS on the same partition.

If Porteus is the only Operating System that you are installing to a device (internal or external), follow the instructions given above for installing to a USB flash drive, making sure you tell the start_here script to write to the Master Boot Record of the desired drive.

For directions on installing Porteus to a device that will also run other operating systems, please visit the documentation section and/or the community forum at the Porteus website, at http://porteus.org. These installations are highly variable depending on whether or not Windows needs to be installed on the device, and on what bootloader is used for the system.

*NOTE* The first time you boot into Porteus, it will detect whether or not your flashdrive is formatted with a Windows filesystem (e.g. FAT or NTFS). If it is, you will be promted to create a 'save.dat' file container. See Appendix B below for more information about this very important feature, which is required for saving your changes to a partition formatted with a Windows filesystem.


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ APPENDIX A: Configuring your boot settings in BIOS $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

In order to boot Porteus from a device other than your computer's hard drive, you must make sure that your BIOS is set to boot to that device before booting to the first hard disk.

To enter the BIOS of your machine, you will need to press a particular key during your computer's startup procedure. The exact key varies from computer to computer, but is typically shown briefly during startup, and it is usually one of the following keys:
F1, F2, F12, Esc, Tab, etc.

Once you press the specified key, you will be shown the BIOS menu. While in BIOS, the legend for using the keyboard is at the bottom of the screen. Inside the BIOS menu, you should look for your 'boot order' option, and set your desired device (CDROM or USB device) to the top of the list. Once you have changed your boot order, press F10 to save your changes and exit. If you are planning to boot to a USB device, make sure it is plugged in when you enter your BIOS, as some systems will only show the USB option when a USB device is present.

Many machines also have another key to press during startup that allows you to choose which device to boot from, without entering the BIOS. While this is very handy, at some stage you will probably want to change the BIOS setting so you don't have to keep pressing this button at every boot. Be aware if your machine contains sensitive data and is used by other people that leaving the setting to 'boot from USB' presents a security risk. Others could also plug in a device and boot to their own OS and access the information on your hard drive.

No Boot from USB in BIOS?
-------------------------

Don't panic just yet, you may still be able to boot from your USB device. Porteus contains a boot loader called Plop. Using this boot loader, you can plug in your USB device as well as a Porteus CD. Boot to the CD and when the Porteus menu comes up, highlight the Plop Boot Manager and press enter to start up Plop. Within Plop, you can select 'USB', and press enter to boot from the USB device.

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Appendix B - Saving changes to a Windows Filesystem $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

Porteus allows users to save their changes (i.e., system settings, downloaded files, bookmarks, browser history, etc) to a folder or image file (aka container) that exists outside of Porteus' core files. The 'changes=' cheatcode parameter sets the location for these changes. When you start Porteus with this cheatcode (enabled by default for USB installations), it will boot up the operating system and then apply your changes from this location. By default, Porteus is set to save these changes to /porteus/changes.

If you are installing Porteus to a device that is formatted with a Windows filesystem (e.g. FAT 32, NTFS, etc), you are required to use a 'save.dat' container for your changes. This container prevents corruption of these files, which is a common occurence when using the posixvol system to store changes directly to a folder on a non-linux filesystem.

Upon starting up, Porteus will run a check, and if your changes are set to be saved to a Windows filesystem, it will prompt you to create a 'save.dat' container. You must enter the size of the container (you will be shown how much free space is left on your device), and it will then be created automatically, and placed on your device, at /porteus/save.dat. Porteus will then boot you into 'Always Fresh' (no saved changes) mode. In order to start saving your changes, you will need to make a simple modification to the file that configures your bootup procedure. Here are the necessary steps:

As root, open the file /boot/porteus.cfg. You will have several entries in this file, which look like this:

LABEL xconf
MENU LABEL Graphics mode (KDE).
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.lz vga=791 splash=silent quiet autoexec=xconf;telinit~4 changes=/porteus/
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT

LABEL lxde
MENU LABEL Graphics mode (LXDE).
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.lz vga=791 splash=silent quiet autoexec=lxde;xconf;telinit~4 changes=/porteus/
TEXT HELP
Run Porteus the same as above.
Lightweight LXDE to be
launched as default desktop
ENDTEXT

You will need to edit the end of the APPEND line, to make it read 'changes=/porteus/save.dat' (without the quotes). Save this file and upon reboot your changes will be saved to this container.


*NOTE* If you need to gain access directly to the files in your save.dat container (if, for example, you boot into 'Always Fresh' mode and need to remove or edit one of your saved files), you can mount the container on a loop, using these commands in a console:

mkdir /mnt/loop
mount -no loop /mnt/live/mnt/sdXN/save.dat /mnt/loop

where sdXN is the name of your device, e.g. sdb1.

You will then have access to these files, in /mnt/loop.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Start_here script for porteus

Post#14 by brokenman » 10 Feb 2011, 20:24

Wow ... looking good. A full path to save.dat file will be required, however i will most probably introduce a tool to mount the changes file. mount-changes
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Start_here script for porteus

Post#15 by Ahau » 10 Feb 2011, 22:21

thanks. edited post to include full path.
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply