mirror of
https://github.com/kevadesu/TylkoLinux.git
synced 2025-03-09 16:51:57 +01:00
While this is not yet usable, this is something at least
This commit is contained in:
parent
27ffdc3633
commit
5026f118e8
3 changed files with 666 additions and 21 deletions
|
@ -9,10 +9,22 @@ EINRICHTER_VER=0.1.0
|
|||
|
||||
function main() {
|
||||
einrichter.colours
|
||||
einrichter.installer.pkgs
|
||||
einrichter.installer.DirLayout
|
||||
einrichter.installer.SafeUser
|
||||
einrichter.installer.SafeUser.end
|
||||
echo "Einrichter - TylkoLinux Installer Shell $EINRICHTER_VER
|
||||
The script is located at $SCRIPT_DIR
|
||||
Run einrichter.help for commands"
|
||||
read -p "einrichter>" Command_Input
|
||||
$Command_Input
|
||||
main
|
||||
}
|
||||
|
||||
einrichter.help() {
|
||||
echo "Einrichter commands:
|
||||
einrichter.installer.pkgs - Prepare packages for installation
|
||||
einrichter.installer.DirLayout - Set up the directories at the target system
|
||||
einrichter.installer.SafeUser - Set up LFS user on host and starting package compilation
|
||||
einrichter.installer.chroot - Enter the environment using chroot
|
||||
einrichter.help - Show this help dialog
|
||||
For more information, see https://github.com/kevadesu/TylkoLinux"
|
||||
}
|
||||
|
||||
function einrichter.colours() {
|
||||
|
@ -88,7 +100,7 @@ function einrichter.colours() {
|
|||
On_IPurple='\033[0;105m' # Purple
|
||||
On_ICyan='\033[0;106m' # Cyan
|
||||
On_IWhite='\033[0;107m' # White
|
||||
|
||||
echo "[i] The colour variables have been set."
|
||||
}
|
||||
|
||||
function einrichter.installer.pkgs() {
|
||||
|
@ -117,6 +129,7 @@ function einrichter.installer.pkgs() {
|
|||
}
|
||||
einrichter.installer.pkgs.verify.patches || einrichter.installer.fail
|
||||
popd
|
||||
echo -e "[i] Finished section installer.pkgs"
|
||||
}
|
||||
|
||||
function einrichter.installer.DirLayout() {
|
||||
|
@ -166,6 +179,12 @@ function einrichter.installer.SafeUser() {
|
|||
echo -e "${BBlue}[i] ${Blue}Attempting login as lfs...${Color_Off}"
|
||||
echo -e "${BBlue}[i] ${Blue}You are about to switch to the LFS user. When you log in, run the Einrichter-as-LFS.sh script located in your home directory by typing \"./Einrichter-as-LFS.sh\".${Color_Off}"
|
||||
su - lfs
|
||||
einrichter.installer.SafeUser.End
|
||||
}
|
||||
|
||||
function einrichter.installer.SafeUser.End() {
|
||||
echo -e "${BBlue}[i] ${Blue}Completed!${Color_Off}"
|
||||
echo -e "[i] Finished section installer.SafeUser"
|
||||
}
|
||||
|
||||
function einrichter.installer.chroot() {
|
||||
|
@ -177,16 +196,68 @@ function einrichter.installer.chroot() {
|
|||
cp $SCRIPT_DIR/Einrichter-in-chroot.sh $LFS/
|
||||
echo -e "${BBlue}[i] ${Blue}Making the installer executable...${Color_Off}"
|
||||
chmod +x $LFS/Einrichter-in-chroot.sh
|
||||
echo -e "${BBlue}[i] ${Blue}Preparing the Virtual Kernel File Systems...${Color_Off}"
|
||||
mkdir -pv $LFS/{dev,proc,sys,run}
|
||||
mount -v --bind /dev $LFS/dev
|
||||
mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts
|
||||
mount -vt proc proc $LFS/proc
|
||||
mount -vt sysfs sysfs $LFS/sys
|
||||
mount -vt tmpfs tmpfs $LFS/run
|
||||
if [ -h $LFS/dev/shm ]; then
|
||||
install -v -d -m 1777 $LFS$(realpath /dev/shm)
|
||||
else
|
||||
mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
|
||||
fi
|
||||
echo -e "${BBlue}[i] ${Blue}Attempting chroot...${Color_Off}"
|
||||
echo -e "${BBlue}[i] ${Blue}You are about to switch to the chroot environment. When you enter the chroot environment, run the Einrichter-in-chroot.sh script located in the root of the filesystem by typing \"/Einrichter-in-chroot.sh\".${Color_Off}"
|
||||
chroot $LFS
|
||||
chroot "$LFS" /usr/bin/env -i \
|
||||
HOME=/root \
|
||||
TERM="$TERM" \
|
||||
PS1='(lfs chroot) \u:\w\$ ' \
|
||||
PATH=/usr/bin:/usr/sbin \
|
||||
MAKEFLAGS="-j$(nproc)" \
|
||||
TESTSUITEFLAGS="-j$(nproc)" \
|
||||
/bin/bash --login
|
||||
|
||||
}
|
||||
|
||||
function einrichter.installer.chroot.end() {
|
||||
echo -e "[i] Unmounting virtual file system..."
|
||||
mountpoint -q $LFS/dev/shm && umount $LFS/dev/shm
|
||||
umount $LFS/dev/pts
|
||||
umount $LFS/{sys,proc,run,dev}
|
||||
echo -e "[i] Finished section installer.chroot"
|
||||
|
||||
}
|
||||
|
||||
function einrichter.backup.create() {
|
||||
echo -e "[?] Variable LFS points to $LFS. This needs to point to the target LFS system.
|
||||
If this does NOT point to the LFS directory, EXIT NOW AND SET THE VARIABLE. This will otherwise
|
||||
DESTROY THE ENTIRE HOST SYSTEM. YOU ARE WARNED."
|
||||
read -p "[?] Continue? (y/n) " OPT
|
||||
if [ "$OPT" = "y" ]; then echo "Continuing..."; else exit 1; fi
|
||||
echo "[i] Unmounting the virtual file systems..."
|
||||
mountpoint -q $LFS/dev/shm && umount $LFS/dev/shm
|
||||
umount $LFS/dev/pts
|
||||
umount $LFS/{sys,proc,run,dev}
|
||||
echo "[i] Making the backup archive..."
|
||||
cd $LFS
|
||||
tar -cJpf $HOME/lfs-temp-tools-12.2-systemd.tar.xz .
|
||||
echo "[i] OK!"
|
||||
|
||||
}
|
||||
|
||||
function einrichter.backup.restore() {
|
||||
echo -e "[?] Variable LFS points to $LFS. This needs to point to the target LFS system.
|
||||
If this does NOT point to the LFS directory, EXIT NOW AND SET THE VARIABLE. This will otherwise
|
||||
DESTROY THE ENTIRE HOST SYSTEM. YOU ARE WARNED."
|
||||
read -p "[?] Continue? (y/n) " OPT
|
||||
echo "[i] Restoring from backup..."
|
||||
cd $LFS
|
||||
rm -rf ./*
|
||||
tar -xpf $HOME/lfs-temp-tools-12.2-systemd.tar.xz
|
||||
echo "[i] OK!"
|
||||
}
|
||||
# NEEDS REVIEW!!!
|
||||
## chown --from lfs -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
|
||||
## case $(uname -m) in
|
||||
## x86_64) chown --from lfs -R root:root $LFS/lib64 ;;
|
||||
## esac
|
||||
## }
|
||||
|
||||
function einrichter.installer.bg() {
|
||||
|
||||
|
|
|
@ -1,9 +1,54 @@
|
|||
#!/bin/bash
|
||||
|
||||
main() {
|
||||
eal.setup.env
|
||||
eal.setup.toolchain
|
||||
eal.install.cross-toolchain
|
||||
echo "Einrichter is designed to work as an install script where you can resume where you left off. Do NOT skip anything if you have not ran the step yet."
|
||||
read -p "Pending step: Setting up environment. Run, skip or quit?" OPT
|
||||
case in "$OPT"
|
||||
R)
|
||||
eal.setup.env
|
||||
;;
|
||||
S)
|
||||
echo "Step skipped."
|
||||
;;
|
||||
Q)
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command. Repeating questions."
|
||||
;;
|
||||
esac
|
||||
read -p "Pending step: Setting up toolchain. Run, skip or quit?" OPT
|
||||
case in "$OPT"
|
||||
R)
|
||||
eal.setup.toolchain
|
||||
;;
|
||||
S)
|
||||
echo "Step skipped."
|
||||
;;
|
||||
Q)
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command. Repeating questions."
|
||||
;;
|
||||
esac
|
||||
read -p "Pending step: Installing cross toolchain and packages. Run, skip or quit?" OPT
|
||||
case in "$OPT"
|
||||
R)
|
||||
eal.install.cross-toolchain
|
||||
;;
|
||||
S)
|
||||
echo "Step skipped."
|
||||
;;
|
||||
Q)
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command. Repeating questions."
|
||||
;;
|
||||
esac
|
||||
echo "Done!"
|
||||
exit
|
||||
}
|
||||
|
||||
function eal.setup.env() {
|
||||
|
@ -31,11 +76,21 @@ EOF
|
|||
source ~/.bash_profile
|
||||
}
|
||||
|
||||
function eal.notification.buildconf() {echo "I: -- The installer is now configuring the build options --" && sleep 0.2}
|
||||
function eal.notification.compiling() {echo "I: -- The installer is now compiling the package $EIR_PKG --" && sleep 0.2}
|
||||
function eal.notification.installing() {echo "I: -- The installer is now installing the package $EIR_PKG --" && sleep 0.2}
|
||||
function eal.notification.extracting() {echo "I: -- The installer is now extracting the necessary archives for $EIR_PKG --" && sleep 0.2}
|
||||
function eal.emergencyAlert() {echo -e "\a" && sleep 0.1 && echo -e "\07" && sleep 0.1 && tput bel}
|
||||
function eal.notification.buildconf() {
|
||||
echo "I: -- The installer is now configuring the build options --" && sleep 0.2
|
||||
}
|
||||
function eal.notification.compiling() {
|
||||
echo "I: -- The installer is now compiling the package $EIR_PKG --" && sleep 0.2
|
||||
}
|
||||
function eal.notification.installing() {
|
||||
echo "I: -- The installer is now installing the package $EIR_PKG --" && sleep 0.2
|
||||
}
|
||||
function eal.notification.extracting() {
|
||||
echo "I: -- The installer is now extracting the necessary archives for $EIR_PKG --" && sleep 0.2
|
||||
}
|
||||
function eal.emergencyAlert() {
|
||||
echo -e "\a" && sleep 0.1 && echo -e "\07" && sleep 0.1 && tput bel
|
||||
}
|
||||
|
||||
function eal.setup.toolchain() {
|
||||
echo -e "I: The detected system triplet is $(/usr/bin/gcc -dumpmachine)."
|
||||
|
|
|
@ -1,7 +1,526 @@
|
|||
#!/bin/bash
|
||||
|
||||
main() {
|
||||
echo "[i] Verifying if /dev/null is a device"
|
||||
if [ ! -c /dev/null ]; then
|
||||
echo "[!] /dev/null appears to NOT be a device! This issue will be repaired."
|
||||
rm -f /dev/null
|
||||
mknod -m 666 /dev/null c 1 3
|
||||
chown root:root /dev/null
|
||||
if [ ! -c /dev/null ]; then
|
||||
echo "[!] The issue could not be repaired. Manual intervention is required."
|
||||
/bin/sh
|
||||
fi
|
||||
echo "/dev/null has been fixed."
|
||||
fi
|
||||
|
||||
echo "Switched to Einrichter-in-chroot mode. Type eic.help for list of commands, exit to exit."
|
||||
|
||||
main() {
|
||||
read -p "einrichter/eic>" OPT
|
||||
$OPT
|
||||
main
|
||||
}
|
||||
|
||||
eic.help() {
|
||||
echo "
|
||||
eic.dirs.create - set up directories
|
||||
eic.essentials.create - set up essentials
|
||||
eic.essentials.install - install essential tools
|
||||
eic.clean - clean up environment
|
||||
eic.system.build - build
|
||||
eic.help - show this message
|
||||
"
|
||||
}
|
||||
|
||||
function eic.dirs.create() {
|
||||
mkdir -pv /{boot,home,mnt,opt,srv}
|
||||
mkdir -pv /etc/{opt,sysconfig}
|
||||
mkdir -pv /lib/firmware
|
||||
mkdir -pv /media/{floppy,cdrom}
|
||||
mkdir -pv /usr/{,local/}{include,src}
|
||||
mkdir -pv /usr/lib/locale
|
||||
mkdir -pv /usr/local/{bin,lib,sbin}
|
||||
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
|
||||
mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo}
|
||||
mkdir -pv /usr/{,local/}share/man/man{1..8}
|
||||
mkdir -pv /var/{cache,local,log,mail,opt,spool}
|
||||
mkdir -pv /var/lib/{color,misc,locate}
|
||||
|
||||
ln -sfv /run /var/run
|
||||
ln -sfv /run/lock /var/lock
|
||||
|
||||
install -dv -m 0750 /root
|
||||
install -dv -m 1777 /tmp /var/tmp
|
||||
}
|
||||
|
||||
function eic.essentials.create() {
|
||||
ln -s /bin/bash /bin/sh
|
||||
ln -sv /proc/self/mounts /etc/mtab
|
||||
cat > /etc/hosts << EOF
|
||||
127.0.0.1 localhost $(hostname)
|
||||
::1 localhost
|
||||
EOF
|
||||
cat > /etc/passwd << "EOF"
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/usr/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
|
||||
systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/usr/bin/false
|
||||
systemd-journal-remote:x:74:74:systemd Journal Remote:/:/usr/bin/false
|
||||
systemd-journal-upload:x:75:75:systemd Journal Upload:/:/usr/bin/false
|
||||
systemd-network:x:76:76:systemd Network Management:/:/usr/bin/false
|
||||
systemd-resolve:x:77:77:systemd Resolver:/:/usr/bin/false
|
||||
systemd-timesync:x:78:78:systemd Time Synchronization:/:/usr/bin/false
|
||||
systemd-coredump:x:79:79:systemd Core Dumper:/:/usr/bin/false
|
||||
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
|
||||
systemd-oom:x:81:81:systemd Out Of Memory Daemon:/:/usr/bin/false
|
||||
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
|
||||
EOF
|
||||
cat > /etc/group << "EOF"
|
||||
root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
systemd-journal:x:23:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
kvm:x:61:
|
||||
systemd-journal-gateway:x:73:
|
||||
systemd-journal-remote:x:74:
|
||||
systemd-journal-upload:x:75:
|
||||
systemd-network:x:76:
|
||||
systemd-resolve:x:77:
|
||||
systemd-timesync:x:78:
|
||||
systemd-coredump:x:79:
|
||||
uuidd:x:80:
|
||||
systemd-oom:x:81:
|
||||
wheel:x:97:
|
||||
users:x:999:
|
||||
nogroup:x:65534:
|
||||
EOF
|
||||
localedef -i C -f UTF-8 C.UTF-8
|
||||
echo "tester:x:101:101::/home/tester:/bin/bash" >> /etc/passwd
|
||||
echo "tester:x:101:" >> /etc/group
|
||||
install -o tester -d /home/tester
|
||||
touch /var/log/{btmp,lastlog,faillog,wtmp}
|
||||
chgrp -v utmp /var/log/lastlog
|
||||
chmod -v 664 /var/log/lastlog
|
||||
chmod -v 600 /var/log/btmp
|
||||
}
|
||||
|
||||
function eic.essentials.install() {
|
||||
pushd /sources/
|
||||
tar -xvf gettext*xz
|
||||
mv gettext-0.22.5 gettext
|
||||
pushd gettext/
|
||||
./configure --disable-shared
|
||||
make
|
||||
cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin
|
||||
popd
|
||||
tar -xvf bison*xz
|
||||
mv bison-3.8.2 bison
|
||||
pushd bison/
|
||||
./configure --prefix=/usr \
|
||||
--docdir=/usr/share/doc/bison-3.8.2
|
||||
make
|
||||
make install
|
||||
popd
|
||||
tar -xvf perl*xz
|
||||
mv perl-5.40.0 perl
|
||||
pushd perl/
|
||||
sh Configure -des \
|
||||
-D prefix=/usr \
|
||||
-D vendorprefix=/usr \
|
||||
-D useshrplib \
|
||||
-D privlib=/usr/lib/perl5/5.40/core_perl \
|
||||
-D archlib=/usr/lib/perl5/5.40/core_perl \
|
||||
-D sitelib=/usr/lib/perl5/5.40/site_perl \
|
||||
-D sitearch=/usr/lib/perl5/5.40/site_perl \
|
||||
-D vendorlib=/usr/lib/perl5/5.40/vendor_perl \
|
||||
-D vendorarch=/usr/lib/perl5/5.40/vendor_perl
|
||||
make
|
||||
make install
|
||||
popd
|
||||
tar -xvf Python*xz
|
||||
mv Python-3.12.5 python
|
||||
pushd python/
|
||||
./configure --prefix=/usr \
|
||||
--enable-shared \
|
||||
--without-ensurepip
|
||||
make
|
||||
make install
|
||||
popd
|
||||
tar -xvf texinfo*xz
|
||||
mv texinfo-7.1 texinfo
|
||||
pushd texinfo/
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make install
|
||||
popd
|
||||
tar -xvf util-linux*.xz
|
||||
mv util-linux-2.40.2 util-linux
|
||||
pushd util-linux/
|
||||
mkdir -pv /var/lib/hwclock
|
||||
./configure --libdir=/usr/lib \
|
||||
--runstatedir=/run \
|
||||
--disable-chfn-chsh \
|
||||
--disable-login \
|
||||
--disable-nologin \
|
||||
--disable-su \
|
||||
--disable-setpriv \
|
||||
--disable-runuser \
|
||||
--disable-pylibmount \
|
||||
--disable-static \
|
||||
--disable-liblastlog2 \
|
||||
--without-python \
|
||||
ADJTIME_PATH=/var/lib/hwclock/adjtime \
|
||||
--docdir=/usr/share/doc/util-linux-2.40.2
|
||||
make
|
||||
make install
|
||||
popd
|
||||
popd
|
||||
}
|
||||
|
||||
eic.clean() {
|
||||
rm -rf /usr/share/{info,man,doc}/*
|
||||
find /usr/{lib,libexec} -name \*.la -delete
|
||||
rm -rf /tools
|
||||
}
|
||||
|
||||
eic.system.build() {
|
||||
pushd /sources
|
||||
tar -xvf man-pages-6.9.1.tar.xz
|
||||
mv man-pages-6.9.1.tar.xz man-pages
|
||||
pushd man-pages
|
||||
rm -v man3/crypt*
|
||||
make prefix=/usr install
|
||||
popd
|
||||
tar -xvf iana-etc-20240806.tar.gz
|
||||
pushd iana-etc-20240806
|
||||
cp services protocols /etc
|
||||
popd
|
||||
pushd glibc/
|
||||
patch -Np1 -i ../glibc-2.40-fhs-1.patch
|
||||
rm -r build
|
||||
mkdir -v build
|
||||
cd build
|
||||
echo "rootsbindir=/usr/sbin" > configparms
|
||||
../configure --prefix=/usr \
|
||||
--disable-werror \
|
||||
--enable-kernel=4.19 \
|
||||
--enable-stack-protector=strong \
|
||||
--disable-nscd \
|
||||
libc_cv_slibdir=/usr/lib
|
||||
make
|
||||
make check
|
||||
echo "[!] Please read!
|
||||
There are cases where Glibc fails the test, and in SOME cases they may be safe to ignore!
|
||||
Please read the recent output to see if only two to three test failed.
|
||||
If io/tst-lchmod failed, that is normal. It is known to fail in the TylkoLinux live environment."
|
||||
echo "[i] Some tests, for example nss/tst-nss-files-hosts-multi and nptl/tst-thread-affinity\* are known to fail due to a timeout (especially when the system is relatively slow and/or running the test suite with multiple parallel make jobs). These tests can be identified with:
|
||||
|
||||
$ grep \"Timed out\" \$(find -name \*.out)
|
||||
|
||||
It is possible to re-run a single test with enlarged timeout with \"TIMEOUTFACTOR=<factor> make test t=<test name>\". For example, \"TIMEOUTFACTOR=10 make test t=nss/tst-nss-files-hosts-multi\" will re-run nss/tst-nss-files-hosts-multi with ten times the original timeout.
|
||||
|
||||
Additionally, some tests may fail with a relatively old CPU model (for example elf/tst-cpu-features-cpuinfo) or host kernel version (for example stdlib/tst-arc4random-thread).
|
||||
"
|
||||
read -p "[i] To enter a shell and verify the test (or re-run), press enter now. " OPT
|
||||
echo "[i] Run \"exit\" to return to the installer when done."
|
||||
/bin/sh
|
||||
touch /etc/ld.so.conf
|
||||
sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
|
||||
make install
|
||||
sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd
|
||||
localedef -i C -f UTF-8 C.UTF-8
|
||||
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
|
||||
localedef -i de_DE -f ISO-8859-1 de_DE
|
||||
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
|
||||
localedef -i de_DE -f UTF-8 de_DE.UTF-8
|
||||
localedef -i el_GR -f ISO-8859-7 el_GR
|
||||
localedef -i en_GB -f ISO-8859-1 en_GB
|
||||
localedef -i en_GB -f UTF-8 en_GB.UTF-8
|
||||
localedef -i en_HK -f ISO-8859-1 en_HK
|
||||
localedef -i en_PH -f ISO-8859-1 en_PH
|
||||
localedef -i en_US -f ISO-8859-1 en_US
|
||||
localedef -i en_US -f UTF-8 en_US.UTF-8
|
||||
localedef -i es_ES -f ISO-8859-15 es_ES@euro
|
||||
localedef -i es_MX -f ISO-8859-1 es_MX
|
||||
localedef -i fa_IR -f UTF-8 fa_IR
|
||||
localedef -i fr_FR -f ISO-8859-1 fr_FR
|
||||
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
|
||||
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
|
||||
localedef -i is_IS -f ISO-8859-1 is_IS
|
||||
localedef -i is_IS -f UTF-8 is_IS.UTF-8
|
||||
localedef -i it_IT -f ISO-8859-1 it_IT
|
||||
localedef -i it_IT -f ISO-8859-15 it_IT@euro
|
||||
localedef -i it_IT -f UTF-8 it_IT.UTF-8
|
||||
localedef -i ja_JP -f EUC-JP ja_JP
|
||||
localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true
|
||||
localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
|
||||
localedef -i nl_NL@euro -f ISO-8859-15 nl_NL@euro
|
||||
localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
|
||||
localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
|
||||
localedef -i se_NO -f UTF-8 se_NO.UTF-8
|
||||
localedef -i ta_IN -f UTF-8 ta_IN.UTF-8
|
||||
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
|
||||
localedef -i zh_CN -f GB18030 zh_CN.GB18030
|
||||
localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS
|
||||
localedef -i zh_TW -f UTF-8 zh_TW.UTF-8
|
||||
echo "[i] Add an additional locale you'd like to add by defining it in the shell below, using the localedef command. Exit when done."
|
||||
/bin/sh
|
||||
localedef -i C -f UTF-8 C.UTF-8
|
||||
localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true
|
||||
cat > /etc/nsswitch.conf << "EOF"
|
||||
# Begin /etc/nsswitch.conf
|
||||
|
||||
passwd: files systemd
|
||||
group: files systemd
|
||||
shadow: files systemd
|
||||
|
||||
hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
|
||||
networks: files
|
||||
|
||||
protocols: files
|
||||
services: files
|
||||
ethers: files
|
||||
rpc: files
|
||||
|
||||
# End /etc/nsswitch.conf
|
||||
EOF
|
||||
tar -xvf ../../tzdata2024a.tar.gz
|
||||
|
||||
ZONEINFO=/usr/share/zoneinfo
|
||||
mkdir -pv $ZONEINFO/{posix,right}
|
||||
|
||||
for tz in etcetera southamerica northamerica europe africa antarctica \
|
||||
asia australasia backward; do
|
||||
zic -L /dev/null -d $ZONEINFO ${tz}
|
||||
zic -L /dev/null -d $ZONEINFO/posix ${tz}
|
||||
zic -L leapseconds -d $ZONEINFO/right ${tz}
|
||||
done
|
||||
|
||||
cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
|
||||
zic -d $ZONEINFO -p America/New_York
|
||||
unset ZONEINFO
|
||||
eic.system.build.tz() {
|
||||
tzselect
|
||||
read -p "[i] Type the timezone that has been outputted: (with the slash) " TZ
|
||||
ln -sfv /usr/share/zoneinfo/$TZ /etc/localtime || eic.system.build.tz
|
||||
}
|
||||
eic.system-build.tz
|
||||
cat > /etc/ld.so.conf << "EOF"
|
||||
# Begin /etc/ld.so.conf
|
||||
/usr/local/lib
|
||||
/opt/lib
|
||||
|
||||
EOF
|
||||
cat >> /etc/ld.so.conf << "EOF"
|
||||
# Add an include directory
|
||||
include /etc/ld.so.conf.d/*.conf
|
||||
|
||||
EOF
|
||||
mkdir -pv /etc/ld.so.conf.d
|
||||
popd
|
||||
tar -xvf zlib-1.3.1.tar.gz
|
||||
mv zlib-1.3.1 zlib
|
||||
pushd zlib/
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make check
|
||||
make install
|
||||
rm -fv /usr/lib/libz.a
|
||||
popd
|
||||
tar -xvf bzip2-1.0.8.tar.gz
|
||||
mv bzip2-1.0.8 bzip2
|
||||
pushd bzip2/
|
||||
patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch
|
||||
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
|
||||
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
|
||||
make -f Makefile-libbz2_so
|
||||
make clean
|
||||
make
|
||||
make PREFIX=/usr install
|
||||
cp -av libbz2.so.* /usr/lib
|
||||
ln -sv libbz2.so.1.0.8 /usr/lib/libbz2.so
|
||||
cp -v bzip2-shared /usr/bin/bzip2
|
||||
for i in /usr/bin/{bzcat,bunzip2}; do
|
||||
ln -sfv bzip2 $i
|
||||
done
|
||||
rm -fv /usr/lib/libbz2.a
|
||||
popd
|
||||
pushd xz/
|
||||
./configure --prefix=/usr \
|
||||
--disable-static \
|
||||
--docdir=/usr/share/doc/xz-5.6.2
|
||||
make
|
||||
make check
|
||||
make install
|
||||
popd
|
||||
tar -xvf lz4-1.10.0.tar.gz
|
||||
mv lz4-1.10.0 lz4
|
||||
pushd lz4/
|
||||
make BUILD_STATIC=no PREFIX=/usr
|
||||
make -j1 check
|
||||
make BUILD_STATIC=no PREFIX=/usr install
|
||||
popd
|
||||
tar -xvf zstd-1.5.6.tar.gz
|
||||
mv zstd-1.5.6 zstd
|
||||
pushd zstd/
|
||||
make prefix=/usr
|
||||
make check
|
||||
make prefix=/usr install
|
||||
rm -v /usr/lib/libzstd.a
|
||||
popd
|
||||
pushd file/
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make check
|
||||
make install
|
||||
popd
|
||||
tar -xvf readline-8.2.13.tar.gz
|
||||
mv readline-8.2.13 readline
|
||||
pushd readline/
|
||||
sed -i '/MV.*old/d' Makefile.in
|
||||
sed -i '/{OLDSUFF}/c:' support/shlib-install
|
||||
sed -i 's/-Wl,-rpath,[^ ]*//' support/shobj-conf
|
||||
./configure --prefix=/usr \
|
||||
--disable-static \
|
||||
--with-curses \
|
||||
--docdir=/usr/share/doc/readline-8.2.13
|
||||
make SHLIB_LIBS="-lncursesw"
|
||||
make SHLIB_LIBS="-lncursesw" install
|
||||
install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.2.13
|
||||
popd
|
||||
pushd m4/
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make check
|
||||
make install
|
||||
popd
|
||||
tar -xvf bc-6.7.6.tar.xz
|
||||
mv bc-6.7.6 bc
|
||||
pushd bc/
|
||||
CC=gcc ./configure --prefix=/usr -G -O3 -r
|
||||
make
|
||||
make test
|
||||
make install
|
||||
popd
|
||||
tar -xvf flex-2.6.4.tar.gz
|
||||
mv flex-2.6.4 flex
|
||||
pushd flex/
|
||||
./configure --prefix=/usr \
|
||||
--docdir=/usr/share/doc/flex-2.6.4 \
|
||||
--disable-static
|
||||
make
|
||||
make check
|
||||
make install
|
||||
ln -sv flex /usr/bin/lex
|
||||
ln -sv flex.1 /usr/share/man/man1/lex.1
|
||||
popd
|
||||
tar -xvf tcl8.6.14-src.tar.gz
|
||||
mv tcl8.6.14 tcl
|
||||
pushd tcl/
|
||||
SRCDIR=$(pwd)
|
||||
cd unix
|
||||
./configure --prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--disable-rpath
|
||||
make
|
||||
|
||||
sed -e "s|$SRCDIR/unix|/usr/lib|" \
|
||||
-e "s|$SRCDIR|/usr/include|" \
|
||||
-i tclConfig.sh
|
||||
|
||||
sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.7|/usr/lib/tdbc1.1.7|" \
|
||||
-e "s|$SRCDIR/pkgs/tdbc1.1.7/generic|/usr/include|" \
|
||||
-e "s|$SRCDIR/pkgs/tdbc1.1.7/library|/usr/lib/tcl8.6|" \
|
||||
-e "s|$SRCDIR/pkgs/tdbc1.1.7|/usr/include|" \
|
||||
-i pkgs/tdbc1.1.7/tdbcConfig.sh
|
||||
|
||||
sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.4|/usr/lib/itcl4.2.4|" \
|
||||
-e "s|$SRCDIR/pkgs/itcl4.2.4/generic|/usr/include|" \
|
||||
-e "s|$SRCDIR/pkgs/itcl4.2.4|/usr/include|" \
|
||||
-i pkgs/itcl4.2.4/itclConfig.sh
|
||||
|
||||
unset SRCDIR
|
||||
|
||||
make test
|
||||
make install
|
||||
chmod -v u+w /usr/lib/libtcl8.6.so
|
||||
make install-private-headers
|
||||
ln -sfv tclsh8.6 /usr/bin/tclsh
|
||||
mv /usr/share/man/man3/{Thread,Tcl_Thread}.3
|
||||
cd ..
|
||||
tar -xf ../tcl8.6.14-html.tar.gz --strip-components=1
|
||||
mkdir -v -p /usr/share/doc/tcl-8.6.14
|
||||
cp -v -r ./html/* /usr/share/doc/tcl-8.6.14
|
||||
popd
|
||||
tar -xvf expect5.45.4.tar.gz
|
||||
mv expect5.45.4 expect
|
||||
pushd expect/
|
||||
eic.system.build.expect.intervention() {
|
||||
[[ if $(python3 -c 'from pty import spawn; spawn(["echo", "ok"])') != "ok" ]]; then
|
||||
echo "[i] PS: The error is caused by the chroot environment not being set up for proper PTY operation."
|
||||
read -p "[!] Answer unexpected. Continue, enter shell or quit? [c/s/q] " OPT
|
||||
case "$OPT" in
|
||||
c)
|
||||
echo "OK!"
|
||||
;;
|
||||
s)
|
||||
/bin/sh
|
||||
eic.system.build.expect.intervention
|
||||
;;
|
||||
q)
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "Invalid command!"
|
||||
eic.system.build.expect.intervention
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
eic.system.build.expect.intervention
|
||||
patch -Np1 -i ../expect-5.45.4-gcc14-1.patch
|
||||
./configure --prefix=/usr \
|
||||
--with-tcl=/usr/lib \
|
||||
--enable-shared \
|
||||
--disable-rpath \
|
||||
--mandir=/usr/share/man \
|
||||
--with-tclinclude=/usr/include
|
||||
make
|
||||
make test
|
||||
make install
|
||||
ln -svf expect5.45.4/libexpect5.45.4.so /usr/lib
|
||||
popd
|
||||
tar -xvf dejagnu-1.6.3.tar.gz
|
||||
mv dejagnu-1.6.3 dejagnu
|
||||
pushd dejagnu/
|
||||
mkdir -v build
|
||||
cd build
|
||||
../configure --prefix=/usr
|
||||
makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi
|
||||
makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi
|
||||
make check
|
||||
make install
|
||||
install -v -dm755 /usr/share/doc/dejagnu-1.6.3
|
||||
install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.3
|
||||
}
|
||||
|
||||
main
|
Loading…
Add table
Reference in a new issue