diff --git a/build.sh b/build.sh index 75d8fe7..3eeb807 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,10 @@ #!/bin/bash + +if [ "$EUID" = 0 ] +then echo "Please don't run this as root" + exit +fi + # 2> /dev/null veut dire que l'on veut pas voire les erreurs sudo umount rootfs/proc -R 2> /dev/null sudo rm -rf rootfs/ 2> /dev/null @@ -9,7 +15,8 @@ mkdir -p rootfs/boot mkdir -p rootfs/chibrax #installation de grub -sudo pacstrap rootfs coreutils grub sed +# coreutils = cat +sudo pacstrap rootfs coreutils grub sed || exit 1 echo "construction de Nodejs" chmod +x ./nodejs/build.sh @@ -27,7 +34,7 @@ echo "Cloning the firmware" # on masque les erreurs si le depot est deja clone git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git 2> /dev/null cd linux-firmware && git pull && cd - -sudo mkdir -p rootfs/usr/lib/firmware +sudo mkdir -p rootfs/usr/lib/firmware || exit 1 sudo cp linux-firmware/* rootfs/usr/lib/firmware/ -r || exit 1 echo "done" @@ -37,4 +44,12 @@ echo "done" sudo cp rootfs\ overrides/* rootfs/ -r || exit 1 -sudo rm rootfs/var/cache -rf \ No newline at end of file +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 \ No newline at end of file diff --git a/createLiveImage.sh b/createLiveImage.sh index 207705a..39c4cdc 100755 --- a/createLiveImage.sh +++ b/createLiveImage.sh @@ -41,15 +41,21 @@ echo "coping rootfs" cp rootfs/* $CHIBRAX_MOUNT_POINT -r echo "done" -echo "removing arch's grub hooks" -rm rootfs/etc/grub.d/10_linux -rm rootfs/etc/grub.d/20_linux_xen -#celui sert a rien tant qu'on ne supporte pas l'uefi -rm rootfs/etc/grub.d/30_uefi-firmware - echo "installing grub" -arch-chroot $CHIBRAX_MOUNT_POINT grub-install --target=i386-pc ${LOOP_ROOT} --modules=part_msdos -arch-chroot $CHIBRAX_MOUNT_POINT grub-mkconfig -o /boot/grub/grub.cfg +mount --rbind /dev /mnt/mychroot/dev +mount --make-rslave /mnt/mychroot/dev +mount -t proc /proc /mnt/mychroot/proc +mount --rbind /sys /mnt/mychroot/sys +mount --make-rslave /mnt/mychroot/sys +mount --rbind /tmp /mnt/mychroot/tmp + +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 + +umount /mnt/mychroot/dev +umount /mnt/mychroot/proc +umount /mnt/mychroot/sys +umount /mnt/mychroot/tmp PARTUUID=$(lsblk $LOOP --fs | awk '{print $4}' | grep -v LABEL) diff --git a/nodejs/build.sh b/nodejs/build.sh index 74dca00..aee8437 100755 --- a/nodejs/build.sh +++ b/nodejs/build.sh @@ -7,10 +7,11 @@ fi VERSION=17.1.0 -if [ ! -f src ] +if [ ! -f src/node-$VERSION/Makefile ] then mkdir src -p cd src +echo "clonning" curl https://github.com/nodejs/node/archive/refs/tags/v$VERSION.zip -L --output $VERSION.zip || exit 1 unzip $VERSION.zip || exit 1 cd -