Show your kernel configuration
Posted: Tue Aug 25, 2020 11:12 pm
Share your kernel configuration here on this thread and tell the overview of your kernel configuration.
Discussion, talk and tips
https://forum.puppylinux.com/
Code: Select all
#!/bin/ash
# Format of our boot (grub4dos menu.lst entry) ...
# kernel /bzImage net=wpa2:VMmmmmmm:xxxxxxxx:wlan0:dhcp
### bail out unless we're PID 1
[ $$ -eq 1 ] || exit 1
### configuration parameters
DEFAULT_DEVICE_DELAY=0 # seconds - default delay time for devices (so that they are recognised by kernel)
WIFI_ENABLE_TIMEOUT=${WIFI_ENABLE_TIMEOUT:-100} # unit of 1/10 seconds, max time to wait for wifi connection
KERNEL_POLL_MSECS=${KERNEL_POLL_MSECS:-5000} # default kernel polling value if unset
### utilities - decz
# decz - decrements counter, and return true when it is zero
# $1 - name of variable to be decremented
decz() {
local curval
eval "curval=\$$1"
curval=$((curval-1))
[ $curval -le 0 ] && return 0
eval "$1=$curval"
return 1
}
### cmdline processing - net
process_net() {
[ -z "$net" ] && return;
OIFS="$IFS"; IFS=":"; set -- $net; IFS="$OIFS"
echo -n "Configure network "
echo "on $2 ($1) using dhcp"
echo " "
# Ask if want to use a random mac
/usr/sbin/random-mac-ask $4
busybox ifconfig $4 up
wpa_supplicant -B -C/var/run/wpa_supplicant -Dwext -i$4
wpa_cli ap_scan 1 > /dev/null
wpa_cli add_net 0 > /dev/null
wpa_cli set_net 0 ssid \"$2\" > /dev/null
wpa_cli set_net 0 psk \"$3\" > /dev/null
wpa_cli select_net 0 > /dev/null
while [ "$(wpa_cli status | sed -ne '/wpa_state/ {s/wpa_state=//;p}')" != "COMPLETED" ];
do
sleep 0.1; decz WIFI_ENABLE_TIMEOUT && return
done;
iwconfig $4 power off # disable power management
shift 2
# connection type
udhcpc -i $2 > /dev/null
ifconfig lo up # in any case bring loopback up also
}
###################### main ##########################
# mount core filesystems
/bin/mount -t proc proc /proc # mount /proc first so /proc/self/exe works from now
mount -t sysfs sysfs /sys
if ! mount -t devtmpfs devtmpfs /dev 2> /null; then # /dev/null may not exist yet
# if no devtmpfs, use tmpfs and use mdev instead
mount -t tmpfs tmpfs /dev -o mode=755 # mode 755 is what devtmpfs uses
mdev -s
fi
[ -f /null ] && rm /null # Clear up the null file created above
[ ! -e /dev/shm ] && mkdir -p /dev/shm
[ ! -e /dev/pts ] && mkdir -p /dev/pts
[ "$TZ" ] && hwclock -t # set kernel timezone
# debugging and error logging
# comment out next two lines for greater info during bootup
! grep -q showerr /proc/cmdline && exec 2> /dev/initrd.err
grep -q debuginitrd /proc/cmdline && set -x
# enable polling
if ! grep -q block.events_dfl_poll_msecs /proc/cmdline; then # if not explicitly set
echo $KERNEL_POLL_MSECS > /sys/module/block/parameters/events_dfl_poll_msecs
fi
# keymap hard coded to use uk (GB)
loadkmap < /lib/boot/keymaps/uk
echo "Connecting to the net"
# configure network - after load modules, before basesfs
process_net
export HOME=/root
#echo console mode no job control no tty no ssh etc
#while :; do
# /bin/ash
#done
# pseudo terminal so we can run screen ssh etc
mount -t devpts none /dev/pts -o ptmxmode=0666,newinstance # pseudo terminal for screen
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
# attach to a tty so we can ssh, use screen ...etc.
while :; do
setsid cttyhack /bin/ash
done
Code: Select all
title pugdog
root (hd0,3)
kernel /CODE/MINI/FRESH-BUILD/linux-4.19.146/arch/x86/boot/bzImage nomodeset vga=0x3D2 video=map:01,i810fb:xres:1366,yres:768,bpp:16,accel,mtrr,hwcur# net=wpa2:VMmmmmmm:xxxxxxxx:wlan0:dhcp
initrd /CODE/MINI/FRESH-BUILD/initrd
Code: Select all
make CC=musl-gcc CFLAGS=-I/usr/musl/kernel/include
Code: Select all
# MAKE SURE THE INITRD IS IN THE SAME FOLDER AS BUILD.SH
# AS THIS SCRIPT COPIES THAT INTO THE VMLINUZ (BZIMAGE)
# MUST BE THE NON COMPRESSED VERSION
# ENSURE DEVX SFS IS LOADED
# ENSURE THE .config FILE IS IN THE SAME FOLDER AS BUILD.SH
# RUN THIS SCRIPT FROM THE FOLDER WHERE BUILD.SH IS LOCATED
# ==========================================================
# Modified version of as outlined in this thread/post
#http://www.murga-linux.com/puppy/viewtopic.php?p=949389
# We build a standard Linux kernel and initial basic initrd
# but replace that initrd with a cutdown version that
# includes wifi net connect and ssh .. also includes our
# kexec ... so can directly boot other vmlinuz/initrd
# and also has vnc.
# Modify the following two wget's as desired
# Note that there are repeated cases of filenames that have
# to changed I really should make those a variable that
# we define that the top/start
#
# Go to kernel.org and busybox.net to identify their latest
# point releases/stable versions.
#
# Kernel 4.19 LTS has Dec 2025 current date shown as of Sept 2020
# 1.31.1 is the most recent 'stable' busybox
wget http://kernel.org/pub/linux/kernel/v4.x/linux-4.19.149.tar.xz
wget http://busybox.net/downloads/busybox-1.31.1.tar.bz2
mkdir bootfiles
tar -xvf linux-4.19.149.tar.xz
tar -xvf busybox-1.31.1.tar.bz2
cd busybox-1.31.1
make distclean defconfig
sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config
make busybox install
cd _install
rm -f linuxrc
# Need to open initrd and drop in the busybox file
# Not the cleanest way to do it, but it works.
cd ../..
mkdir extracted
cd extracted
cat ../initrd | cpio -id
cd bin
cp ../../busybox-1.31.1/busybox .
cd ..
find . | cpio -o -H newc > ../initrd
cd ..
rm -rf extracted
cd linux-4.19.149
cp ../.config .
cp ../initrd usr/.
N=`nproc`
N=`expr $N + 1`
echo ******************************************
echo ******************************************
echo ******************************************
echo You may get interactive prompts now that
echo require answering, more often just pressing
echo enter will do (i.e. accept the defaults)
echo ******************************************
echo ******************************************
echo ******************************************
echo
echo About to compile the kernel - press Enter when ready
read n
make oldconfig
make localyesconfig
make -j$N
cp arch/x86/boot/bzImage ../bootfiles/vmlinuz