From 319ca03a33f9ec728ea87349ebd627ba02aab56f Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 17 Jan 2022 22:43:31 +0000 Subject: added linux and system configs --- repo/linux/linux.xibuild | 46 ++++++++++ repo/meta/base.xibuild | 3 +- repo/meta/systemconfigs.xibuild | 195 ++++++++++++++++++++++++++++++++++++++++ repo/system/bootscripts.xibuild | 31 +++++++ repo/util/bash.xibuild | 3 + 5 files changed, 276 insertions(+), 2 deletions(-) create mode 100644 repo/linux/linux.xibuild create mode 100644 repo/meta/systemconfigs.xibuild diff --git a/repo/linux/linux.xibuild b/repo/linux/linux.xibuild new file mode 100644 index 0000000..f84e95a --- /dev/null +++ b/repo/linux/linux.xibuild @@ -0,0 +1,46 @@ +#!/bin/bash + +DEPS=() + +PKG_VER=5.15.14 +SOURCE=https://cdn.kernel.org/pub/linux/kernel/v$(echo $PKG_VER | cut -d. -f1).x/linux-$PKG_VER.tar.xz + +prepare () { + curl https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/linux/trunk/config > .config + + make olddefconfig + make -s kernelrelease > version + echo "Prepared linux version $( $PKG_DEST/etc/modprobe.d/usb.conf << "EOF" +# Begin /etc/modprobe.d/usb.conf + +install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true +install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true + +# End /etc/modprobe.d/usb.conf +EOF + +} + diff --git a/repo/meta/base.xibuild b/repo/meta/base.xibuild index 5a0dcea..454c776 100644 --- a/repo/meta/base.xibuild +++ b/repo/meta/base.xibuild @@ -1,5 +1,4 @@ #!/bin/bash -DEPS=(acl attr binutils brotli bzip2 cacerts coreutils eudev expat findutils gc gdbm gettext glibc gmp gnutls gperf grub guile gzip iana-etc intltool kbd kmod krb5 libcap-ng libcap libffi libiconv libidn libldap libnghttp libp11-kit libpipeline libpsl libsasl libseccomp libsigsegv libtasn1 libtool libunistring libxcrypt libxml2 libxslt lz4 lzo mpfr ncurses nettle nspr openssl pam pcre perl perl-xml-parser psmisc python-requests python readline rtmpdump sed shadow sysklogd sysvinit tar tcl xxhash xz zip zlib zstd linux-headers xipkg) +DEPS=(acl attr binutils brotli bzip2 cacerts coreutils eudev expat findutils gc gdbm gettext glibc gmp gnutls gperf grub guile gzip iana-etc intltool kbd kmod krb5 libcap-ng libcap libffi libiconv libidn libldap libnghttp libp11-kit libpipeline libpsl libsasl libseccomp libsigsegv libtasn1 libtool libunistring libxcrypt libxml2 libxslt lz4 lzo mpfr ncurses nettle nspr openssl pam pcre perl perl-xml-parser psmisc python-requests python readline rtmpdump sed shadow sysklogd sysvinit tar tcl xxhash xz zip zlib zstd linux-headers xipkg bootscripts systemconfigs) DESC="The base system to be installed" - diff --git a/repo/meta/systemconfigs.xibuild b/repo/meta/systemconfigs.xibuild new file mode 100644 index 0000000..243bc61 --- /dev/null +++ b/repo/meta/systemconfigs.xibuild @@ -0,0 +1,195 @@ +#!/bin/bash + +DEPS=(bootscripts sh) + +PKG_VER=N/A + +DESC="Default system configs for xilinux" + +package () { + + cat > $PKG_DEST/etc/sysconfig/rc.site << "EOF" +# rc.site + +# Distro Information +DISTRO="xilinux" # The distro name +DISTRO_CONTACT="xi@davidovski.xyz" # Bug report address +DISTRO_MINI="xi" # Short name used in filenames for distro config + +# Define custom colors used in messages printed to the screen + +# Please consult `man console_codes` for more information +# under the "ECMA-48 Set Graphics Rendition" section +# +# Warning: when switching from a 8bit to a 9bit font, +# the linux console will reinterpret the bold (1;) to +# the top 256 glyphs of the 9bit font. This does +# not affect framebuffer consoles + +BRACKET="\\033[1;34m" # Blue +FAILURE="\\033[1;31m" # Red +INFO="\\033[1;36m" # Cyan +NORMAL="\\033[0;39m" # Grey +SUCCESS="\\033[1;32m" # Green +WARNING="\\033[1;33m" # Yellow + +# Use a colored prefix +BMPREFIX=" " +SUCCESS_PREFIX="${SUCCESS} * ${NORMAL} " +FAILURE_PREFIX="${FAILURE}*****${NORMAL} " +WARNING_PREFIX="${WARNING} *** ${NORMAL} " + +# Manually seet the right edge of message output (characters) +# Useful when resetting console font during boot to override +# automatic screen width detection +#COLUMNS=120 + +# Interactive startup +#IPROMPT="yes" # Whether to display the interactive boot prompt +#itime="3" # The amount of time (in seconds) to display the prompt + +# The total length of the distro welcome string, without escape codes +wlen=$(echo "Welcome to ${DISTRO}" | wc -c ) +welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}" + +# The total length of the interactive string, without escape codes +#ilen=$(echo "Press 'I' to enter interactive startup" | wc -c ) +#i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup" + +# Set scripts to skip the file system check on reboot +#FASTBOOT=yes + +# Skip reading from the console +#HEADLESS=yes + +# Write out fsck progress if yes +#VERBOSE_FSCK=no + +# Speed up boot without waiting for settle in udev +#OMIT_UDEV_SETTLE=y + +# Speed up boot without waiting for settle in udev_retry +#OMIT_UDEV_RETRY_SETTLE=yes + +# Skip cleaning /tmp if yes +#SKIPTMPCLEAN=no + +# For setclock +UTC=1 +#CLOCKPARAMS= + +# For consolelog (Note that the default, 7=debug, is noisy) +#LOGLEVEL=7 + +# For network +HOSTNAME=xi + +# Delay between TERM and KILL signals at shutdown +#KILLDELAY=3 + +# Optional sysklogd parameters +SYSKLOGD_PARMS="-m 0" + +# Console parameters +UNICODE=1 +KEYMAP="de-latin1" +KEYMAP_CORRECTIONS="euro2" +FONT="lat0-16 -m 8859-15" +#LEGACY_CHARSET= +EOF + + + cat > $PKG_DEST/etc/profile << "EOF" + +umask 022 + +PS1="\u@\h \w $ " +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/.local/bin + +export PATH +export PS1 + +# Termcap is outdated, old, and crusty, kill it. +unset TERMCAP + +# Man is much better than us at figuring this out +unset MANPATH +export QT_QPA_PLATFORMTHEME=qt5ct +EOF + + cat > $PKG_DEST/etc/inputrc << "EOF" +# Begin /etc/inputrc +# Modified by Chris Lynn + +# Allow the command prompt to wrap to the next line +set horizontal-scroll-mode Off + +# Enable 8bit input +set meta-flag On +set input-meta On + +# Turns off 8th bit stripping +set convert-meta Off + +# Keep the 8th bit for display +set output-meta On + +# none, visible or audible +set bell-style none + +# All of the following map the escape sequence of the value +# contained in the 1st argument to the readline specific functions +"\eOd": backward-word +"\eOc": forward-word + +# for linux console +"\e[1~": beginning-of-line +"\e[4~": end-of-line +"\e[5~": beginning-of-history +"\e[6~": end-of-history +"\e[3~": delete-char +"\e[2~": quoted-insert + +# for xterm +"\eOH": beginning-of-line +"\eOF": end-of-line + +# for Konsole +"\e[H": beginning-of-line +"\e[F": end-of-line + +# End /etc/inputrc +EOF + cat > $PKG_DEST/etc/shells << "EOF" + /bin/sh +EOF + + cat > $PKG_DEST/etc/lsb-release << "EOF" +LSB_VERSION=1.4 +DISTRIB_ID="xilinux" +DISTRIB_RELEASE=rolling +DISTRIB_DESCRIPTION="Xi Linux" +EOF + + cat > $PKG_DEST/etc/os-release << "EOF" +LSB_VERSION=1.4 +DISTRIB_ID=xi +DISTRIB_RELEASE=rolling +DISTRIB_DESCRIPTION="XiLinux" +EOF + cat > $PKG_DEST/etc/lsb-release << "EOF" +NAME="xilinux" +PRETTY_NAME="XiLinux" +ID=xi +BUILD_ID=rolling +ANSI_COLOR="38;2;23;147;209" +HOME_URL="https://xi.davidovski.xyz" +DOCUMENTATION_URL="https://xi.davidovski.xyz" +SUPPORT_URL="https://xi.davidovski.xyz" +BUG_REPORT_URL="https://xi.davidovski.xyz" +LOGO=xilinux-logo + +EOF + + +} diff --git a/repo/system/bootscripts.xibuild b/repo/system/bootscripts.xibuild index a6a716a..112c7ac 100644 --- a/repo/system/bootscripts.xibuild +++ b/repo/system/bootscripts.xibuild @@ -8,4 +8,35 @@ DESC="Bootscripts to initiate the system on boot (from lfs)" package () { make DESTDIR=$PKG_DEST install + + cat > $PKG_DEST/etc/inittab << "EOF" +# Begin /etc/inittab + +id:3:initdefault: + +si::sysinit:/etc/rc.d/init.d/rc S + +l0:0:wait:/etc/rc.d/init.d/rc 0 +l1:S1:wait:/etc/rc.d/init.d/rc 1 +l2:2:wait:/etc/rc.d/init.d/rc 2 +l3:3:wait:/etc/rc.d/init.d/rc 3 +l4:4:wait:/etc/rc.d/init.d/rc 4 +l5:5:wait:/etc/rc.d/init.d/rc 5 +l6:6:wait:/etc/rc.d/init.d/rc 6 + +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +su:S016:once:/sbin/sulogin + +1:2345:respawn:/sbin/agetty --noclear tty1 9600 +2:2345:respawn:/sbin/agetty tty2 9600 +3:2345:respawn:/sbin/agetty tty3 9600 +4:2345:respawn:/sbin/agetty tty4 9600 +5:2345:respawn:/sbin/agetty tty5 9600 +6:2345:respawn:/sbin/agetty tty6 9600 + +# End /etc/inittab +EOF + + } diff --git a/repo/util/bash.xibuild b/repo/util/bash.xibuild index 81fec13..0288b77 100644 --- a/repo/util/bash.xibuild +++ b/repo/util/bash.xibuild @@ -15,3 +15,6 @@ package () { ln $PKG_DEST/usr/bin/bash $PKG_DEST/usr/bin/sh } +postinstall () { + echo "/bin/bash" >> /etc/shells +} -- cgit v1.2.1