[INFO] Memory Module Management (ISO boot & copy2ram)

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] Memory Module Management (ISO boot & copy2ram)

Post#1 by Bogomips » 26 Nov 2016, 00:12

Memory Module Management Focusing on Loading Porteus from ISO File & Selection of Modules to be Run in RAM.

Loading from ISO file requires Boot Parameter (cheatcode) Keyword: from, and Keyword Value: [Device]/Path/to/<ISO file>.iso, and Device is one of:
  • /dev/sdXy
  • UUID:<Substring of UUID>
  • LABEL:<Substring of LABEL>
Loading from stock Porteus ISO, there where the Sign File is found, means no potential for modules from Modules and Optional folders.

Modules will only be Loaded from Porteus Base Directory and any Directories specified by Boot Parameter (cheatcode) Keyword: extramod, with Keyword Value: [Device]/Path/to/Directory with Modules (File Extension .xzm}[;[Device]/Path/to/Directory with Modules] ..

Module Processing Sequence
  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
Filters come as Boot Parameter (cheatcodes) Keywords: noload and rammod with Keyword Value: <String of non-blank characters>[;<String of non-blank characters>] ... If any of these specified strings matches a Substring of the Absolute Path of a module under cosideration ([/mnt/sdXy/]/Path/to/<Module File>.xzm), then that module is selected
  • to be filtered out in the case of noload
  • or to be placed in RAM in the case of rammod
Filesystem clutter can be reduced by the use of Symbolic Links in the Extramod directories, as the following example demonstrates. It appears there is also a restriction on the length of the Kernel Command Line, which gets truncated after 260 characters.

Examples
  1. Kernel Command Line:

    Code: Select all

    guest@porteus:~$ cat /proc/cmdline
    quiet from=/dev/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso copy2ram ramsize=30% noauto rootcopy=/dev/sda4/kd64rcp noload=e/000 extramod=/dev/sda5/xmx64;/dev/sda10/xzm64_8 rammod=base;8/0 cliexec=mount~--bind~/home/guest/p9/tmp~/tmp 3
    
    • Relevant Parameters:

      Code: Select all

      from=/dev/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso copy2ram noload=e/000 extramod=/dev/sda5/xmx64;/dev/sda10/xzm64_8 rammod=base;8/0
    • Extramod
      • xmx64

        Code: Select all

        guest@porteus:~$ ls -l /mnt/sda5/xmx64/
        total 0
        lrwxrwxrwx 1 guest users 49 Nov 16 23:35 05-devel.xzm -> /mnt/sda10/tmp/iso/v3.2/4.8.8/x86_64/05-devel.xzm
        lrwxrwxrwx 1 guest users 57 Nov 16 23:35 crippled_sources.xzm -> /mnt/sda10/tmp/iso/v3.2/4.8.8/x86_64/crippled_sources.xzm
        
      • xzm64_8

        Code: Select all

        guest@porteus:~$ ls -lh /mnt/sda10/xzm64_8/
        total 78M
        -rw-r--r-- 2 guest users  45M Nov 16 13:57 000-kernel.xzm
        -rw-r--r-- 3 guest users 5.3M Nov  8 14:50 flashplayer-plugin-23.0.0.205-x86_64-1.xzm
        -rw-r--r-- 3 root  root  3.5M Mar 28  2016 geany-1.25-x86_64-1_slack.xzm
        -rw-r--r-- 3 root  root  132K Mar 27  2016 gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        -rw-r--r-- 3 root  root   25M Aug  8 20:18 lt_080816-x86_64.xzm
        -rw-r--r-- 3 root  root  396K Jun 19 15:25 terminator-0.97-x86_64-1sl.xzm
        
    • Filters
      • noload
        Specified String e/000 is a substring of base/000-kernel.xzm
      • rammod
        Specified String
        • base Collects any remaining Base modules
        • 8/0 Substring of xzm64_8/000-kernel.xzm
    • Final Module Disposition
      • Code: Select all

        guest@porteus:~$ grep -A20 copy /var/log/porteus-livedbg
        # Non standard /rootcopy dir:
        /dev/sda4/kd64rcp
        
        # Modules activated during boot time:
        /memory/copy2ram/001-core.xzm
        /memory/copy2ram/002-xorg.xzm
        /memory/copy2ram/003-kde5.xzm
        /mnt/sda5/xmx64/05-devel.xzm
        /mnt/sda5/xmx64/crippled_sources.xzm
        /memory/copy2ram/000-kernel.xzm
        /mnt/sda10/xzm64_8/flashplayer-plugin-23.0.0.205-x86_64-1.xzm
        /mnt/sda10/xzm64_8/geany-1.25-x86_64-1_slack.xzm
        /mnt/sda10/xzm64_8/gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        /mnt/sda10/xzm64_8/lt_080816-x86_64.xzm
        /mnt/sda10/xzm64_8/terminator-0.97-x86_64-1sl.xzm
        
        ISO=/mnt/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso
        
      • Omitted: 000-kernel.xzm (from ISO file)
      • Placed in RAM:

        Code: Select all

        /memory/copy2ram/001-core.xzm
        /memory/copy2ram/002-xorg.xzm
        /memory/copy2ram/003-kde5.xzm
        /memory/copy2ram/000-kernel.xzm
        
        with 000-kernel.xzm coming from extramod xzm64_8
      • Looping on Devices:

        Code: Select all

        /mnt/sda5/xmx64/05-devel.xzm
        /mnt/sda5/xmx64/crippled_sources.xzm
        /mnt/sda10/xzm64_8/flashplayer-plugin-23.0.0.205-x86_64-1.xzm
        /mnt/sda10/xzm64_8/geany-1.25-x86_64-1_slack.xzm
        /mnt/sda10/xzm64_8/gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        /mnt/sda10/xzm64_8/lt_080816-x86_64.xzm
        /mnt/sda10/xzm64_8/terminator-0.97-x86_64-1sl.xzm
        
  2. Kernel Command Line:

    Code: Select all

    quiet from=/dev/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso copy2ram ramsize=30% noauto rootcopy=/dev/sda4/kd64rcp noload=e/000 extramod=/dev/sda10/kd64xzm_0 rammod=base;0/0;0/n cliexec=mount~--bind~/home/guest/p9/tmp~/tmp guiexec=Prolog/pmx.sh
    
    • Relevant Parameters:

      Code: Select all

      from=/dev/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso copy2ram  noload=e/000 extramod=/dev/sda10/kd64xzm_0 rammod=base;0/0;0/n
    • Extramod
      • kd64xzm_0

        Code: Select all

        guest@porteus:~$ ls /mnt/sda10/kd64xzm_0/
        000-kernel.xzm                              lt_080816-x86_64.xzm
        flashplayer-plugin-23.0.0.205-x86_64-1.xzm  nvlesslib.xzm
        geany-1.25-x86_64-1_slack.xzm               terminator-0.97-x86_64-1sl.xzm
        gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        
    • Filters
      • noload
        Specified String e/000 is a substring of base/000-kernel.xzm
      • rammod
        Specified String
        • base Collects any remaining Base modules
        • 0/0 Substring of kd64xzm_0/000-kernel.xzm
        • 0/n Substring of kd64xzm_0/nvlesslib.xzm
    • Final Module Disposition
      • Code: Select all

        guest@porteus:~$ uname -r
        4.8.8-porteus
        guest@porteus:~$ tail -n20 /var/log/porteus-livedbg
        
        # Changes are stored in:
        memory
        
        # Non standard /rootcopy dir:
        /dev/sda4/kd64rcp
        
        # Modules activated during boot time:
        /memory/copy2ram/001-core.xzm
        /memory/copy2ram/002-xorg.xzm
        /memory/copy2ram/003-kde5.xzm
        /memory/copy2ram/000-kernel.xzm
        /mnt/sda10/kd64xzm_0/flashplayer-plugin-23.0.0.205-x86_64-1.xzm
        /mnt/sda10/kd64xzm_0/geany-1.25-x86_64-1_slack.xzm
        /mnt/sda10/kd64xzm_0/gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        /mnt/sda10/kd64xzm_0/lt_080816-x86_64.xzm
        /memory/copy2ram/nvlesslib.xzm
        /mnt/sda10/kd64xzm_0/terminator-0.97-x86_64-1sl.xzm
        
        ISO=/mnt/sda10/tmp/iso/v3.2/4.8.7/x86_64/Porteus-KDE-v3.2-x86_64.iso
        
      • Omitted: 000-kernel.xzm (from ISO file)
      • Placed in RAM:

        Code: Select all

        /memory/copy2ram/001-core.xzm
        /memory/copy2ram/002-xorg.xzm
        /memory/copy2ram/003-kde5.xzm
        /memory/copy2ram/000-kernel.xzm
        /memory/copy2ram/nvlesslib.xzm
        
        with 000-kernel.xzm coming from extramod kd64xzm_0
      • Looping on Devices:

        Code: Select all

        /mnt/sda10/kd64xzm_0/flashplayer-plugin-23.0.0.205-x86_64-1.xzm
        /mnt/sda10/kd64xzm_0/geany-1.25-x86_64-1_slack.xzm
        /mnt/sda10/kd64xzm_0/gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
        /mnt/sda10/kd64xzm_0/lt_080816-x86_64.xzm
        /mnt/sda10/kd64xzm_0/terminator-0.97-x86_64-1sl.xzm
        
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