diff --git a/.gitignore b/.gitignore index e24f4b8c0..ed7cabe93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ tmp.* PrawnOS-Shiba-* -PrawnOS-initramfs.cpio.gz +PrawnOS-initramfs.cpio build +kernel/sources/linux-*.tar.gz +*.dsc diff --git a/README.md b/README.md index 9b9f2c3d3..e529ad61f 100644 --- a/README.md +++ b/README.md @@ -271,7 +271,7 @@ To begin with: `make filesystem` builds the -BASE filesystem image with no kernel -`make initramfs` builds the PrawnOS-initramfs.cpio.gz, which can be found in /build +`make initramfs` builds the PrawnOS-initramfs.cpio, which can be found in /build `make image` builds the initramfs image, builds the kernel, builds the filesystem if a -BASE image doesn't exist, and combines the two into a new PrawnOS.img using kernel_install diff --git a/filesystem/resources/PrawnOS-1280x800 b/filesystem/resources/PrawnOS-1280x800 new file mode 100644 index 000000000..976f1bb61 Binary files /dev/null and b/filesystem/resources/PrawnOS-1280x800 differ diff --git a/filesystem/resources/PrawnOS-1366x768 b/filesystem/resources/PrawnOS-1366x768 new file mode 100644 index 000000000..5960627fc Binary files /dev/null and b/filesystem/resources/PrawnOS-1366x768 differ diff --git a/filesystem/resources/splash-recover-cursor.issue b/filesystem/resources/splash-recover-cursor.issue new file mode 100644 index 000000000..85a43ed9d --- /dev/null +++ b/filesystem/resources/splash-recover-cursor.issue @@ -0,0 +1 @@ +[?25h[?0c diff --git a/filesystem/resources/system.conf b/filesystem/resources/system.conf new file mode 100644 index 000000000..25444be4b --- /dev/null +++ b/filesystem/resources/system.conf @@ -0,0 +1,71 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# Entries in this file show the compile time defaults. +# You can change settings by editing this file. +# Defaults can be restored by simply deleting this file. +# +# See systemd-system.conf(5) for details. + +[Manager] +#LogLevel=info +#LogTarget=journal-or-kmsg +#LogColor=yes +#LogLocation=no +#LogTime=no +#DumpCore=yes +ShowStatus=no +#CrashChangeVT=no +#CrashShell=no +#CrashReboot=no +#CtrlAltDelBurstAction=reboot-force +#CPUAffinity=1 2 +#NUMAPolicy=default +#NUMAMask= +#RuntimeWatchdogSec=0 +#RebootWatchdogSec=10min +#ShutdownWatchdogSec=10min +#KExecWatchdogSec=0 +#WatchdogDevice= +#CapabilityBoundingSet= +#NoNewPrivileges=no +#SystemCallArchitectures= +#TimerSlackNSec= +#StatusUnitFormat=description +#DefaultTimerAccuracySec=1min +#DefaultStandardOutput=journal +#DefaultStandardError=inherit +#DefaultTimeoutStartSec=90s +#DefaultTimeoutStopSec=90s +#DefaultTimeoutAbortSec= +#DefaultRestartSec=100ms +#DefaultStartLimitIntervalSec=10s +#DefaultStartLimitBurst=5 +#DefaultEnvironment= +#DefaultCPUAccounting=no +#DefaultIOAccounting=no +#DefaultIPAccounting=no +#DefaultBlockIOAccounting=no +#DefaultMemoryAccounting=yes +#DefaultTasksAccounting=yes +#DefaultTasksMax= +#DefaultLimitCPU= +#DefaultLimitFSIZE= +#DefaultLimitDATA= +#DefaultLimitSTACK= +#DefaultLimitCORE= +#DefaultLimitRSS= +#DefaultLimitNOFILE=1024:524288 +#DefaultLimitAS= +#DefaultLimitNPROC= +#DefaultLimitMEMLOCK= +#DefaultLimitLOCKS= +#DefaultLimitSIGPENDING= +#DefaultLimitMSGQUEUE= +#DefaultLimitNICE= +#DefaultLimitRTPRIO= +#DefaultLimitRTTIME= diff --git a/initramfs/resources/initramfs-init b/initramfs/resources/initramfs-init index 60153c43e..44492f03b 100644 --- a/initramfs/resources/initramfs-init +++ b/initramfs/resources/initramfs-init @@ -17,12 +17,11 @@ # You should have received a copy of the GNU General Public License # along with PrawnOS. If not, see . -echo In PrawnOS Init #add this to start shell at desired point rescue_shell() { - [ "{$1}" != "debug" ] && echo "Something went wrong. Dropping to a shell." > /dev/tty1 [ "{$1}" == "debug" ] && echo "Debug flag detected, entering debug shell" > /dev/tty1 + dmesg -n 4 echo "Something went wrong. Dropping to a shell." > /dev/tty1 exec setsid /bin/sh -c 'exec /bin/sh /dev/tty1 2>&1' } @@ -66,14 +65,26 @@ mount -n -t devtmpfs devtmpfs /dev # get the root device, so we can find the boot partiton UNPARSED=$(cmdline root) ROOT_PARTUUID=$(rootpartuuid $UNPARSED) -echo ${ROOT_PARTUUID} > /dev/tty1 BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID ) -echo ${BLKID} > /dev/tty1 #If its an mmcblk device, the kernel partiton will p1. If it is a usb device, the partiton will just be 1 #Just want everything before the 1 ROOT_DEV="${BLKID%1:*}" -echo ${ROOT_DEV} > /dev/tty1 + +# happens when kernel takes its time looking for devices +if [ -z ${ROOT_DEV} ] +then + sleep 1 + # get the root device, so we can find the boot partiton + UNPARSED=$(cmdline root) + ROOT_PARTUUID=$(rootpartuuid $UNPARSED) + BLKID=$(/sbin/blkid | grep $ROOT_PARTUUID ) + #If its an mmcblk device, the kernel partiton will p1. If it is a usb device, the partiton will just be 1 + ROOT_DEV="${BLKID%1:*}" + # if device is still not seen, bail out + [ -z ${ROOT_DEV} ] && rescue_shell +fi + # label any partition on the system with RESCUESHELL to enter the initramfs rescue shell before mount and root_switch. # you can do this with "cgpt add -i 1 -l RESCUESHELL /dev/sda" for example to label the first partiton of a usb drive. @@ -89,7 +100,6 @@ then dmesg -n 2 echo "Opening encrypted root partition, this will take 30s..." cryptsetup --tries 5 luksOpen ${ROOT_DEV}2 luksroot || rescue_shell - dmesg -n 7 mount /dev/mapper/luksroot /newroot else # mount the unencrypted root filesystem @@ -97,6 +107,10 @@ else mount ${ROOT_DEV}2 /newroot fi +dmesg -n 1 +echo -e '\033[?17;0;0c' > /dev/tty1 # magically make cursor disappear +dd status=none if=/newroot/PrawnOS-$(cat /sys/class/graphics/fb0/virtual_size | tr ',' 'x') of=/dev/fb0 # write splash to framebuffer + umount /sys umount /proc diff --git a/kernel/resources/arm64/config b/kernel/resources/arm64/config index 65d393470..13814c739 100644 --- a/kernel/resources/arm64/config +++ b/kernel/resources/arm64/config @@ -161,17 +161,17 @@ CONFIG_SCHED_AUTOGROUP=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio.gz" +CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio" CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0 -CONFIG_RD_GZIP=y +# CONFIG_RD_GZIP is not set # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION_GZIP=y -# CONFIG_INITRAMFS_COMPRESSION_NONE is not set +# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set +CONFIG_INITRAMFS_COMPRESSION_NONE=y CONFIG_BOOT_CONFIG=y # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -7315,7 +7315,7 @@ CONFIG_SBITMAP=y # CONFIG_PRINTK_TIME=y # CONFIG_PRINTK_CALLER is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=2 CONFIG_CONSOLE_LOGLEVEL_QUIET=4 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_BOOT_PRINTK_DELAY is not set diff --git a/kernel/resources/armhf/config b/kernel/resources/armhf/config index d1b7ca17f..9b17fcb35 100644 --- a/kernel/resources/armhf/config +++ b/kernel/resources/armhf/config @@ -158,16 +158,16 @@ CONFIG_NET_NS=y # CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio.gz" +CONFIG_INITRAMFS_SOURCE="PrawnOS-initramfs.cpio" CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_ROOT_GID=0 CONFIG_RD_GZIP=y # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set -CONFIG_RD_XZ=y +# CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set -CONFIG_INITRAMFS_COMPRESSION=".gz" +CONFIG_INITRAMFS_COMPRESSION="" # CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y @@ -5275,7 +5275,6 @@ CONFIG_SECURITYFS=y CONFIG_SECURITY_NETWORK=y # CONFIG_SECURITY_NETWORK_XFRM is not set CONFIG_SECURITY_PATH=y -CONFIG_LSM_MMAP_MIN_ADDR=32768 CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y CONFIG_HARDENED_USERCOPY=y CONFIG_HARDENED_USERCOPY_FALLBACK=y @@ -5302,8 +5301,7 @@ CONFIG_INTEGRITY=y CONFIG_INTEGRITY_AUDIT=y # CONFIG_IMA is not set # CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_DAC is not set +CONFIG_DEFAULT_SECURITY_DAC=y CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" # @@ -5589,7 +5587,7 @@ CONFIG_SBITMAP=y # CONFIG_PRINTK_TIME=y # CONFIG_PRINTK_CALLER is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=1 CONFIG_CONSOLE_LOGLEVEL_QUIET=4 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 # CONFIG_BOOT_PRINTK_DELAY is not set diff --git a/scripts/BuildScripts/BuildCommon.mk b/scripts/BuildScripts/BuildCommon.mk index 613405e1a..226e1754c 100644 --- a/scripts/BuildScripts/BuildCommon.mk +++ b/scripts/BuildScripts/BuildCommon.mk @@ -165,7 +165,7 @@ PRAWNOS_KERNEL_PACKAGE_IMAGE := $(PRAWNOS_KERNEL_PACKAGES)/prawnos-linux-image-$ PRAWNOS_KERNEL_PACKAGE_HEADERS := $(PRAWNOS_KERNEL_PACKAGES)/prawnos-linux-headers-$(TARGET) ### INITRAMFS -PRAWNOS_INITRAMFS_IMAGE := $(PRAWNOS_BUILD)/PrawnOS-initramfs.cpio.gz +PRAWNOS_INITRAMFS_IMAGE := $(PRAWNOS_BUILD)/PrawnOS-initramfs.cpio ### ATH9K PRAWNOS_ATH9K_BUILD := $(PRAWNOS_BUILD_SHARED)/open-ath9k-htc-firmware diff --git a/scripts/BuildScripts/FilesystemScripts/buildFilesystem.sh b/scripts/BuildScripts/FilesystemScripts/buildFilesystem.sh index fa8c8032c..d52ecdf64 100755 --- a/scripts/BuildScripts/FilesystemScripts/buildFilesystem.sh +++ b/scripts/BuildScripts/FilesystemScripts/buildFilesystem.sh @@ -246,6 +246,13 @@ cp $build_resources_apt/deb.prawnos.com.gpg.key $outmnt/InstallResources/ chroot $outmnt apt-key add /InstallResources/deb.prawnos.com.gpg.key chroot $outmnt apt update +#Copy splash screen +cp $build_resources/PrawnOS-* $outmnt/ + +#Copy /etc/issue +mkdir -p $outmnt/etc/issue.d/ +cp $build_resources/splash-recover-cursor.issue $outmnt/etc/issue.d/splash-recover-cursor.issue + #Setup the locale cp $build_resources/locale.gen $outmnt/etc/locale.gen chroot $outmnt locale-gen @@ -314,6 +321,24 @@ echo -n "127.0.0.1 PrawnOS" > $outmnt/etc/hosts #Cleanup apt retry chroot $outmnt rm -f /etc/apt/apt.conf.d/80-retries +#Copy systemd config. This is on the end to make sure that no package overrides this +cp $build_resources/system.conf $outmnt/etc/systemd/ + +#install hwdb file for iio-sensor-proxy to work +printf 'sensor:modalias:platform:*\n ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1\n' > $outmnt/etc/udev/hwdb.d/61-sensor-local.hwdb +chroot $outmnt systemd-hwdb update + +#make bootsplash not disappear again +chroot $outmnt systemctl mask plymouth-start +chroot $outmnt dpkg-reconfigure -f noninteractive console-setup +grep -v setfont $outmnt/etc/console-setup/cached_setup_font.sh > /tmp/cached_setup_font.sh +cp /tmp/cached_setup_font.sh $outmnt/etc/console-setup/cached_setup_font.sh + +mkdir -p $outmnt/opt/git/ +cd $outmnt/opt/git/ +rm -rf $outmnt/opt/git/c100pa-daemon +git clone https://github.com/Maccraft123/c100pa-daemon.git $outmnt/opt/git/c100pa-daemon + # do a non-error cleanup umount -l $outmnt > /dev/null 2>&1 rmdir $outmnt > /dev/null 2>&1 diff --git a/scripts/BuildScripts/InitramfsScripts/buildInitramFs.sh b/scripts/BuildScripts/InitramfsScripts/buildInitramFs.sh index 1933a1506..ed6fb211a 100755 --- a/scripts/BuildScripts/InitramfsScripts/buildInitramFs.sh +++ b/scripts/BuildScripts/InitramfsScripts/buildInitramFs.sh @@ -165,7 +165,7 @@ chmod +x $initramfs_src/init cp $initramfs_src/init $initramfs_src/sbin/init #compress and install -rm -rf $outmnt/boot/PrawnOS-initramfs.cpio.gz +rm -rf $outmnt/boot/PrawnOS-initramfs.cpio cd $initramfs_src ln -s busybox bin/cat ln -s busybox bin/mount @@ -173,6 +173,5 @@ ln -s busybox bin/sh ln -s busybox bin/switch_root ln -s busybox bin/umount -# store for kernel building -find . -print0 | cpio --null --create --verbose --format=newc | gzip --best > $OUT_DIR/PrawnOS-initramfs.cpio.gz - +# store for kernel building. gzip is not needed becase kernel + initramfs are gzipped together +find . -print0 | cpio --null --create --verbose --format=newc > $OUT_DIR/PrawnOS-initramfs.cpio diff --git a/scripts/InstallScripts/InstallPackages.sh b/scripts/InstallScripts/InstallPackages.sh index 2c4571a88..f0d611569 100755 --- a/scripts/InstallScripts/InstallPackages.sh +++ b/scripts/InstallScripts/InstallPackages.sh @@ -240,6 +240,25 @@ do done done +#install hwdb file for iio-sensor-proxy to work +printf 'sensor:modalias:platform:*\n ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1\n' > /etc/udev/hwdb.d/61-sensor-local.hwdb +systemd-hwdb update +udevadm trigger + +#make bootsplash not disappear again +systemctl mask plymouth-start +dpkg-reconfigure -f noninteractive console-setup +grep -v setfont /etc/console-setup/cached_setup_font.sh > /tmp/cached_setup_font.sh +cp /tmp/cached_setup_font.sh /etc/console-setup/cached_setup_font.sh + +#daemon for disabling touchpad and keyboard +mkdir -p /opt/git +cd /opt/git/ +cd c100pa-daemon +make +make install +systemctl enable c100pa-daemon + usermod -a -G sudo,netdev,input,video,bluetooth $username dmesg -E