Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => General dCore Talk => Topic started by: Jason W on March 29, 2018, 12:02:35 PM

Title: dCore-usbinstall
Post by: Jason W on March 29, 2018, 12:02:35 PM
dCore-usbinstall, the automated way to install a dCore release on a usb stick using extlinux, has been updated to be compatible with both 32 and 64 bit dCore ports.  The package in the 32 bit dCore area has also had the same changes, but does not affect it's functionality. 
Title: Re: dCore-usbinstall
Post by: Jason W on March 29, 2018, 12:41:14 PM
Also now added the ability to choose between both x86 and x86_64 dCore releases available to install to usb regardless of the architecture of the port one is running in the current session.  x86 package also updated.
Title: Re: dCore-usbinstall
Post by: Jason W on March 30, 2018, 06:35:53 PM
Added the option to choose from dCore and dCorePlus in each dCore port. 

Below is a way to install to usb dCore from any modern Linux distribution. 

First, download a dCore, below is via a terminal, preferably dCorePlus if any wireless is needed.  Example commands below. 

Code: [Select]
wget http://tinycorelinux.net/dCore/x86/release/dCore-stretch/dCorePlus-stretch.iso
wget http://tinycorelinux.net/dCore/x86/release/dCore-stretch/dCorePlus-stretch.iso.md5.txt

md5sum -c dCorePlus-stretch.iso.md5.txt

Plug in the desired USB device, and use one of the below commands to determine which device is a USB, making sure to choose the right one:

This lists usb devices by name:
Code: [Select]
for I in `ls /dev/disk/by-id/ | grep usb`; do E=`readlink /dev/disk/by-id/"$I" | sed "s/[./]//g" | sed 's/[0-9]*//g'` ; echo "$E"; done

or the simpler command, note the usb- prefix and symlinks:

Code: [Select]
ls -lh /dev/disk/by-id/

Then create a bootable usb from the ISO image.  dCore ISO images have had isohybrid used on them so they can be written to a USB device via the dd command.  Just be sure of your device name.  If sdb is your USB device, then use the following:

Code: [Select]
dd if=dCorePlus-stretch.iso of=/dev/sdb bs=1M

Then reboot with the USB device.

Once booted, do the following in a terminal:

Code: [Select]
sce-import dCore-usbinstall
sce-load dCore-usbinstall

Then run "sudo dCore-usbinstall" in a terminal.   dCore-usbinstall will let you choose from a list of USB devices to install to, just install to the same one as booted from as it will not be mounted after booting.  Choose a dCorePlus port if it was needed before.  Then reboot.

You will now have a USB key with dCore installed with a TCE directory on that USB device.  Then start importing packages. 

A note:  Use "RAM=TRUE" in /etc/sysconfig/sceconfig and make a backup or use the "sce-import -r" option so the package importing work with it's many file writes happends in RAM to prolong the life of the USB drive. 
Title: Re: dCore-usbinstall
Post by: jls on March 31, 2018, 11:06:27 AM
Hi Jason
How come that on first reboot the dCore-plus is not mounted?
Title: Re: dCore-usbinstall
Post by: Jason W on March 31, 2018, 12:23:22 PM
It is that way be design, with the TCE directory in /tmp so you can use that same usb for the dCore-usbinstall installation.  Otherwise you would have to use a second usb drive for installing to.  The dCorePlus-stretch.sce extension that is the difference between the regualar dCore and dCorePLus is located in /tmp/builtin.

Using dd to 'burn' an iso to a usb drive creates an iso9660 filesystem of the entire device which is read only and you can't create a TCE directory on it or write any new files or directories to it.  So the booting of the iso9660 filesystem and leaving it unmounted makes sense.   
Title: Re: dCore-usbinstall
Post by: jls on April 02, 2018, 08:30:22 AM
downloaded and mounted dCorePlus-stretch.iso I see that there is no sce inside, everything is in the initrd, so I understand why if I burn it on a usb and then boot, the usb can be unmounted
Title: Re: dCore-usbinstall
Post by: Jason W on April 12, 2018, 04:29:33 PM
dCore-usbinstall has been updated to include "waitusb=8" in the boot command line of the resulting usb install so it works for everyone and recognizes the TCE directory on the usb and loads the extensions as expected with no intervention.   Updated for both x86 and x86_64.   
Title: Re: dCore-usbinstall
Post by: Jason W on April 13, 2018, 02:15:24 PM
dCore-usbinstall has been updated to include prompting the user to specify the max wait time of waitusb in seconds and that will be used with the label of the partition. 

If you choose xenial as your usb partition label, and 10 as your maximum timeout, the boot command line will include it like the following:


The max number of seconds is only that, the boot continues without delay once the usb device by that label name has been found by the system, usually a couple of seconds or so. 
Title: Re: dCore-usbinstall
Post by: Rich on April 13, 2018, 05:26:06 PM
Hi Jason W
I don't see the point in giving the user a prompt for the amount of wait time. Someone not knowing any better might choose
too low a time and cause themselves problems. As you yourself point out, by using the following format:
Code: [Select]
waitusb=10:LABEL=xenialthe boot process continues the moment the USB device is ready. So why not just default to a worst case number that covers
even the slowest hardware. There's no penalty for using a generous value like 20 or 30 seconds.
Title: Re: dCore-usbinstall
Post by: Jason W on April 13, 2018, 05:54:09 PM
Rich, you are right.   Why not 30 seconds.  No performance penalty while being sure to cover all hardware scenarios.

Default max wait time is set to 30 seconds with no prompt for it, no boot speed lost but potential errors in choosing that value are avoided. 

dCore-usbinstall is reposted with above change, x86 and x86_64.
Title: Re: dCore-usbinstall
Post by: Jason W on April 15, 2018, 06:40:11 PM
dCore-usbinstall has been updated to include the option to use release candidates as well as releases.  Also, if there is no valid usb device available, the utility exits at the beginning rather than after the needed downloads have taken place.

Title: Re: dCore-usbinstall
Post by: Jason W on April 17, 2018, 08:16:36 PM
dCore-usbinstall now does not exit at the begenning if there is not a valid USB drive available upon launch.  Later in the process, one can choose from available USB devices and if none available or a change is wanted, there is a rescan option that can be used which will prompt the user to insert a USB key before returning to the same menu to choose a USB device.  The rescan option can be used until a USB device is chosen or exiting. 
Title: Re: dCore-usbinstall
Post by: PDP-8 on April 23, 2018, 01:51:12 PM
That worked great!  Pretty slick Jason!

Problem *for me* is pure UEFI boot.  (and secure-boot disabled of course)

Seems like older machines, or newer machines that have the CSM fallback option, will boot dCore (and TC) with either the dd'ed 9660 cd filesystem, or with the installed ext2 format using dCore-usbinstall.  No problem.

BUT, stick to a pure UEFI only environment, (secure-boot disabled natch), and it won't recognize the dCore-usb install.  Like my Acer 114 laptop, which has no csm fallback option.

I recognize that TC and dCore don't support all pc hardware - in this instance I'm going to research alternative boot managers I think and see what I can do to get them to play nicely with dCore and TC without having to use the csm fallback (which is not even present on my Acer)

Still, nice job on the dCore-usbinstall script.  That was awesome watching it do it's thing.

Title: Re: dCore-usbinstall
Post by: Jason W on April 23, 2018, 05:33:00 PM
Hi PDP-8

I don't have UEFI hardware though I have what is to me a nice newer machine, but I have read here in the Tinycore forum as well as on the web about UEFI and how to install to a usb stick with support for it.  I have done some trial runs with the command line and so far so good, seems simple enough.  I will aim to script a UEFI option into dCore-usbinstall hopefully in the coming days. 

Title: Re: dCore-usbinstall
Post by: PDP-8 on April 23, 2018, 08:36:33 PM
Awesome!  No rush.  I have to manage my data limits anyways, so even with dCore I have to keep an eye on things and can't keep on downloading the iso over and over. 

Hmmm.. would a local iso option for dCore-usbinstall be useful so I can burn it over and over from another filesystem in case things go wrong for whatever reason?

I also caught something complaining during the boot about ext3 not supporting certain features, which I guess is normal considering the filesystem on the stick is now ext2...  I just let the ext3 complaint slide and everything seems to be working (on a csm-enable box...)

Thanks for working on this stuff!
Title: Re: dCore-usbinstall
Post by: Jason W on April 26, 2018, 07:48:16 AM
Hi PDP-8

dCore-usbinstall does not download and iso, only the dCore*.gz and vmlinuz* files, and it saves them in /etc/sysconfig/tcedir/dCoreusbinstall.  If the tce directory is on persistent storage, then those files are saved and used on later runs of dCore-usbinstall.  New md5sum files are downloaded on each run, and if the old dCore*.gz and vmlinuz* files pass md5 check they are used and not re-downloaded.

dCore-usbinstall is posted with an update to support UEFI.  A menu to choose between UEFI and LEGACYBIOS has been added, LEGACYBIOS simply is the previous way the installer worked, creating an ext2 partition that uses the whole usb drive.

The UEFI option creates a fat32 filesystem on a first partition of the usb drive.  The size of that first partition is the size of the dCore*.gz plus the vmlinuz* plus 20MB.  The 20MB is to leave room for the roughly 10MB needed for the grub files.  The size of my first partition created when installing dCore-stretch64 is 41MB, 32MB which was used by the installation.  This way the second ext2 partition created is the maximum possible size, and this second partition is where the TCE directory will be created upon booting the usb. 

Both a 32 and 64 bit grub efi boot files are installed whether the current session is 32 or 64 bit dCore.  I may later make dCore-usbinstall not install 32 bit grub efi files if a 64 bit dCore installation target is chosen as booting the resulting usb on 32 bit is not needed. 

Everything seems to be working as expected, please import and test. 
Title: Re: dCore-usbinstall
Post by: Jason W on April 26, 2018, 09:40:32 AM
Noticed an issue when running dCore-xenial and using dCore-usbinstall, should be fixed now. 

dCore-wheezy's grub-efi package is too old, so dCore-usbinstall won't work using a running dCore-wheezy session but dCore-wheezy can be installed to usb. 

EDIT:  On using dCore-usbinstall in the same boot session with different usb devices, I noticed errors involving partitioning and formatting .  They are fixed now, so please re-import if any errors have been seen. 
Title: Re: dCore-usbinstall
Post by: Jason W on April 27, 2018, 04:12:32 PM
Just made some changes in the grub UEFI install process now that I am able to test boot the results, previously the resulting usb would not boot.  UEFI installing should be good now.