Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: punkgeek on July 13, 2017, 06:07:28 PM

Title: grub settings
Post by: punkgeek on July 13, 2017, 06:07:28 PM
Hello,
I've try to load x86 extensions from x86_64 and after searching, I got should to do this:
vmlinuz64 + rootfs.gz + modules64.gz

but I cant understand how should I do that in menu.lst from grub:

kernel /boot/vmlinuz64 quite
initrd /boot/rootfs.gz, /boot/modules64.gz

it dose not worked for me.

I need to install chntpw from tinycore64 and it is not exist from x86_64 repo, is there anything to do that without load rootfs.gz? like convert x86 package to x86_64?

Thank you
Title: Re: grub settings
Post by: coreplayer2 on July 13, 2017, 08:45:07 PM
Hello,
I've try to load x86 extensions from x86_64 and after searching, I got should to do this:
vmlinuz64 + rootfs.gz + modules64.gz

but I cant understand how should I do that in menu.lst from grub:

I need to install chntpw from tinycore64 and it is not exist from x86_64 repo, is there anything to do that without load rootfs.gz? like convert x86 package to x86_64?

Thank you

Hi
I think you mean to load chntpw.tcz from the TC8 x86 repo

If you need tinycore64 to run 32bit chntpw with 64bit kernel, then

for Grub2 use
Code: [Select]
linux /boot/vmlinuz64 loglevel=3
initrd /boot/rootfs.gz /boot/modules64.gz

I'm not sure about use with grub4dos however..

Good luck
Title: Re: grub settings
Post by: coreplayer2 on July 13, 2017, 11:03:04 PM
I did some digging..

It appears that grub4dos and grub2 share some features for compatibility so looks like the grub2 menu format will work for grub4dos also.
Therefore try this
Code: [Select]
linux /boot/vmlinuz64 loglevel=3
initrd /boot/rootfs.gz /boot/modules64.gz
Title: Re: grub settings
Post by: Misalf on July 14, 2017, 02:34:43 AM
Note that with
vmlinuz64 + rootfs.gz + modules64.gz
you have 64-bit kernel and 32-bit user-space.
i.e. "Core 64"

Meaning the kernel operates at 64-bit and can access more than 4GB RAM
but your apps are 32-bit.

So the  x86_64  repo doesn't apply to you in this situation.

If you want  "Core Pure 64" (64-bit apps), load  rootfs64.gz  instead of  rootfs.gz .
Title: Re: grub settings
Post by: curaga on July 14, 2017, 02:39:20 AM
You should be able to compile chntpw for 64-bit just fine.
Title: Re: grub settings
Post by: Juanito on July 14, 2017, 03:58:12 AM
chntpw posted to corepure64 repo

*** not tested ***
Title: Re: grub settings
Post by: punkgeek on July 15, 2017, 02:36:15 PM
Thank you
It's done

But how can I install grub on tinycore x86_64 ?
I could not found it from repo
And how can I compile 32 bit extensions for 64 bit systems?
Title: Re: grub settings
Post by: coreplayer2 on July 15, 2017, 02:44:04 PM
But how can I install grub on tinycore x86_64 ?
I could not found it from repo
You should find " grub2-multi.tcz " in the TC-8 x86_64 repo
Title: Re: grub settings
Post by: Juanito on July 15, 2017, 02:46:21 PM
..and 32-bit extensions will not work on corepure64
Title: Re: grub settings
Post by: punkgeek on July 15, 2017, 03:10:59 PM
I've tried to install but I got this error from grub2_multi.tcz extension:

Code: [Select]
$ sudo grub-install --root-directory=/mnt/sda1 /dev/sda1
installing for i386-pc platform.
grub-install: warning: cannot open directory '/usr/local/share/locale': no such file or directory.
grub-install: warning: file system 'ex2' doesn't support embedding.
grub-install: warning: embedding is not possible. grub can only be installed in this setup using blocklists. however, blocklists are UNRELIABLe and their ise is discouraged..
grub-install: error: will not proceed with blocklists.
Title: Re: grub settings
Post by: Juanito on July 15, 2017, 03:43:00 PM
Does this work:
Code: [Select]
$ sudo grub-install --target=i386-pc --boot-directory=/mnt/sda1/boot /dev/sda
Title: Re: grub settings
Post by: punkgeek on July 16, 2017, 06:28:48 AM
Thank you but i got this error:

Code: [Select]
installing for i386-pc platform.
grub-install: warning: cannot open directory '/usr/local/share/locale': no such file or directory.
installation finished. no error reported
Title: Re: grub settings
Post by: Rich on July 16, 2017, 07:54:25 AM
Hi punkgeek
That's not an error, that's a warning. That last line is telling you that the installation completed. The warning is due to the various
language files for messages not being found.
Title: Re: grub settings
Post by: punkgeek on July 16, 2017, 08:14:12 AM
Thank you, It's worked :x

But, how can I config the grub2? becuase I cant find grub.cfg file from /mnt/sda1/boot/grub
I made a grub.cfg from this directory, but It does'nt work:
Code: [Select]
menuentry "tinycore63" {
linux /boot/vmlinuz quiet
initrd /boot/corepure64.gz
}
Title: Re: grub settings
Post by: Juanito on July 17, 2017, 12:11:58 PM
grub.cfg is not installed - you need to create you own.

You probably need to tell grub where to look for vmlinuz/corepure64.gz - see:

http://forum.tinycorelinux.net/index.php/topic,19364.msg119228.html#msg119228
Title: Re: grub settings
Post by: coreplayer2 on July 17, 2017, 02:09:51 PM
http://forum.tinycorelinux.net/index.php/topic,19364.msg119228.html#msg119228
I was looking for that link, probably should be in wiki??

@ punkgeek
If you follow juanito's guide found at that link you'll be set. 
But most likely the missing command (among other things) was
Code: [Select]
search --no-floppy --fs-uuid --set=root 196fcfb2-bd37-495d-b855-41f08201be7d
Obviously replacing the uuid for your install device uuid
Title: Re: grub settings
Post by: Iko113 on July 28, 2018, 12:29:54 PM
Same subject, similar (same?) problem: installation of grub2-multi according to instructions of Juanito in this thread (23/12/2015) fails with error:
"/usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory":   see attachment!
(see also citation "bugzilla.redhat.com/show_bug.cgi?id=1101352" "Chris Murphy 2014-06-30 16:47:43": "Looks like this is intentional...")
Any solution?
Title: Re: grub settings
Post by: Iko113 on July 29, 2018, 03:50:46 AM
installation of grub2-multi according to instructions of Juanito in this thread
Correction: in deviation of the instructions I made the USB stick with PartedMagic as GPT with partitions 1)ext4 and 2)DOS/UEFI since I need this to boot a Acer Aspire 7 with UEFI only.
Title: Re: grub settings
Post by: Juanito on July 30, 2018, 03:59:08 AM
"/usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist.

The file is at /usr/local/lib/grub/x86_64-efi/modinfo.sh - perhaps a script is calling it at the wrong location?
Title: Re: grub settings
Post by: Iko113 on July 30, 2018, 05:16:07 AM
"/usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist.

The file is at /usr/local/lib/grub/x86_64-efi/modinfo.sh - perhaps a script is calling it at the wrong location?
The script I used is "sudo grub-install --target=x86_64-efi --boot-directory=/mnt/sdc2/EFI/BOOT --efi-directory=/mnt/SDC2 --removable". But the file in my case is at  /usr/local/lib/grub/i386-efi/modinfo.sh (created by grub2-multi?) (see attachment previous post). Can I change this location?
Title: Re: grub settings
Post by: Juanito on July 30, 2018, 05:48:00 AM
If you use "--target=x86_64-efi", I presume /usr/local/lib/grub/x86_64-efi/modinfo.sh will be used.

In any case, both:

/usr/local/lib/grub/x86_64-efi/modinfo.sh
/usr/local/lib/grub/i386-pc/modinfo.sh

..are present in the grub2-multi extension.
Title: Re: grub settings
Post by: Iko113 on July 30, 2018, 06:54:37 AM
If you use "--target=x86_64-efi", I presume /usr/local/lib/grub/x86_64-efi/modinfo.sh will be used.

In any case, both:

/usr/local/lib/grub/x86_64-efi/modinfo.sh
/usr/local/lib/grub/i386-pc/modinfo.sh

..are present in the grub2-multi extension.
Thank you very much for your help. On my PC I have modinfo.sh both in i386-efi and in i386-pc, but not in x86_64-efi (this folder doesn't exist): see attachment. Can I use "--target=i386-efi" (or i386-pc) for grub-install?
Title: Re: grub settings
Post by: Juanito on July 30, 2018, 08:10:52 AM
Ah - you're using the grub2-multi extension from the x86 repo - this thread is about the extension from the x86_64 repo.

I believe (I might be wrong) that i386-efi is only useful for old macs, which use 32-bit efi. For new macs and pcs, which use 64-bit (u)efi, you will need x86_64-efi supplied by the extension in the CorePure64 repo.
Title: Re: grub settings
Post by: Iko113 on July 30, 2018, 03:22:25 PM
For new macs and pcs, which use 64-bit (u)efi, you will need x86_64-efi supplied by the extension in the CorePure64 repo.
Is x86_64-efi also present in TinyCorePure64? Otherwise I'll have to start all over...
Title: Re: grub settings
Post by: curaga on July 31, 2018, 04:13:17 AM
TinyCore is just Core with some extensions included, the repo is the same. Also note that you don't have to install the same system you installed grub with, you can create your usb stick with a live corepure64 edition and have it boot 32-bit core.

Some history with this, grub 0.97 could not be compiled 64-bit, so if your system was pure 64-bit, you needed to use a 32-bit system to install grub.
Title: Re: grub settings
Post by: Iko113 on July 31, 2018, 09:01:33 AM
For new macs and pcs, which use 64-bit (u)efi, you will need x86_64-efi supplied by the extension in the CorePure64 repo.
Sorry for all my questions and thank you for your patience. But my stick, made with TinycorePure64-9.0.iso, has i386-pc/modinfo.sh and not x86_64-efi: see attachment. My history: Stick (sdc) made with [GPT, sdc1 (ext4) and sdc2 (DOS/UEFI)]. Copy TinycorePure64-9.0.iso to sdc1 with dd. Copy Bootx64.EFI from sdc1 (efiboot.img) to sdc2/EFI/BOOT. Grub.cfg made at  mnt/sdc2/EFI/BOOT/grub (and also copied to.../grub/grub)(see same attachment). But when I try to boot from this stick, I boot into the grub screen, not into TC?? Problem with grub.cfg? Maybe I should go the ubuntu-way like suggested in "Tiny Core Linux » Tiny Core Base » TCB Talk » Frugal install on new laptop (UEFI-BIOS trouble)?
Title: Re: grub settings
Post by: Rich on July 31, 2018, 09:27:08 AM
Hi Iko113
Not related to your grub problem, but why are you including the  cde  boot code?
Title: Re: grub settings
Post by: Iko113 on July 31, 2018, 11:59:33 AM
Hi Iko113
Not related to your grub problem, but why are you including the  cde  boot code?
I cannot reconstruct exactly what i did, but I copied the whole bootcode from a original grub.cfg that was present on sdc2/EFI/BOOT/grub after dd of TinycorePure64-9.0.iso to sdc (my usb-stick) or after a (failed)  "grub-install --target=x86_64-efi --boot-directory=/mnt/sdc2/EFI/BOOT --efi-directory=/mnt/sdc2 --removable".
Title: Re: grub settings
Post by: Iko113 on August 01, 2018, 11:28:32 AM
Hi Iko113
Not related to your grub problem, but why are you including the  cde  boot code?
More info: see attachment for the origin of cde. I suppose it is necessary to load the extensions in cde?
Title: Re: grub settings
Post by: Iko113 on September 15, 2018, 06:00:22 AM
For new macs and pcs, which use 64-bit (u)efi, you will need x86_64-efi supplied by the extension in the CorePure64 repo.
... My history: Stick (sdc) made with [GPT, sdc1 (ext4) and sdc2 (DOS/UEFI)]. Copy TinycorePure64-9.0.iso to sdc1 with dd. Copy Bootx64.EFI from sdc1 (efiboot.img) to sdc2/EFI/BOOT. Grub.cfg made at  mnt/sdc2/EFI/BOOT/grub...
But when I try to boot from this stick, I boot into the grub screen, not into TC??
Listing of the partitions in the grub prompt says "unknown filesystem". GParted error: e2fsprogs required (see annex 1 for another trial with ext2), although this was installed. Debian manpages says "some older kernels and older versions of e2fsprogs will not support file systems with this ext4 feature (64bit) enabled." (see annex 2). What now??
Title: Re: grub settings
Post by: Iko113 on September 15, 2018, 08:49:34 AM
In my previous post I added the wrong attachment. Here it is for ext4.
Title: Re: grub settings
Post by: Iko113 on September 15, 2018, 01:54:15 PM
Sorry for the previous posts (#29 and #30): this problem was solved by installing e2fsprogs in the terminal (as in the instructions): something must have gone wrong with the installation in the appbrowser.
Title: Re: grub settings
Post by: coreplayer2 on September 15, 2018, 02:07:41 PM
Hello Iko113

Honestly I would start over..

I recommend a non-journaling file system like ext2 file system for a USB stick
and ext4 for a regular old HDD
create
sdc1 (DOS/UEFI) for your boot files
sdc2 (ext2) for you home, opt and tce directory structure

--set=root will probably need to be the first partition so that grub can find your /boot/ "linux files"
Code: [Select]
blkid -s UUID /dev/sdc1
You're showing errors with unsupported file systems from a booted tinycore which is unrelated to grub.
You can verify which file systems gparted current;y has support for by checking gparted menu;  Gparted > View > File System Support
If a file system is not supported then load the appropriate driver, eg;
Code: [Select]
tce-load -i e2fsprogsthen close and reopen gparted

Also this has been said many times already (not that this is an issue yet, but will be once you've provided grub with the correct path to your linux files...)  CDE is for a read only Compact Disk.  After copying the contents of a cde directory to a USB stick or HDD, you must change the directory name from cde to tce and remove the cde entry from your boot config file.


An example of grub.cfg from my currently installed USB stick
Code: [Select]
insmod part_msdos
insmod fat
insmod ext2
loadfont unicode
insmod efi_gop
insmod efi_uga
insmod font
insmod gfxterm
set gfxmode=auto
set gfxterm_font=unicode
set gfxpayload=keep
terminal_output gfxterm

#Timeout for menu
set default=0
set timeout=5

menuentry "*** TC-9-x86 (Nvidia on USB)" {
search --no-floppy --fs-uuid --set=root B854-8FE0
linux /boot/vmlinuz-41410 vmalloc=384MB tz=GMT noswap loglevel=3 waitusb=5:UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" tce=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311"/tc9-x86 opt=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" home=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" lst=onboot_x86_Nvidia.lst mydata=mydata_tc9x86.Nvidia
initrd /boot/rootfs-90.gz /boot/modules-41410.gz
}


menuentry "*** TC-9-Corepure64 (Xorg on USB)" {
search --no-floppy --fs-uuid --set=root B854-8FE0
linux /boot/vmlinuz64-41410 noswap tz=GMT loglevel=3 waitusb=5:UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" tce=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311"/tc9-x86_64 opt=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" home=UUID="b313c2c4-fedf-4c44-bf42-6a6fca54b311" lst=onboot_CorePure64.lst
initrd /boot/rootfs64-90.gz /boot/modules64-41410.gz
}

menuentry "System restart" {
echo "System rebooting..."
reboot
}
When you have multiple drives and partitions it's important to specify the correct path to the linux files you wish to use.
Remember this is only a partial example from a USB install I use on a 64bit UEFI PC in compatibility mode, so YMMV

I suggest set root and partition layout is holding back progress here...
Title: Re: grub settings
Post by: Iko113 on September 15, 2018, 03:13:19 PM
Thank you for your support. I'll have to do some (more) reading ;-)
Title: Re: grub settings
Post by: Iko113 on September 16, 2018, 10:23:42 AM
create
sdc1 (DOS/UEFI) for your boot files
sdc2 (ext2) for you home, opt and tce directory structure

--set=root will probably need to be the first partition so that grub can find your /boot/ "linux files"
This first partition would be sdc1(DOS/UEFI), but the "linux files" home, opt and tce are on sdc2??
(my confusion: is "root" for GRUB/UEFI or for TC-files?)
Title: Re: grub settings
Post by: coreplayer2 on September 16, 2018, 12:11:52 PM
I think of root as synonymous with original of something, or the beginning

We must be careful not to confuse the root file system with root device.   AIUI as Grub.cfg  is concerned we are referencing the device where linux kernel and tc initrd can be found.  In this case we are specifying the first partition to begin our search.


In this example:

Code: [Select]
blkid -s UUID /dev/sdc1
Code: [Select]
search --no-floppy --fs-uuid --set=root B854-8FE0
linux /boot/vmlinuz
initrd /boot/rootfs.gz /boot/modules.gz

required components to boot are referenced from root device (partition UUID B854-8FE0)/boot/


there are some minor differences with GPT and UEFI installations but the grub install command will take care of these
If you use the  --removable option then GRUB will be installed to /EFI/BOOT/BOOTX64.EFI

But don't take my word for anything, if you need more, see:
https://www.gnu.org/software/grub/manual/grub/grub.html#Introduction
Title: Re: grub settings
Post by: Iko113 on November 04, 2018, 11:49:14 AM
Problem solved by 1. advice of coreplayer2 combined with 2. modification of grub-install: replace "target=x86_64-efi" with "target=i386-efi". Thanks for your help.