Tiny Core Linux
Tiny Core Base => Corepure64 => Topic started by: Demontager on July 01, 2022, 04:59:51 AM
-
I am trying to make frugal persistent install TC on mini-PC which only supports UEFI boot. The iso i have used is TinyCorePure64-13.1.iso, but direct boot not working, so i used Ventoy then i got tc booted. Then followed this guide to install TC to internal storage https://iotbytes.wordpress.com/install-microcore-tiny-linux-on-local-disk/ (https://iotbytes.wordpress.com/install-microcore-tiny-linux-on-local-disk/)
tc-load -wi tc-install
Before making install i did partitioning like that. Chosen ext4 partition for TC (not whole disk)
/dev/mmcblk0p1 fat32 for EFI
/dev/mmcblk0p2 ext4
At that point i need to install grub to /dev/mmcblk0p1 Partly I followed that guide http://forum.tinycorelinux.net/index.php/topic,19364.msg119228.html#msg119228
$ tce-load -i grub2-multi
$ sudo mount /dev/mmcblk0p1
$ sudo mount /dev/mmcblk0p2
$ sudo grub-install --target=x86_64-efi --boot-directory=/mnt/dev/mmcblk0p1/EFI/BOOT --efi-directory=/mnt/dev/mmcblk0p1
Installing for x86_64-efi platform
grub-install: warning: cannot open directory '/usr/local/share/locale': No such file or directory.
grub-install: error: efibootmgr: not found
-
Figured out that i missed efibootmgr
tce-load -wi efibootmgr
Then again did
sudo grub-install --target=x86_64-efi --boot-directory=/mnt/dev/mmcblk0p1/EFI/BOOT --efi-directory=/mnt/dev/mmcblk0p1
Installation reported as successful except warning
grub-install: warning: cannot open directory '/usr/local/share/locale': No such file or directory.
Now i got grub directory created
tc@box:/mnt/mmcblk0p1/EFI/grub$ ls -al
total 138
drwxrwxrwx 2 root root 512 Jul 1 09:55 ./
drwxrwxrwx 4 root root 512 Jul 1 08:18 ../
-rwxrwxrwx 1 root root 139264 Jul 1 09:33 grubx64.efi
I know that i need to create grub.cfg within this folder. What will be the minimum config ?
-
If you search the forums on dual boot uefi bios you should find an example grub.conf.
-
If you search the forums on dual boot uefi bios you should find an example grub.conf.
Yes, i found some and compiled own grub.cfg
And it worked, partly. I got grub menu loaded with my entry, TC booted, but after trying to install some utils found that i can't install any, for example htop
tc@box:$ tce-load -wi htop
tc@box:$
means nothing happened. Also tried filetool
tc@box:$ filetool.sh -bv
Invalid device
tcedir shows
readlink /etc/sysconfig/tcedir
/tce
-
Can you post your grub.cfg?
-
I tried to post few times grub.cfg in previous message but having this error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@forum.tinycorelinux.net to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
So used pastebin instead https://pastebin.com/NSUhvqs8 (https://pastebin.com/NSUhvqs8)
-
loadfont unicode
insmod all_video
terminal_output gfxterm
search --no-floppy --fs-uuid --set=root "5d1b7f4a-0806-4447-af34-9c9920e1be79"
menuentry "TinyCorePure64-13.1" {
linux /tce/boot/vmlinuz64 loglevel=3 tce=UUID="5d1b7f4a-0806-4447-af34-9c9920e1be79" opt=UUID="5d1b7f4a-0806-4447-af34-9c9920e1be79"
initrd /tce/boot/corepure64.gz
}
Removed set lines from grub.cfg, seems they causing error in posting to forum
-
Hi Demontager
Did you forget to hit the carriage return after the closing } character?
For those who do not care to visit pastebin, a copy of grub.cfg is attached.
-
Hi Demontager
Did you forget to hit the carriage return after the closing } character?
For those who do not care to visit pastebin, a copy of grub.cfg is attached.
hmm, i have inserted grub.cfg lines within code blocks. The
[/code]
was the last line.
-
Okay, now got TC working nearly properly.
After trying some different grub configs i found that if waitusb=5 option not present it causing errors described earlier.
Below attached current grub.cfg which working as intended( for admin:still not able to post it directly to forum 500Error).
Command line: BOOT_IMAGE=/tce/boot/vmlinuz64 loglevel=3 waitusb=5:UUID=5d1v7f4a-0806-4447-af34-9c9920e1be79 tce=UUID=5d1b7f4a-0806-4447-af34-9c9920e1be79 opt=UUID=5d1b7f4a-0806-4447-af34-9c9920e1be79
According to FAQ this option needs to be set for pendrives and as you can see applicable for internal mmc storage too. http://distro.ibiblio.org/tinycorelinux/faq.html#pendrives
Also i found strange behavior with boot partition where grub.cfg resides, for some reason no boot partition files seen. Means i only see /mnt/mmcblk0p1 folder but no more files. i checked /etc/fstab and there indeed vfat exists. And mount command also confirmed that /dev/mmcblk0p1 mounted
# /etc/fstab
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/zram0 swap swap defaults,noauto 0 0
/dev/mmcblk0p1 /mnt/mmcblk0p1 vfat noauto,users,exec,umask=000 0 0 # Added by TC
/dev/mmcblk0p2 /mnt/mmcblk0p2 ext4 noauto,users,exec 0 0 # Added by TC
In such way i was unable to access grub.cfg. Then i tried to mount it again manually and it worked i may see all files
sudo mount /dev/mmcblk0p1 /mnt/mmcblk0p1
tc@box:~$ ls -al /mnt/mmcblk0p1/EFI/BOOT/grub/grub.cfg
-rwxr-xr-x 1 root root 542 Jul 4 12:23 /mnt/mmcblk0p1/EFI/BOOT/grub/grub.cfg
tc@box:~$
So it strange to me why it not working automatically from fstab
-
Hi Demontager
Tinycore will populate fstab with all of the devices it is aware of. It then creates mount points for those devices
in /mnt but does not automatically mount them all. It will only mount the devices that contain directories it
needs to run, such as tce , and persistent /home and /opt if they exist.
The VFAT partition is only used by the UEFI firmware and grub.
-
Now clear, understood why fstab not worked in auto mode. I guess i need to add mount command to bootlocal.sh then, right? Actually i already done, but found that vfat partition sometimes after reboot randomly changing device name either mmcblk1p1 or mmcblk0p1 to overcome this i do mount
sudo mount /dev/mmcblk1p1 /mnt/mmcblk1p1
or
sudo mount /dev/mmcblk0p1 /mnt/mmcblk0p1
-
Hi Demontager
... but found that vfat partition sometimes after reboot randomly changing device name either mmcblk1p1 or mmcblk0p1 ...
The only time I've seen device names change like that is when devices are added/removed and the remaining devices get reordered.
Commands in bootlocal.sh do not require sudo.
When mounting devices listed in fstab you don't need sudo.
When mounting devices listed in fstab it's enough to specify one parameter. Either of these commands will work:
mount /dev/mmcblk0p1
or:
mount /mnt/mmcblk0p1
If you add the following commands to your bootlocal.sh , it will scan fstab for lines containing
mmcblk and vfat. If found and not currently mounted, it will mount them.
for Drive in `grep mmcblk /etc/fstab | grep vfat | tr -s " " | cut -d " " -f1`
do
grep -q "$Drive" /etc/mtab || mount "$Drive"
done
-
Demontager - I have your hardware and have bad news:
I run into the same partitioning problem and is one of the reasons I never do a frugal or even boot an iso from the internal mmc device - it changes randomly.
What will make your hair gray is that it also depends on whether you do a reboot, or a total shutdown and power up. Sometimes it stays the same, and sometimes it goes haywire.
In addition, if you run from say an external usb stick, do a normal shutdown, and move the stick to another port, that seems to be a problem too randomly.
The only way to start from a known state is to actually *pull the dc jack* and reinsert. You'll see the blue light come on where the system is apparently scanning the ports and shuts off again, waiting for you to power up manually.
Even powering up manually can result in different port partitions depending on whether you do a short-press power up, or a long-press (3 seconds or more held) and let it power up that way.
What I'm saying is that this particular Wintel hockey-puck is best left under a sledge-hammer. Ask me how I know!
Sorry to be the bearer of bad news, but perhaps this knowledge will add years to your life. :)
-
I have added mount command as Rich suggested to bootlocal.sh and it does job great with mounting any partition name.
I did several reboots to test as it goes and got one hang after issuing sudo reboot command, box wasn't replying pings and no screen image. Guess it was not TC issue but hardware related.
The only problems i'm aware are those listed in dmesg, might be also related to above hang. However once system booted and running i found no issues, no lookups at least . BTW I'm using this Wintel hockey brick as openvpn server and internet router.
ACPI: AC: found native INT33F4 PMIC, not loading
ACPI Error: No handler for Region [GMMR] (000000005fbfafcb) [UserDefinedRegion] (20210730/evregion-130)
ACPI Error: Region UserDefinedRegion (ID=146) has no handler (20210730/exfldio-261)
ACPI Error: Aborting method \_SB.GPO1._E03 due to previous error (AE_NOT_EXIST) (20210730/psparse-529)
........
loop26: detected capacity change from 0 to 32
loop27: detected capacity change from 0 to 2968
loop28: detected capacity change from 0 to 688
loop29: detected capacity change from 0 to 2432
loop30: detected capacity change from 0 to 72
ACPI: AC: found native INT33F4 PMIC, not loading
ACPI: AC: found native INT33F4 PMIC, not loading
ACPI: AC: found native INT33F4 PMIC, not loading
ACPI: AC: found native INT33F4 PMIC, not loading
................
-
Because of device naming uncertainties is often best to use UUID
for grub and fstab / auto mounting type options.
Bios discovery order dictates naming convention..
Device names can change, but UUID will not...