[INFO] Booting Porteus (Data), Rootcopy, Extramod Directly.

Post tutorials, HOWTO's and other useful resources here.
Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

[INFO] Booting Porteus (Data), Rootcopy, Extramod Directly.

Post#1 by Bogomips » 19 Feb 2016, 23:36

Quick Reference on Device Specific booting of Porteus (Data) and/or Rootcopy and Extramod

Information not very easy to come by, which I thought best to jot down and share with any interested parties. Looked in detail into just two types of media: Disk and USB Memory Stick / Flash Drive.
  • Multiple Versions of same Porteus release can be booted irregardless of having same sign file, provided a unique path is specified for the Kernel Parameter (cheatcode):
    from=/dev/sdXy[/<Path to Porteus Data>], where /dev/sdXy will be unambiguous at boot time. (Not the case for 2 usb sticks being plugged in, if /dev/sdc2 is specified, for example. In this case search will be launched if unintended usb picked up, does not have sign file in path.) Additionally:
    /dev/sdXy[/<Path to Porteus Data>]/porteus/<sign file name>.sgn must exist for purpose of verification.
    • /dev/sdXY
      Example:

      Code: Select all

      root@darkstar:~# cat /proc/cmdline
      base_only noauto from=/dev/sdb1
      
      # Extract from '/var/log/porteus-livedbg':
      =========================================
      
      # Recognized devices:
      ...
      /dev/sdb1: SEC_TYPE="msdos" UUID="12D4-A2F1" TYPE="vfat"
      /dev/sdb2: UUID="ec468a0e-7848-416d-9d29-3c74a1bfb486" TYPE="ext4"
      
      # Booting device:
      /mnt/sdb1
      
      # Porteus data found in:
      /mnt/sdb1/porteus
      
      # Changes are stored in:
      memory
      
      # Non standard /rootcopy dir:
      none
      
      # Modules activated during boot time:
      /mnt/sdb1/porteus/base/000-kernel.xzm
      /mnt/sdb1/porteus/base/001-core.xzm

      Code: Select all

      root@porteus:/home/guest# tree  -L 2 /mnt/sdb1
      /mnt/sdb1
      |-- EFI
      |   `-- BOOT
      |-- boot
      |   |-- Porteus-installer-for-Linux.com
      |   |-- Porteus-installer-for-Windows.exe
      |   |-- docs
      |   `-- syslinux
      `-- porteus
          |-- base
          |-- modules
          |-- optional
          |-- porteus-v3.1-x86_64.sgn
          `-- rootcopy
      10 directories, 3 files
      
    • Unique Specification:
      • UUID::<uuid string segment>
      • LABEL:<label string>
      In this case, even if there is say just the one usb stick, there could be a problem of identification. If a connection problem should arise and the stick have to be plugged in agian, it may no longer be known as /dev/sdb but rather as /dev/sdc.
      Example(Two usb sticks):

      Code: Select all

      guest@porteus:~$ cat /proc/cmdline 
      quiet initrd=initrd.xz from=LABEL:c81c/iso/porteus-XFCE-v3.1-i586.iso copy2ram ramsize=30% noauto BOOT_IMAGE=vmlinuz
      
      # Extract from '/var/log/porteus-livedbg':
      =========================================
      
      # Recognized devices:
      ...
      /dev/sdb1: SEC_TYPE="msdos" UUID="12D4-A2F1" TYPE="vfat" 
      /dev/sdb2: UUID="2F2F3C037EAEA623" TYPE="ntfs" 
      /dev/sdc1: UUID="ab55fc94-4882-417b-b173-7f159944fa9b" TYPE="ext2" 
      /dev/sdc2: UUID="30e88aba-c81c-49ea-9e9b-d23edd56b578" TYPE="ext4" 
      
      # Booting device:
      /mnt/sdc2
      
      # Porteus data found in:
      /mnt/isoloop/porteus
      
      # Changes are stored in:
      memory
      
      # Non standard /rootcopy dir:
      none
      
      # Modules activated during boot time:
      /memory/copy2ram/000-kernel.xzm
      /memory/copy2ram/001-core.xzm
      /memory/copy2ram/002-xorg.xzm
      /memory/copy2ram/003-xfce4.xzm
      
      Here the Booting device (device on which sgnfile was found) is not /dev/sdb2 but /dev/sdc2. One way around this is to have a symbolic b2 directory, which is invariant once it has been correctly mounted, which can be done as early as rc.local:

      Code: Select all

      RC.LOCAL
      ========
      read c < /proc/cmdline; f=${c#*from=};
      if  [[ ! $f =~ ^/(dev|mnt)/ ]];	then	# Undefined sgnfile Device. NOT 'from=/dev/sdXy'
      	mkdir  /b2
      	u=$(grep -A1 "Booting" /var/log/porteus-livedbg | tail -n1);  # Porteus data: /mnt/sdXy
      	mount ${u/mnt/dev} /b2;  	# /dev/sdXy
      fi
      
  • The same holds for different iso files of the same porteus release:
    from=/dev/sdXy[/<Path to a Porteus Iso File>]/<Name of the Porteus Iso File>.iso, where /dev/sdXy will be unambiguous at boot time. Example:
    • Code: Select all

      root@darkstar:~# cat /proc/cmdline
      copy2ram ramsize=30% noauto from=/dev/sdb2/bld/ab/abSlak_100216.iso
      
      # Extract from '/var/log/porteus-livedbg':
      =========================================
      
      # Recognized devices:
      ...
      /dev/sdb2: UUID="ec468a0e-7848-416d-9d29-3c74a1bfb486" TYPE="ext4"
      /dev/sdb1: SEC_TYPE="msdos" UUID="12D4-A2F1" TYPE="vfat"
      
      # Booting device:
      /mnt/sdb2
      
      # Porteus data found in:
      /mnt/isoloop/porteus
      
      # Changes are stored in:
      memory
      
      # Non standard /rootcopy dir:
      none
      
      # Modules activated during boot time:
      /memory/copy2ram/000-kernel.xzm
      /memory/copy2ram/001-core.xzm
      
  • Specifying Rootcopy Directory Directly:
    rootcopy=/dev/sdXy[/<Path to Rootcopy Directory>]/<Name of Directory to be used for Rootcopy>, where /dev/sdXy will be unambiguous at boot time. This option comes in handy if booting from Iso. Example:

    Code: Select all

    guest@porteus:~$ cat /proc/cmdline 
    quiet copy2ram ramsize=30% noauto  rootcopy=/dev/sdb1/rcpy timezone=Europe/London volume=30% BOOT_IMAGE=vmlinuz
    
    # and '/var/log/porteus-livedbg' has:
    
    # Non standard /rootcopy dir:
    /dev/sdb1/rcpy
    
Memory Module Management
  1. Base & Modules xzm Files filtered thru NOLOAD
  2. Optional xzm Files selected thru LOAD
  3. Extramod xzm files filtered thru NOLOAD
  4. copy2ram: selective copy to ram determined by RAMMOD
Last edited by Bogomips on 25 Oct 2016, 18:27, edited 11 times in total.
Reason: Memory Module Management
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB