Adding compilation for liblzma and grub

This commit is contained in:
Marc
2021-12-02 16:28:42 +01:00
parent fbdabd66a5
commit 0c039501db
9 changed files with 74 additions and 22 deletions
+11 -9
View File
@@ -16,7 +16,17 @@ mkdir -p rootfs/chibrax
#installation de grub #installation de grub
# coreutils = cat # coreutils = cat
sudo pacstrap rootfs coreutils grub sed || exit 1 sudo pacstrap rootfs device-mapper || exit 1
echo "construction de liblzma"
chmod +x ./liblzma/build.sh
cd liblzma && ./build.sh || exit 1 && cd -
echo "done"
echo "construction de grub"
chmod +x ./grub/build.sh
cd grub && ./build.sh || exit 1 && cd -
echo "done"
echo "construction de Nodejs" echo "construction de Nodejs"
chmod +x ./nodejs/build.sh chmod +x ./nodejs/build.sh
@@ -45,11 +55,3 @@ echo "done"
sudo cp rootfs\ overrides/* rootfs/ -r || exit 1 sudo cp rootfs\ overrides/* rootfs/ -r || exit 1
sudo rm rootfs/var/cache -r sudo rm rootfs/var/cache -r
echo "removing arch's grub hooks"
sudo rm rootfs/etc/grub.d/10_linux
sudo rm rootfs/etc/grub.d/20_linux_xen
sudo rm rootfs/etc/grub.d/30_os-prober
sudo rm rootfs/etc/grub.d/41_custom
#celui sert a rien tant qu'on ne supporte pas l'uefi
sudo rm rootfs/etc/grub.d/30_uefi-firmware
+10 -10
View File
@@ -42,20 +42,20 @@ cp rootfs/* $CHIBRAX_MOUNT_POINT -r
echo "done" echo "done"
echo "installing grub" echo "installing grub"
mount --rbind /dev /mnt/mychroot/dev mount --rbind /dev $CHIBRAX_MOUNT_POINT/dev
mount --make-rslave /mnt/mychroot/dev mount --make-rslave $CHIBRAX_MOUNT_POINT/dev
mount -t proc /proc /mnt/mychroot/proc mount -t proc /proc $CHIBRAX_MOUNT_POINT/proc
mount --rbind /sys /mnt/mychroot/sys mount --rbind /sys $CHIBRAX_MOUNT_POINT/sys
mount --make-rslave /mnt/mychroot/sys mount --make-rslave $CHIBRAX_MOUNT_POINT/sys
mount --rbind /tmp /mnt/mychroot/tmp mount --rbind /tmp $CHIBRAX_MOUNT_POINT/tmp
chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos
chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg
umount /mnt/mychroot/dev umount $CHIBRAX_MOUNT_POINT/dev
umount /mnt/mychroot/proc umount $CHIBRAX_MOUNT_POINT/proc
umount /mnt/mychroot/sys umount $CHIBRAX_MOUNT_POINT/sys
umount /mnt/mychroot/tmp umount $CHIBRAX_MOUNT_POINT/tmp
PARTUUID=$(lsblk $LOOP --fs | awk '{print $4}' | grep -v LABEL) PARTUUID=$(lsblk $LOOP --fs | awk '{print $4}' | grep -v LABEL)
+1 -1
View File
@@ -1,6 +1,6 @@
if [ -f /bin/pacman ] # btw if [ -f /bin/pacman ] # btw
then then
sudo pacman -S python gcc make bc unzip wget sudo binutils nasm sudo pacman -S python gcc make bc unzip wget sudo binutils nasm autoconf diffutils binutils bison gettext flex
else if [ -f /bin/apt ] #deb / ubuntu else if [ -f /bin/apt ] #deb / ubuntu
then then
sudo apt-get install python3 g++ make bc unzip wget sudo sudo apt-get install python3 g++ make bc unzip wget sudo
+1
View File
@@ -0,0 +1 @@
src
Executable
+32
View File
@@ -0,0 +1,32 @@
VER=2.06
if [ "$EUID" = 0 ]
then echo "Please don't run this as root"
exit
fi
if [ ! -d src ]
then
mkdir -p src
cd src
curl https://git.savannah.gnu.org/cgit/grub.git/snapshot/grub-$VER.tar.gz --output grub.tar.gz
tar xvf grub.tar.gz
rm grub.tar.gz
mv grub-$VER/* .
cd -
fi
cd src
#no shure git.sv.gnu.org still exists but i had problems with my proxy anyway
sed -i "s/git\:\/\/git\.sv\.gnu\.org\/gnulib/https\:\/\/git.savannah.gnu.org\/git\/gnulib.git/g" ./bootstrap
./bootstrap
./configure --disable-werror
make -j$(nproc)
DESTDIR=$(pwd)/../../rootfs
sudo make install DESTDIR=$(realpath $DESTDIR)
cd -
+7
View File
@@ -1,3 +1,9 @@
if [ "$EUID" = 0 ]
then echo "Please don't run this as root"
exit
fi
if [ ! -d src ] if [ ! -d src ]
then then
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.5.tar.xz wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.5.tar.xz
@@ -13,6 +19,7 @@ then
fi fi
cd src cd src
# make clean qui supprime le .config
make mrproper make mrproper
cp ../.config .config cp ../.config .config
make -j$(nproc) bzImage make -j$(nproc) bzImage
+1
View File
@@ -0,0 +1 @@
src
+9
View File
@@ -0,0 +1,9 @@
git clone https://github.com/kobolabs/liblzma src
cd src
git pull
./configure
make -j$(nproc)
cd -
sudo cp src/src/liblzma/.libs/liblzma.so ../rootfs/usr/lib
sudo cp src/src/liblzma/.libs/liblzma.so.5 ../rootfs/usr/lib