My way to add puppy in grub2 efi ubuntu

Booting, installing, newbie
Post Reply
Message
Author
User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

My way to add puppy in grub2 efi ubuntu

#1 Post by fabrice_035 »

Hi,
My "new" ( second-hand ) laptop shared ubuntu 18.04 lts and windows8 (for an old game I like very much) and I was using puppy on an external usb key with a save file on a hard drive partition

As my new puppy (bionicpup64) works very well I wanted to install it on the hard drive for a faster boot.
Here's how I did it, you can tell me if it's good or bad :)

At first there was only windows8 and then I installed Ubuntu and he installed grub2.

1)
here's a capture of gparted in the initial situation ( in sda6 there is the personal saving file = .3fs file of my puppy) and I boot the computer onto an external usb drive.
Image

2)
I resized the ubuntu partition which created an additional partition. although I could have kept sda6 but I wanted a new partition to do this experiment.
I took the iso file of a bionicpup64 that I extracted in the sda7 partition formatted as ext4
I copied my personal puppy backup file into sda7.

3)
With ubuntu i took the grub_customizer tool :

Image
you have to add an entry and choose the custom option,
but grub_customizer doesn't complete the information correctly, the serial number of the partition is however good,
at the end of the day here's what works

Code: Select all

set root='(hd0,7)'
search --no-floppy --fs-uuid --set=root 2226c8f6-674f-4ec0-a543-5b8eb30dfcc2
linux /vmlinuz pdrv=2226c8f6-674f-4ec0-a543-5b8eb30dfcc2 pmedia=atahd
initrd /initrd.gz
Now when I start the computer I can start my puppy.

Image

and puppy's using the personnel file that's in sda7.

Finally, for information, gparted :
Image

If it helps someone, then so much the better.

ps: I hope the translation's not too bad.
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

enrique
Posts: 595
Joined: Sun 10 Nov 2019, 00:10
Location: Planet Earth

#2 Post by enrique »

I see no problem. Perfectly done. You did work with what you got, a PC with an 110GB HDD, You use grub_customizer to edit grub2 menu.

I see a windows partition with no space left. I assume it is holding your old data. I guess you have your own reasons to keep the other 2 OS. But if you don't you can recover 80% of you useful and soon needed HDD space.

Many of us been on same road. Window to Ubuntu to Puppy. Except for some users that consider security holes in Puppy, must of us once use Puppy do not need those other OS. Some of us, install a 64Bit with 32bit capabilities. Then Install latest wine with same capabilities. Wine will serve as a backup solution when you do still need to use an app build for windows 64 & 32 bit. We got emulators even for very old 16bit Dos apps.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

Did you need to turn off Secure Boot to make this work with Puppy?

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#4 Post by fabrice_035 »

@rcrsn51
thank you for asking the question, indeed I have removed the secure boot in the bios.
with secure boot do you think it would be possible to start this puppy ?
Question of curiosity because secure boot is useless.
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

I suspect that Ubuntu would work because it is a signed distro, but Puppy would not.

oui

#6 Post by oui »

Hum, as I don't need some Windows NT any more and my HD has only 3/4 TB

> Gparted
>> erase all :lol:
>>> new DOS table (it erase all) and not EFI any more
>>>> 1 very little partition for grub
>>>>> 1 very big (*1 partition ext4 sda5 in the logical partition sda2 for all, excepted
>>>>>> 1 little partition for PC android 64 (must be the last installation if you want that the grub installation take it automatic under consideration!)
>>>>>>> a little part. sda3 (only to reserve the rang of partition names! Actually is Deepin 15.7 non upgrated (*2 also full installed in it, you need 10 GB or more)
>>>>>>>> swap sda4 in size of my RAM at the end of the partitions table.

:roll:

in the big partition:

- a full install (actually deepin (*3 build from Deepin-15.7 upgrated in steps to Deepin-15.11. This way you can continue to install and use the old 32 bit packages like xvidcap, adobe air for linux, webkit, webkit2 etc. as well as wine, playonlinux and winetricks about without limitation!

- a full installation of SliTax WITHIN the /var dir from deepin-15.11 :wink: (see http://doc.slitaz.org/en:guides:uncommoninst :roll: )

- some Puppy's, a lot of Puppy's....

You only need to provide to instructions for grub in /etc/grub.d/40_custom like that:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above
menuentry "Puppy 32 bit wiithout PAE" {
set root=(hd0,5)
linux /Za/vmlinuz root=/dev/sda5 psubdir=Za ro quiet
initrd /Za/initrd.gz
}
or for quirky
menuentry "Quirky with 'q' compression" {
set root=(hd0,5)
linux /Zq/vmlinuz root=/dev/sda5 psubdir=Zq ro quiet
initrd /Zq/initrd.q
}
and actualize grub

Code: Select all

# upgrade-grub
in your plain installation...

(to avoid to do it often, and have to use long grub cfg lists, you change the name of the subdir for the Puppy! In rox it is fast and easy. Looking at the ISO in it, you can see which Puppy will appear!

Why "Z" (*4 in front of my subdir names?

To separate clearly the dirs of the plain install from the other ones :idea:

after "/var" it is not the plain install: take care, don't erase those subdir's to change the plain install you would loose a lot of your data ...

(idem in /home/myself : change the preinstalled subdirs like /home/myself/my-documents into links only to new dirs like Y-documents:

Code: Select all

# ln -s /home/.../my-documents /Y-documents
(*1 why only a big partition: because of data consistency - I try to eliminate all double versions! In my Puppy's, after remastering, /root/my-documents is a link to /Y-documents (read and write Y-... but think "my-") from the unique partition. But take care! You can use an unique /root/.mozilla for all Puppys but must have a separate one for the full installations of other distro like Deepin, Ubuntu or SliTaz because of the writing rights! It is so so long Puppy will not supply a free user right in Puppy :wink: . Understand please the difference well...

(*2 so I preserve all original libraries :wink: ; it is the most stuff of that installation...

(*3 take care! Deepin is very easy and enormous fast to install from stick (only not completely 10 minutes on my PC for a 9 GB installation, also if somewhat wrong immediately reinstall and do not search! You loose time!) but IT ERASES THE PARTITION and changes the grub start at each (re)installation! If you don't want that: Deepin "empty" in a separately 30 GB partition it is enough if your data are under sda5)

(*4 I also have some dirs or files with names beginning with "0"(zero). Why? They are in front of all files / dirs in the alphabetical range of rox or other tree managers. So you find them very fast and light! But they are under "/bin", the really first name of each full install. If you want to erase / remove a full install WITHOUT TO LOOSE some files or dir's, you only have to take care using this method to erase ONLY FROM BIN TO VAR INCLUDED (but take take what you do whit /boot :wink:and with /home/myself : you can loose both, boot loader and all your doc's in /home :roll: ...
.
Last edited by oui on Wed 15 Apr 2020, 19:42, edited 1 time in total.

starbeamfan8
Posts: 4
Joined: Sun 12 Apr 2020, 22:49

#7 Post by starbeamfan8 »

@fabrice_035
thank you for asking the question, indeed I have removed the secure boot in the bios.
with secure boot do you think it would be possible to start this puppy ?
Question of curiosity because secure boot is useless.
Out of curiosity, I went ahead and checked to see if I could.

Short answer: No, the kernel bzImage is unsigned. GRUB2 will load as it's signed, but it'll stop at the kernel.

Long answer: Yes, but you have to sign the puppy's bzImage AND enroll the key you signed it with in the firmware. I used a Machine Owner Key in this case. While I'm using a custom kernel here, the procedure should be the same with the provided kernel.

There are very few instances where I'd actually use Secure Boot.
Attachments
secureboot-clip.jpg
Screenshot documenting success. I needed to give myself some kind of trophy for putting myself through this.
(221.46 KiB) Downloaded 33 times

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#8 Post by fabrice_035 »

@starbeamfan8
How signed puppy bzimage ?
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

starbeamfan8
Posts: 4
Joined: Sun 12 Apr 2020, 22:49

#9 Post by starbeamfan8 »

@fabrice_035

First I created and enrolled a key. Key creation requires openssl, and enrolling a MOK requires mokutil. Signing the image requires sbsign.

Code: Select all

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -days 36500 -subj "/CN=My Company Name or Whatever Here/" -nodes

sudo mokutil --import MOK.der

--Reboot the system and complete enrolling the key - you'll need the password you set during import --
Signing requires the cert to be in a different format, so we convert it first:

Code: Select all

openssl x509 -in MOK.der -inform DER -outform PEM -out MOK.pem
Then finally, we sign the kernel image.

Code: Select all

sbsign --key MOK.priv --cert MOK.pem --output [OUTPUTPATH] [INPUTVMLINUZ]

For example, my command:
sbsign --key MOK.priv --cert MOK.pem --output pup2.signed /boot/pup2-vmlinuz
I then made a backup copy of my old kernel image and replaced it with my signed version.

More detailed instructions can be found here: https://ubuntu.com/blog/how-to-sign-thi ... ecure-boot

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#10 Post by fabrice_035 »

@starbeamfan8 Thanks,

I'm not saying I'm going to try because I don't need to, but it's interesting.

Regard
Bionicpup64-8.0 _ Kernel 5.4.27-64oz _ Asus Rog GL752

Post Reply