Porteus Kernel Builder

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
neko
DEV Team
DEV Team
Posts: 1730
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Porteus Kernel Builder

Post#1156 by neko » 14 Feb 2021, 10:32

@Blaze
1. New AUFS Interface: issue of "deactivate"
Porteus Kernel Builder (Post by Blaze #81268)
1) Function of deactivate xzm modules is not work for me.
When I try to deactivate xzm module via GUI or CLI my PC is freezing (at this moment,
I cannot do anything, since everything is frozen) and only long press Power button is shutdown my PC.
--->
"deactivate" command for "AUFS New IF" will be fixed with 001-patch.xzm that will be inserted by "Kernel Builder" version 21.02.12.

2. New AUFS Interface: issue of boot abort
Porteus Kernel Builder (Post by Blaze #81272)
--->
It will be fixed with /usr/local/share/mkKernel/lib/upkernel/syslinux/au.initrd.xz that is included "Kernel Builder" version 21.02.12.

3. aufs-util: issue of header
Porteus Kernel Builder (Post by Blaze #81275)
Porteus Kernel Builder (Post by Blaze #81349)
Porteus Kernel Builder (Post by Blaze #81413)

Excuse me for very long delay reply.
I will study this issue.

I took long time to fix the 1&2 issues.
The 1&2 issues are not yet complete.
I can not yet understand the difference between XXbit.config and neko-XXbit.config of kernel 5.10/5.11.
XXbit.config: is generated from config that was presented by Blaze
Porteus Kernel Builder (Post by Blaze #80931)
neko-XXbit.config: is generated from 5.4, 5.5, 5.6, 5.7, 5.8, 5.9 config.
It will take enough time to study the difference because it needs many kernel builds.


Thanks.

User avatar
Blaze
DEV Team
DEV Team
Posts: 3118
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Porteus Kernel Builder

Post#1157 by Blaze » 14 Feb 2021, 10:42

neko,
neko wrote:
14 Feb 2021, 10:32
"AUFS New IF" will be fixed with 001-patch.xzm
and
neko wrote:
14 Feb 2021, 10:32
/usr/local/share/mkKernel/lib/upkernel/syslinux/au.initrd.xz
these stuff can be shared?

P.S. 001-patch.xzm must be extracted to 001-core.xzm?

Thanks and take your time!

Regards,
Blaze
Linux 5.10.11-porteus #1 SMP Thu Jan 28 11:33:44 UTC 2021 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

neko
DEV Team
DEV Team
Posts: 1730
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Porteus Kernel Builder

Post#1158 by neko » 14 Feb 2021, 11:31

@Blaze
1. these stuff can be shared?
--->
Yes.
activate mkKernel-21.02.12-noarch-1.xzm (or APorteus-XFCE_de-v21.02.12-x86_64.iso already includes this module)
then
there are /usr/local/share/mkKernel/lib/upkernel/syslinux/au.initrd.xz and /usr/local/share/mkKernel/lib/upkernel/base/001-patch.

2. P.S. 001-patch.xzm must be extracted to 001-core.xzm?
No, it must not.
You can see by the comand "ls -R /usr/local/share/mkKernel/lib/upkernel/base/001-patch" .

And how to insert it into ISO is as followed.
"perform" genarated by "Kernel Builder" "help" function.
#!/bin/sh
#
###=== For manual use ===###
# % su
# # mkdir -p /tmp/work334917
# # sh ./perform
# # cat /tmp/work334917/errorMSG
#


###=== Update kernel of ISO ===###

if ( grep -qs CONFIG_RD_ZSTD=y /home/guest/kernel/v5.10.16/64/64bit.config )
then
ALLZSTD=yes
else
ALLZSTD=no
fi

rm -fr /home/guest/kernel/v5.10.16/initrd.zstd /home/guest/kernel/v5.10.16/initrd.xz /home/guest/kernel/v5.10.16/001-patch

#== update initrd.xz ==#

BUILDFS=`grep -s aufs /home/guest/kernel/v5.10.16/64/vmlinuz && echo AUFS || echo OVFS`
if [ \"$BUILDFS\" = OVFS ]
then
cp /usr/local/share/mkKernel/lib/upkernel/syslinux/ov.initrd.xz /home/guest/kernel/v5.10.16/initrd.xz
else
cp /usr/local/share/mkKernel/lib/upkernel/syslinux/au.initrd.xz /home/guest/kernel/v5.10.16/initrd.xz
fi

cp -a /usr/local/share/mkKernel/lib/upkernel/base/001-patch /home/guest/kernel/v5.10.16/
## original ISO, 000-kernel ##
cp /home/guest/porteus/5.0/rc2/org/Porteus-XFCE-v5.0rc2-x86_64.iso /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso
rm -fr /tmp/work334917/mntiso /tmp/work334917/mntxzm
mkdir -p /tmp/work334917/mntiso /tmp/work334917/mntxzm
if ! ( mount -t iso9660 -o loop /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso /tmp/work334917/mntiso )
then
echo "ISOマウント失敗: /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso" >> /tmp/work334917/errorMSG
rm /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso
exit 1
fi

if ! ( mount -t squashfs -o loop /tmp/work334917/mntiso/porteus/base/000-kernel.xzm /tmp/work334917/mntxzm )
then
echo "000-kernel.xzm のループマウント失敗" >> /tmp/work334917/errorMSG
umount -f /tmp/work334917/mntiso
rm /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso
exit 1
fi
rm -fr /home/guest/kernel/000-kernel
rm -fr /home/guest/kernel/ISO
cp -a /tmp/work334917/mntxzm /home/guest/kernel/000-kernel 2>/dev/null
cp -a /tmp/work334917/mntiso /home/guest/kernel/ISO 2>/dev/null
umount -f /tmp/work334917/mntxzm
umount -f /tmp/work334917/mntiso
rm /home/guest/kernel/Porteus-XFCE-v5.0rc2-x86_64.iso

## 000-kernel ##
rm -fr /home/guest/kernel/000-kernel/lib/modules
cp -a /home/guest/kernel/v5.10.16/64/lib /home/guest/kernel/000-kernel/
#if [ -d /home/guest/kernel/v5.10.16/64/aufs-util-*/sbin ]
#then
# cp -a /home/guest/kernel/v5.10.16/64/aufs-util-*/sbin /home/guest/kernel/v5.10.16/64/aufs-util-*/etc /home/guest/kernel/000-kernel/
# mkdir -p /home/guest/kernel/000-kernel/usr/bin
# cp -a /home/guest/kernel/v5.10.16/64/aufs-util-*/usr/bin/* /home/guest/kernel/000-kernel/usr/bin/
#fi
rm -fr /home/guest/kernel/000-kernel.xzm
mksquashfs /home/guest/kernel/000-kernel /home/guest/kernel/000-kernel.xzm -b 256K -comp xz -Xbcj x86 -noappend
rm -fr /home/guest/kernel/000-kernel
mv /home/guest/kernel/000-kernel.xzm /home/guest/kernel/ISO/porteus/base/

if [ -d /home/guest/kernel/v5.10.16/001-patch ]
then
mksquashfs /home/guest/kernel/v5.10.16/001-patch /home/guest/kernel/001-patch.xzm -b 256K -comp xz -Xbcj x86 -noappend
rm -fr /home/guest/kernel/v5.10.16/001-patch
mv /home/guest/kernel/001-patch.xzm /home/guest/kernel/ISO/porteus/base/
fi

## vmlinuz ##
cp /home/guest/kernel/v5.10.16/64/vmlinuz /home/guest/kernel/ISO/boot/syslinux/

## initrd.xz/initrd.zstd ##
rm -fr /home/guest/kernel/ISO/boot/syslinux/initrd.xz /home/guest/kernel/ISO/boot/syslinux/initrd.zstd
if [ -f /home/guest/kernel/v5.10.16/initrd.xz ]
then
mv /home/guest/kernel/v5.10.16/initrd.xz /home/guest/kernel/ISO/boot/syslinux/
else
mv /home/guest/kernel/v5.10.16/initrd.zstd /home/guest/kernel/ISO/boot/syslinux/
fi

## config ##
for i in `grep initrd /home/guest/kernel/ISO/boot/syslinux/* | grep initrd | cut -d':' -f1 | sort -u`
do
if [ -f /home/guest/kernel/ISO/boot/syslinux/initrd.xz ]
then
sed -i -e 's@initrd.zstd@initrd.xz@g' $i
else
sed -i -e 's@initrd.xz@initrd.zstd@g' $i
fi
done

## kernel-1-x86_64.sgn ##
if [ -f /home/guest/kernel/ISO/porteus/*.sgn ]
then
rm -f /home/guest/kernel/ISO/porteus/*.sgn
cp /usr/local/share/mkKernel/lib/upkernel/kernel.sgn /home/guest/kernel/ISO/porteus/kernel-v5.10.16-1-x86_64.sgn
#else
# mv /home/guest/kernel/ISO/porteus/*.cfg /home/guest/kernel/ISO/porteus/kernel-v5.10.16-1-x86_64.cfg
fi

## XXX.xzm: if initrd.zstd, all xz-XZM to zstd-XZM ##
if [ -f /home/guest/kernel/ISO/boot/syslinux/initrd.zstd ]
then
rm -fr /tmp/work334917/TRN
mkdir /tmp/work334917/TRN
for i in `find /home/guest/kernel/ISO/ -name '*.xzm'`
do
if [ "`sqFScmp $i`" = "xz" ]
then
mount -t squashfs -o loop $i /tmp/work334917/TRN
mksquashfs /tmp/work334917/TRN/ ${i}.zstd -b 256K -comp zstd -Xcompression-level 22
umount /tmp/work334917/TRN
mv ${i}.zstd $i
fi
done
rm -fr /tmp/work334917/TRN
fi


## UP.Porteus-XFCE-v5.0rc2-x86_64.iso ##
rm -fr /home/guest/kernel/UP.Porteus-XFCE-v5.0rc2-x86_64.iso
mkisofs -o /home/guest/kernel/UP.Porteus-XFCE-v5.0rc2-x86_64.iso -v -l -J -joliet-long -R -D -A Porteus -V Porteus \
-no-emul-boot -boot-info-table -boot-load-size 4 \
-b boot/syslinux/isolinux.bin -c boot/syslinux/isolinux.boot /home/guest/kernel/ISO
rm -fr /home/guest/kernel/ISO

#

exit 0
Thanks.

roadie
Full of knowledge
Full of knowledge
Posts: 315
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 5.0-RC1
Location: In a hayfield

Porteus Kernel Builder

Post#1159 by roadie » 14 Feb 2021, 19:17

@neko and Blaze

I'm not having any problems with compiling 5.10.xx or 5.11-rc kernels. They boot well with no errors and modules can be deactivated in any order, there is no freezing. I'm using the standard initrd and aufs5 patches. I don't have or use aufs-utils as I haven't seen the need for it.

The "killed" error comes from this:

Code: Select all

# CONFIG_DEBUG_FS_ALLOW_ALL is not set
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
CONFIG_DEBUG_FS_ALLOW_NONE=y........ = KILLED
If it is changed to this, the kernel boots:

Code: Select all

CONFIG_DEBUG_FS_ALLOW_ALL=y
# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set
# CONFIG_DEBUG_FS_ALLOW_NONE is not set........ = CLEAN BOOT

maia
Black ninja
Black ninja
Posts: 64
Joined: 08 Aug 2019, 16:56
Distribution: Porteus 5 rc2 < 64b Openbox
Location: Brasil

Porteus Kernel Builder

Post#1160 by maia » 17 Feb 2021, 16:45

Similar to Rodie's Report I am compiling the 5.10.xx kernel without any problems and activating and deactivating the modules in any order. I am using a config file provided on this forum and apparently it is from puppy linux. The only function that is not working but works in the old version 5.4.47 which is the access to the MTP device to access my old nokia.

Here is the config I used:
https://dropfiles.org/rV1YXQff
Sorry my English is bad.
My English is very very very bad.
My English is really, g##gle-tr4nsl4t0r

fulalas
DEV Team
DEV Team
Posts: 1653
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Porteus Kernel Builder

Post#1161 by fulalas » 18 Feb 2021, 09:06

Not sure if I already asked this, but according to Phoronix, Clear Linux boots in 1.5 seconds while Ubuntu boots in 15.9 seconds. So I wonder if we can change kernel compilation flags easilly using neko's kernel builder tool. The flags Clear Linux uses to build its kernel are:

Code: Select all

CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -Wa,-mbranches-within-32B-boundaries"

neko
DEV Team
DEV Team
Posts: 1730
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Porteus Kernel Builder

Post#1162 by neko » 18 Feb 2021, 14:03

@fulalas

"Kernel builder" gets its parameters from GUI and generates the shell script "perform".
And It executes the "perform".

It has a "help" function.
If you press the "help" button instead of the "OK" button,
you will get the shell script "perform" file instead of executing the shell script.
Reading it, you can understand what "Kernel builder" will do.

Including the "compile item ON" at GUI setting, and get the shell script "perform" file.
You can modify the script on your need.
And execute it manually on the terminal.

Example:

Code: Select all

% su
$ diff old.perform perform
17c17
< make -j$CPU_THREADS
---
> make -j$CPU_THREADS CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -Wa,-mbranches-within-32B-boundaries"
$
$
$ head perform
#!/bin/sh
#
###=== For manual use ===###
# % su
# # mkdir -p /tmp/work3771
# # sh ./perform
# # cat /tmp/work3771/errorMSG
#


$ mkdir -p /tmp/work3771; sh ./perform; cat /tmp/work3771/errorMSG
Thanks.

fulalas
DEV Team
DEV Team
Posts: 1653
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Porteus Kernel Builder

Post#1163 by fulalas » 18 Feb 2021, 20:27

@neko, thanks!

I'll try it later. Have you tried? I'm curious to see if we can improve Porteus performance :)

neko
DEV Team
DEV Team
Posts: 1730
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Porteus Kernel Builder

Post#1164 by neko » 19 Feb 2021, 12:13

@fulalas
I built the "new aufs IF" kernel 5.11 with your make option.
But, I did not get the performance improvement expected.

Thanks.

fulalas
DEV Team
DEV Team
Posts: 1653
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

Porteus Kernel Builder

Post#1165 by fulalas » 19 Feb 2021, 23:07

@neko. is this 5.11 you put the link in the first post?

roadie
Full of knowledge
Full of knowledge
Posts: 315
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 5.0-RC1
Location: In a hayfield

Porteus Kernel Builder

Post#1166 by roadie » 20 Feb 2021, 00:15

Here's a link to patches that give you more options in the configuration for processors. The standard kernel options are really limited. The patches are made for the 5.4 to 5.8 kernel series, but worked well for 5.10.16. They're meant for anyone who doesn't care to use compiling flags and knows what processor they have.

https://github.com/graysky2/kernel_gcc_patch

The patch will only add options for processors, any further optimization would need to be done separately. As far as optimization, I haven't seen a lot of difference using the compiling flags as compared to my usual kernels. Changing the flags may make a difference, or may not.

neko
DEV Team
DEV Team
Posts: 1730
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Porteus Kernel Builder

Post#1167 by neko » 20 Feb 2021, 14:55

"Kernel Builder" was updated to version 21.02.17. (Please refer to the first article.)

kernel 5.10 & 5.11 configs were updated.

Note:
APorteus-LXDE_zh-v21.02.19-x86_64.iso can be used as updated "Kernel Builder" ISO.
ArchLinux packages manager for Porteus (Post by neko #81503)


Thanks.

User avatar
Blaze
DEV Team
DEV Team
Posts: 3118
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Porteus Kernel Builder

Post#1168 by Blaze » 21 Feb 2021, 08:46

[Updated kernel Examples]
==== AUFS Kernel only for Porteus ====
Simple package (vmlinuz, 000-kernel.xzm, 06-crippled_sources-NNN-XXbit.xzm, 07-kernel-header-NNN.xzm, 64bit.config (aka neko-64bit.config and fix Porteus Kernel Builder (Пост roadie #81422) from roadie was used))

[5.11.0] <-- NEW : "All patches" patching was done.
64bit-ALL-kernel5.11.0.tar (~113 M)
https://files.sberdisk.ru/s/aeKXxQQr24L7XHw
cf3b49bac4c6c8aa94591897fb8243bc 64bit-ALL-kernel5.11.0.tar

Code: Select all

                                                                          \\\///
                                                                         / _  _ \
                                                                       (| (.)(.) |)
.--------------------------------------------------------------------.OOOo--()--oOOO.--------------------------------------------------------------------.
|                                                                                                                                                        |
|  Linux porteus.example.net 5.11.0-newAUFif #1 SMP Sun Feb 21 10:21:24 UTC 2021 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux  |
|                                                                                                                                                        |
'--------------------------------------------------------------------.oooO-------------------------------------------------------------------------------'
                                                                      (   )   Oooo.
                                                                       \ (    (   )
                                                                        \_)    ) /
                                                                              (_/
Note : Compiler that was used.
for kernel 5.11.0: 10.2.0-x86_64

Thanks to roadie and neko for his support :hi:

____________

UPDATE.
neko wrote:
18 Feb 2021, 14:03
Including the "compile item ON" at GUI setting, and get the shell script "perform" file.
1) If this option is on - compile of kernel is started automaticly and I am not able to hack perform script :unknown:
not bad if you set for the perform script kernel options that fulalas shared by deffault in this post Porteus Kernel Builder (Пост fulalas #81467)
2) Your ISO is have old *.c32 files at the /boot/syslinux and boot up of APorteus is faile.
Replace all *.c32 files from Porteus 5.0 RC2
Linux 5.10.11-porteus #1 SMP Thu Jan 28 11:33:44 UTC 2021 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
babam
Samurai
Samurai
Posts: 186
Joined: 16 Nov 2016, 10:30
Distribution: Porteus 3.2.2 Xfce K5.10.5
Location: Rainy city

Porteus Kernel Builder

Post#1169 by babam » 21 Feb 2021, 10:59

Blaze wrote:
21 Feb 2021, 08:46
[Updated kernel Examples]
==== AUFS Kernel only for Porteus ====
[5.11.0] <-- NEW : "All patches" patching was done.
64bit-ALL-kernel5.11.0.tar (~113 M)
What about deactivate, can it be done normally (modules can be deactivated in any order).
Last edited by babam on 21 Feb 2021, 11:27, edited 1 time in total.
Sorry, my English is bad.

User avatar
Blaze
DEV Team
DEV Team
Posts: 3118
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Porteus Kernel Builder

Post#1170 by Blaze » 21 Feb 2021, 11:16

babam, I don't see any problems, activate/deactivate is work fine.
Linux 5.10.11-porteus #1 SMP Thu Jan 28 11:33:44 UTC 2021 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

Post Reply