1
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev bc git gcc-aarch64-linux-gnu python
Create some directories for use later :mkdir cosmo_android
cd cosmo_android
mkdir KERNEL_OUT
git clone https://github.com/osm0sis/mkbootimg
cd mkbooting
nano mkbootimg.c
Find the following lines and change them to these offsets :uint32_t kernel_offset = 0xEC080100U;
uint32_t ramdisk_offset = 0x01000100U;
uint32_t second_offset = 0xECF00100U;
save and run make
cd ..
mkdir Packing && cd Packing
Get the PC v23 Custom installer and place the root-boot.img in this directory and unpack the image :../mkbootimg/unpackbootimg -i root-boot.img -o .
cd ..
git clone https://github.com/deadman96385/android_kernel_planet_mt6771.git
cd into it and import the latest configcd android_kernel_planet_mt6771
make O=../KERNEL_OUT ARCH=arm64 k71v1_64_bsp_defconfig
nano Makefile
Find this line and add -w to it :KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
so it looks like KBUILD_CFLAGS := -w -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
nano kernel/module.c
flags |= MODULE_INIT_IGNORE_MODVERSIONS;
flags |= MODULE_INIT_IGNORE_VERMAGIC;
static int load_module(struct load_info *info, const char __user *uargs,
int flags)
{
struct module *mod;
long err;
char *after_dashes;
flags |= MODULE_INIT_IGNORE_MODVERSIONS;
flags |= MODULE_INIT_IGNORE_VERMAGIC;
err = module_sig_check(info, flags);
if (err)
goto free_copy;
.... etc ....
nano ../KERNEL_OUT/.config
Search (CTRL+W) for # CONFIG_MODULE_FORCE_LOAD is not set
and change it so it reads:CONFIG_MODULE_FORCE_LOAD=y
make O=../KERNEL_OUT ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
cd ../Packing
cp ../KERNEL_OUT/arch/arm64/boot/Image.gz-dtb .
../mkbootimg/mkbootimg --kernel Image.gz-dtb --ramdisk root-boot.img-ramdisk.gz --base 0x53ffff00 --cmdline 'bootopt=64S3,32N2,64N2 buildvariant=user veritykeyid=id:7e4333f9bba00adfe0ede979e28ed1920492b40f' -o drbytes.img
echo "DrBytes Kernel,$MBF/Cosmo_Installer_DrBytes_Kernel.sh" >> $INSTALLER_FILE
#!/system/bin/sh
PARTED="/sbin/parted_static"
DD="/system/bin/dd"
MBF="/sdcard/cosmo-customos-installer"
BOOT_PARTITION="/dev/block/mmcblk0p"
LINUX_ROOTFS="/dev/block/mmcblk0p43"
OUTPUT="/tmp/output.txt"
ERROR="/tmp/error.txt"
echo "Installing DrBytes Kernel..." > $OUTPUT
log () {
echo -n "$1 " >> $OUTPUT
}
execute() {
log "Running \"$1\""
R=$($1 2> $ERROR)
if [ "$?" -eq "0" ]
then
log "OK\n"
else
log "ERROR: `cat /tmp/error`\n"
fi
}
# Installing boot image into user-selected boot partition
execute "$DD if=$MBF/drbytes.img of=$BOOT_PARTITION$1 bs=1m"
# Rename partition to specific OS
execute "$PARTED /dev/block/mmcblk0 name $1 DrBytes_Kernel"
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev bc git gcc-aarch64-linux-gnu
mkdir cosmo
cd cosmo
mkdir KERNEL_OUT
git clone https://github.com/gemian/cosmo-linux-kernel-4.4.git
cd cosmo-linux-kernel-4.4/
nano Makefile
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
to KBUILD_CFLAGS := -w -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
make O=../KERNEL_OUT ARCH=arm64 k71v1_64_bsp_defconfig
Configure your kernel and save to the default .config locationmake O=../KERNEL_OUT ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
build itmake O=../KERNEL_OUT ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev bc git
mkdir cosmo
cd cosmo
mkdir KERNEL_OUT
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b nougat-release --depth 1
This is the cosmo kernel used in the 24/07 buildgit clone https://github.com/gemian/cosmo-linux-kernel-4.4.git
cd cosmo-linux-kernel-4.4/
nano Makefile
--> Find "KBUILD_CFLAGS" and change the line KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
to KBUILD_CFLAGS := -w -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
make O=../KERNEL_OUT ARCH=arm64 k71v1_64_bsp_defconfig
Configure your kernel and save to the default .config locationmake O=../KERNEL_OUT ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
build itmake O=../KERNEL_OUT ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
drbytes@cosmopda:~$ ls /dev/ttyU*
/dev/ttyUSB0
drbytes@cosmopda:~$
Jul 26 23:03:04 cosmopda kernel: [ 1445.533536] (1)[9259:kworker/1:1]usb 1-1: cp210x converter now attached to ttyUSB0
drbytes@cosmopda:~$ sudo picocom -b 9600 /dev/ttyUSB0
sudo: unable to resolve host cosmopda: Name or service not known
picocom v3.1
port is : /dev/ttyUSB0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
Type [C-a] [C-h] to see available commands
Terminal ready
Hi. I'm a nodemcu running the Garage Door code
Current state: Closed. MQTT: GarageESP/Door/Status
MQTT: Publish to GarageESP/Door/Status -> OK
Message will repeat in 5000.
Hi. I'm a nodemcu running the Garage Door code
Current state: Closed. MQTT: GarageESP/Door/Status
MQTT: Publish to GarageESP/Door/Status -> OK
Message will repeat in 5000.
root@cosmopda:~# cat /var/log/messages | grep ftdi
Jul 26 22:05:29 cosmopda kernel: [ 4011.761624] (1)[18323:modprobe]usbcore: registered new interface driver ftdi_sio
build trng...
LD drivers/misc/mediatek/built-in.o
LD drivers/misc/built-in.o
CC [M] drivers/usb/serial/cp210x.o
LD drivers/built-in.o
LINK vmlinux
LD vmlinux.o
sudo apt-get install build-essential libncurses-dev bison flex libssl-dev libelf-dev git bc
mkdir cosmo
cd cosmo/
git clone https://github.com/gemian/cosmo-linux-kernel-4.4.git
mkdir KERNEL_OUT
cat /proc/config.gz | gunzip > KERNEL_OUT/.config
make O=../KERNEL_OUT -C cosmo-linux-kernel-4.4 menuconfig -j8
make O=../KERNEL_OUT -C cosmo-linux-kernel-4.4 -j8
CC arch/arm64/kvm/guest.o
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/fs/exec.c: In function 'get_task_comm':
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/fs/exec.c:1086:32: error: argument to 'sizeof' in 'strncpy' call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(buf, tsk->comm, sizeof(tsk->comm));
In file included from /home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/linux/sctp.h:57,
from /home/drbytes/cosmo/cosmo-linux-kernel-4.4/security/lsm_audit.c:31:
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:306:1: error: alignment 4 of 'struct sctp_paddr_change' is less than 8 [-Werror=packed-not-aligned]
} __attribute__((packed, aligned(4)));
^
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:580:1: error: alignment 4 of 'struct sctp_setpeerprim' is less than 8 [-Werror=packed-not-aligned]
} __attribute__((packed, aligned(4)));
^
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:579:26: error: 'sspp_addr' offset 4 in 'struct sctp_setpeerprim' isn't aligned to 8 [-Werror=packed-not-aligned]
struct sockaddr_storage sspp_addr;
^~~~~~~~~
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:593:1: error: alignment 4 of 'struct sctp_prim' is less than 8 [-Werror=packed-not-aligned]
} __attribute__((packed, aligned(4)));
^
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:592:26: error: 'ssp_addr' offset 4 in 'struct sctp_prim' isn't aligned to 8 [-Werror=packed-not-aligned]
struct sockaddr_storage ssp_addr;
^~~~~~~~
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:640:1: error: alignment 4 of 'struct sctp_paddrparams' is less than 8 [-Werror=packed-not-aligned]
} __attribute__((packed, aligned(4)));
^
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:634:26: error: 'spp_address' offset 4 in 'struct sctp_paddrparams' isn't aligned to 8 [-Werror=packed-not-aligned]
struct sockaddr_storage spp_address;
^~~~~~~~~~~
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:747:1: error: alignment 4 of 'struct sctp_paddrinfo' is less than 8 [-Werror=packed-not-aligned]
} __attribute__((packed, aligned(4)));
^
/home/drbytes/cosmo/cosmo-linux-kernel-4.4/include/uapi/linux/sctp.h:741:26: error: 'spinfo_address' offset 4 in 'struct sctp_paddrinfo' isn't aligned to 8 [-Werror=packed-not-aligned]
struct sockaddr_storage spinfo_address;
^~~~~~~~~~~~~~
CC security/selinux/nlmsgtab.o
CC security/selinux/netif.o
cc1: all warnings being treated as errors