Jump to content











Photo

Integrate Linux Portable distros to U-BOOT

usb portable linux

  • Please log in to reply
33 replies to this topic

#1 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 10 February 2021 - 01:06 PM

Preamble

After testing boot from Linux from VHD, I can confirm it works very fine, but the size of the VHD (from 10 to 20 GB) is not something we can  really call portable as my Mini-10x64.vhd of 2.3 GB + 360 MB of external Portables LZX compressed.

Our good fellow wimb has included in his program USB_FORMAT the option to boot some Linux ISOs with persistence, and the required size is only the ISO size + the persistence file size, this also works fine, but if we want to customize it as we prefer, then we need to make a big persistence file as it is not compressed.

After testing Porteus-CINNAMON-v5.0rc2-x86_64.iso with a persistence file, I noticed it lacks some programs as a browser and an office suite.

The Puppy Linux slacko64-7.0.iso , fossapup64-9.5.iso  and  FossaDog-2020-11-15_64-bit-UEFI.iso  have integrated a browser, but also dont have an office suite, FossaDog is the more complete version, it also has an option to install LibreOffice, this 3 work very fine booting from a folder on our USB device.

Previous procedure:

  1. Make a USB device with USB_FORMAT + addon-agFM and selecting Super UEFI
  2. I recommend the FAT-32 partition U-BOOT should be 8 GB min. to have space for all the following + your WinPE.iso(s)

Procedure for Slako64:

  1.  Create a folder on the root of U-BOOT FAT-32 partition named as Slacko64
  2.  Mount the slacko64-7.0.iso on Win10 or using imdisk or open it with 7-zip and copy/extract it into the Slacko64 folder located on the root of the USB device. In fact the very minimum required files are only all the *.sfs, initrd.gz, and vmlinuz

Procedure for Fossapup64:

  1. Create a folder on the root of U-BOOT FAT-32 partition named as Fossapup64
  2. Mount the fossapup64-9.5.iso on Win10 or using imdisk or open it with 7-zip and copy/extract it into the Fossapup64 folder located on the root of the USB device. In fact the very minimum required files are only all the *.sfs, initrd.gz, and vmlinuz

Procedure for FossaDog:

  1. Mount FossaDog-2020-11-15_64-bit-UEFI.iso on Win10 or using imdisk or open it with 7-zip and copy/extract only the casper folder to the root of the USB U-BOOT FAT-32 partition on your device.

But booting any of the previous 3 Puppy Linux flavors on PCs with Nvidia or AMD graphic cards connected to the screen by HDMI it is very hard if not impossible to make the sound work.

The same approach used by the 2 first Puppy Linux, (by the way very common to boot Linux ISOs by means of grub4dos + a cheat code if required), do not work for FossaDog and it required several test to make it work, extracting only the casper folder.

Then I decided to go a little further and find the way to make Porteus work from a folder on the USB device, (there is no info about this on its page or its forum). and after several intents, I discovered the way to do it, and finally it is working very fine in all cases.

NOTE: Porteus v5RC2 DO NOT have any sound file integrate into it to test the selected sound device, so to test the sound go to Youtube, (I was thinking the sound didn't work until checked this way).

Procedure for Porteus:

  1. Mount the Porteus-CINNAMON-v5.0rc2-x86_64.iso on Win10 or using imdisk or open it with 7-zip and copy/extract only the porteus folder to the root of the USB device, never delete the porteus-v5.0-x86_64.cfg file or it will not boot.
  2. Open the porteus folder located on the root of the USB device and copy/extract into it, the boot folder from the ISO. In fact the very minimum required is only boot\syslinux\initrd.xz and boot\syslinux\vmlinuz

My prefered option is Porteus v5RC2 as from it we can create *.xzm modules highly compressed of our current sesion just when we set all to our preferences, it let us select our prefered browser, download and make a module of LibreOffice, also we can download several Bundled premade *.xzm, and we are able to load all or our preferd modules on Ram and work totally as RAMOS or select other modules after booting that will be loaded only when needed.

As an example I put into modules folder firefox-85.0.2-x86_64-es-MX.xzm and my sesion *.xzm and they are loaded every boot and I have LibreOffice-7.1.0-x86_64-es-1bl.xzm into optional folder, in fact I don't use the porteus/changes/save.dat file. And the porteus folder size is only 644 MB, this really beats by far my Mini-10x64.vhd of 2.3 GB

Attached Menus.zip file with the menus (config files) required, if using a just formated USB device without any additional files added, just copy them to the respective locations.

NOTE: If you are adding this menus (config files) to a previously made/formated USB device which already contain some user added files, only copy menu_distro.lst and grub_distro.cfg to the respective locations.

And edit menu.lst adding following entry:
 

iftitle [if exist (hd0,0)/menu_distro.lst] Portable Distro Menu - (hd0,0)/menu_distro.lst
configfile /menu_distro.lst

Also edit grub.cfg adding following entry:
 

if [ -e "/grub/grub_distro.cfg" ]; then
menuentry "Portable Distro Menu - /grub/grub_distro.cfg" {
  configfile /grub/grub_distro.cfg
}
fi

Just remember both files have to be UTF-8 without BOM, I use notepad++

Hope this can be of some use for some of you.
 

EDIT-1: See post No.32 for new info and improved menus

 

Edit-2: See Post No. 34 for New Porteus approach, and updated menus.

 

alacran

Attached Files


  • wimb likes this

#2 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 10 February 2021 - 01:44 PM

To download LibreOffice on Porteus just run following commands and you will get then lang options available, to add your desired lang, just tipe again update-libreoffice on a new line and add at the end your prefered lang.

 

 

Note. For updating LibreOffice open terminal and run:
su
toor
update-libreoffice

 

As an example I typed update-libreoffice es, and the base packake in English + the Spanish lang pack and Spanish help pack were downloaded, and latter compressed in a single *.xzm module.

 

During download it asks you if you want to create a *.xzm module, better do it to save a lot of espace, the download when extracted to be used/installed on Linux is more than 500 MB, but once re-compressed as a *.xzm module it is 213 MB.

 

Just to compare my portable LibreOffice for Windows LZX compressed is 248 MB, so the xzm compression is better/higher than LZX compression.

 

alacran



#3 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 10 February 2021 - 04:01 PM

Just to compare, my proposed Porteus booting from a folder uses only 644 MB (including my saved sesion xzm file + firefox-85.0.2-x86_64-es-MX.xzm + LibreOffice-7.1.0-x86_64-es-1bl.xzm).

 

And the total size required for booting with persistence from Porteus-CINNAMON-v5.0rc2-x86_64.iso (346 MB) + a limited data.img (476 MB) = 822 MB

 

822 - 644 = 178 MB or 21.65 % less used espace.

 

And once it is loaded on Ram it is very fast, even if it was loaded from a USB 2.0 device, or on older machines with only USB 2.0 ports, as there is no need to read/write any additional info from/to the data.img file, and the tmp file is not limited to the available free size on the persistence file, it is the free remaining Ram.

 

As an example I wasn't able to download firefox-85.0.2-x86_64-es-MX and create the *. xzm file when I was testing the ISO + data.img (476 MB) persistence, it aborted for lack of tmp espace available.

 

For testing this approach I used a very old Kingston USB 2.0 device that was not in use since long time ago,

 

alacran


  • antonino61 likes this

#4 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 10 February 2021 - 04:52 PM

is it possible to automate such procedures the wimb way?



#5 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 10 February 2021 - 08:31 PM

It is just mount and copy-paste, or extract to a folder with 7-zip, and I think that is something very easy to do manually.

 

alacran


  • antonino61 likes this

#6 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 07:47 AM

so if it is so easy, I'll try it too. is it only for office and firefox, or can u do the same with other linux apps?



#7 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 08:35 AM

From first post:

 

 

My prefered option is Porteus v5RC2 as from it we can create *.xzm modules highly compressed of our current sesion just when we set all to our preferences, it let us select our prefered browser, download and make a module of LibreOffice, also we can download several Bundled premade *.xzm, and we are able to load all or our preferd modules on Ram and work totally as RAMOS or select other modules after booting that will be loaded only when needed.

 

alacran



#8 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 10:57 AM

can I do it all on bios instead of UEFI? I will be bound by Alacrán's porteus procedures, because, when it comes to saving space, Alacrán is second to none. BTW, before I forget, 1 more question, how does ur menu.lst integrate with the menu.lst I already have (the windows options listed, I mean). 



#9 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 12:43 PM

could not get it to boot. Shall I format the usb with wimb's usb_format? or by myself as fat32? what shall the usb actually contain, because all I am able to get to is a series of hosts of options each menu, but no dice thru any of them.



#10 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 01:09 PM

The attachment on first post has the menus for booting from a USB device on MBR/CSM with grub4dos and also for booting on UEFI with A1ive's Grub 2.

 

And this are the entries you can add directly on your MBR menu.lst if you want to try only Porteus, valid for booting from any internal or external device as long as your ceated porteus folder is located on the root of a partition/drive

 

title Porteus v5RC2 Generic fully on Ram - /porteus
find --set-root /porteus/boot/syslinux/vmlinuz
kernel /porteus/boot/syslinux/vmlinuz noauto copy2ram kmap=es
initrd /porteus/boot/syslinux/initrd.xz

title Porteus v5RC2 for Asus PC fully on Ram - /porteus
find --set-root /porteus/boot/syslinux/vmlinuz
kernel /porteus/boot/syslinux/vmlinuz noauto copy2ram load=Asus;LibreOffice kmap=es
initrd /porteus/boot/syslinux/initrd.xz

title Porteus v5RC2 with persistence - /porteus/changes/save.dat
find --set-root /
kernel /porteus/boot/syslinux/vmlinuz noauto changes=/porteus/changes/save.dat kmap=es  
initrd /porteus/boot/syslinux/initrd.xz

 

By the way I'm testing right now a new approach, putting the sesion *.xzm file on optional folder.

 

The first entry will still be valid for the way suggested on first post, good to start your tests, but with this new approach putting the sesion *.xzm file on optional folder it will be fully portable, as then will not load the sesion file, the second option will load also the sesion file renamed as Asus.xzm (to identify it) and also LibreOffice, both from optional folder, this entry was made to boot with all my settings on this PC with a MBR Asus, and I will make also a Gigabyte.xzm and it's respective entry to load it during boot, for my room PC which has a very different MB, wireless USB card, Nvidia GC and it's connected to the TV by HDMI.

 

alacran


  • antonino61 likes this

#11 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 01:40 PM

thanx Alacrán, now 1 more thing, for those like me who want to try porteus only, do we need anything else on the usb stick other than the porteus stuff mentioned above?



#12 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 02:42 PM

If you formated your USB using USB_FORMAT by wimb, and you followed the instuctions on first post, that's all.

 

If it is a USB stick formated using windows, not using USB_FORMAT by wimb, you need to install grub4dos on the MBR, use BootIce for this, copy grldr to the root of the first partition of the USB and add your menu.lst, or you can also use RMPrepUSB by steve6375 to format the USB and install grub4dos on the MBR, it will also offer to copy grldr to the root, you can find links to both tools on my signature.

 

alacran


  • antonino61 likes this

#13 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 02:48 PM

thanx a lot, alacrán, I'll try it out asap



#14 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 03:21 PM

<p>one hell of a good linux system it must be!!!! so quick!!! I did get hold of customization (taskbar position, font zoom, etc.)... but I am not sure I could retain it.</p>
<p>What shall I do to get the 3rd menu list option to work? It wants some file or other, I think. I do I get the *.dat file that will presumably allow me to get persistence? the modules mechanism, I think I have gotten a grasp of already. I am writing from firefox right now. As u were saying, now that I have visited youtube, my audio has started working. I do not know if I have to visit youtube everytime I want to get some sound, though. btw, I tried moving firefox from modules to optional and here I am. I did succeed, so I presume it holds good for all modules as we download them. From what I have gathered, all &quot;installations&quot; must be &quot;copied&quot; to modules or for that matter optional on a manual basis. so we will not install, we will simply add. but it is good just the same. Unfortunately, as I often do not know where things are here in linux, I find it hard to get my usual things together. but considering the space it takes, it is worth our while considering it an alternative, as this porteus thing is a meager elegant spartan.</p>

#15 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 04:21 PM

sorry, too optimistic, it has to stay in modules for it to be start-menu-visible and work. the previous time, since it was on both and I erased it from modules it still had it in memory and did work, but not a second time. the optional one, I do not think it works autonomously.

so, test failed so far, unless I am missing out on something.

btw, can we make it boot and work from vhd?

and the libreoffice xzm that I downloaded from porteus does install but does not work.



#16 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 04:53 PM

Since the begining (on Windows), it is good to assign names to each drive/partition of all your internal and external devices, as this will make easier to locate them.

 

My suggested menus has the option noauto, to not automount any drive/partition to avoid potential corruption of them, I have noticed in almost all Linux versions I have tested, the drives/partitions are not well auto un-mounted when you reboot or switch off a Linux OS, so it's better to mount them manually to do certain task, and just after you finish, unmount it inmediately, if you forget to do it, next time you boot from Windows it will run a drive check/repair procedure.

 

In order to let you create a module of the current sesion the device/partition where you have your porteus folder, has to be mounted, you can mount it from the panel selecting an icon that looks as a folder and from it open the mentioned partition.

 

Same apply to create save.dat file, from the runing Porteus open the menu  >>> administration >>> Porteus save file manager, and on the just opened window select create and follow the instructions.

 

Once you have all set to your prefersces, close all active programs and windows and make your save.dat file, but as I said before, it's better to create a sesion module and if it is located on modules folder it will be loaded to ram allways, if it is located on optional folder you are able to load it using the second option on menu.lst, a module loaded on Ram will work always faster than a save.dat file that by desing is not loaded on Ram, it also limits your tmp folder space available to the size of free space on the save.dat file, I could say the save.dat option may be useful for very low memory equipments.

 

I only included the third option on the menu.lst because some users may prefer this option, but working fully on Ram with your sesion module is always better.

 

alacran



#17 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 05:17 PM

sorry, too optimistic, it has to stay in modules for it to be start-menu-visible and work. the previous time, since it was on both and I erased it from modules it still had it in memory and did work, but not a second time. the optional one, I do not think it works autonomously.

so, test failed so far, unless I am missing out on something.

btw, can we make it boot and work from vhd?

and the libreoffice xzm that I downloaded from porteus does install but does not work.

 

If your sesion module is on modules folder it will be loaded on Ram automatically always, if it is moved to optional you need to edit the second option on menu.lst on this part:

 

load=YOUR_MODULE_NAME;LibreOffice kmap=YOUR_KEYBOARD_LANG  >>> you could omit kmap= section, as your saved sesion module will retain the setting you made on first boot.

 

YOUR_MODULE_NAME = if not renamed just write here Changes.

 

For LibreOffice download, follow the instructions on post No. 2, and make sure to copy it from tmp folder (on Ram) to modules (on physical drive) to load automatically on Ram, or to optional folder to load it only if it is include on the load=  section.

 

alacran



#18 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 05:28 PM

I'm sure all the options/entries mentioned on post No. 10 work fine, as I have tested them, just follow the instuctions.

 

In fact I'm writing this booting with second options/entry

 

Also LibreOffice works fine, only the drawing program fails, but that's not a big deal.

 

alacran


  • antonino61 likes this

#19 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 05:55 PM

even though ur (rightly) getting so damn technical, I will try to keep up with u to the best of my knowledge and ability, to this end, would u pls tell me the most assorted source of xzm? u know, I mostly love the little space ur preferred software takes. anyway, it would be much better if the module loading procedure at the beginning could be speeded up.

btw, since xzm's are so small, I was thinking out loud, could they be managed in windows? I mean, as u damn well know me by now, could grldr read xzm (compressed vhd's)?



#20 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 08:01 PM

I created LibreOffice folder on my free Mega account: https://mega.nz/fold...10e6MaXcUgx6J_A

 

There you can find:

 

LibreOffice-7.1.0-x86_64-it-1bl.xzm (en_US + italian)

 

LibreOffice-7.1.0-x86_64-es-1bl.xzm (en-US + Spanish)

 

About booting Porteus from a VHD: it do not work.

 

About booting with grub4dos a Windows installed on a VHD and latter applying xz compression to the VHD: it do not work.

 

EDIT: To make it more clear in Porteus slang *.xzm is a file container with xz compression + letter m  for module.

 

alacran


  • antonino61 likes this

#21 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 08:16 PM

my dear alacrán,

for a start, very many thanx (as the Chinese would say in English) for the files whose links to u have posted, also for your attention to the Italian language, I will try it out asap and let u know.

taking a forward dimension, do u think evolution will move towards saving space or shortening time, or both?



#22 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 08:30 PM

just booted off porteus, clicked on libreoffice, saw that it is working like a charm and now I am posting here, still thinking this xzm perspective should be implemented in windows as well if it could be implemented, of course, at least to save space. we have to think in terms of packages, we have to strive to promote the xzm philosophy, the package philosophy, well, call it whatever, u know what I mean. as wonko said once, the smaller the better.

#23 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 08:38 PM

MBR grub4dos or UEFI grub4dos can't read/use xz compression, (it is same thing, Porteus just added the final m and made it *.xzm to mean it is a Porteus module), but A1ive's grub2 can read/use it, but there is no gain in loading to Ram time compared with grub4dos + lz4 compression

 

Take a look to this post where I tested this on UEFI environmet using as filemanager A1ive's grub2 and a VHD xz compressed.

 

See: http://reboot.pro/in...429#entry217525

 

alacran



#24 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1525 posts
  •  
    Italy

Posted 11 February 2021 - 08:58 PM

Yes, about lz4, u r right, what u have shown is correct; what I meant was necessary is some way to have all portables in windows as xz and call them when we demand from compressed state to automatically execute the way porteus does with firefox and libreoffice. that would save so much space in the windows portable folder. any news from the chinese experiment?



#25 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 11 February 2021 - 09:05 PM

That also do not work, as Windows do not have native access to xz compressed files.

 

But JFYI all my portables are LZX compressed and Windos can read them very fine.

 

alacran







Also tagged with one or more of these keywords: usb, portable, linux

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users