From bc30114c593b5433d38a94078e0b1f67606cfec1 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 27 Jun 2019 18:29:23 +0200 Subject: Fixed building with bash --- bootstrap.sh | 24 +----------------------- install.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 install.sh diff --git a/bootstrap.sh b/bootstrap.sh index e2cc2f7..192e8f9 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,16 +1,10 @@ #!/usr/bin/env bash -export source=$(pwd) - -sudo useradd -m melvix -sudo mkdir /home/melvix -sudo chown -R melvix /home/melvix -sudo -i -u melvix bash << SUPERAWESOMEENDLINGLINE +export source=$1 set +h umask 022 export MELVIX=/home/melvix/os -mkdir -pv ${MELVIX} cd ${MELVIX} export LC_ALL=POSIX @@ -48,9 +42,6 @@ for dir in ${MELVIX}/usr{,/local}; do install -dv ${MELVIX}/cross-tools{,/bin} ln -svf /proc/mounts ${MELVIX}/etc/mtab -cp -rfv ${source}/etc/* ${MELVIX}/etc/ -cp -rfv ${source}/boot/grub/ ${MELVIX}/boot/ - echo "melvix" > ${MELVIX}/etc/HOSTNAME touch ${MELVIX}/var/run/utmp ${MELVIX}/var/log/{btmp,lastlog,wtmp} @@ -183,16 +174,3 @@ FILES="$(ls ${MELVIX}-copy/usr/lib64/*.a)" for file in ${FILES}; do rm -f ${file} done - -SUPERAWESOMEENDLINGLINE -export MELVIX=/home/melvix/os -find ${MELVIX}-copy/{,usr/}{bin,lib,sbin} -type f -exec sudo strip --strip-debug '{}' ';' -find ${MELVIX}-copy/{,usr/}lib64 -type f -exec sudo strip --strip-debug '{}' ';' -sudo chown -R root:root ${MELVIX}-copy -sudo chgrp 13 ${MELVIX}-copy/var/run/utmp ${MELVIX}-copy/var/log/lastlog -sudo mknod -m 0666 ${MELVIX}-copy/dev/null c 1 3 -sudo mknod -m 0600 ${MELVIX}-copy/dev/console c 5 1 -sudo chmod 4755 ${MELVIX}-copy/bin/busybox - -cd ${MELVIX}-copy/ -sudo tar cfJ ../melvix-build.tar.xz * diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..1dd889f --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +export source=$(pwd) + +sudo useradd -m melvix +sudo mkdir -p /home/melvix/os +sudo cp -r boot etc /home/melvix/os +sudo chown -R melvix /home/melvix +sudo cp bootstrap.sh /home/melvix +sudo -i -u melvix bash bootstrap.sh ${source} + +export MELVIX=/home/melvix/os +find ${MELVIX}-copy/{,usr/}{bin,lib,sbin} -type f -exec sudo strip --strip-debug '{}' ';' +find ${MELVIX}-copy/{,usr/}lib64 -type f -exec sudo strip --strip-debug '{}' ';' +sudo chown -R root:root ${MELVIX}-copy +sudo chgrp 13 ${MELVIX}-copy/var/run/utmp ${MELVIX}-copy/var/log/lastlog +sudo mknod -m 0666 ${MELVIX}-copy/dev/null c 1 3 +sudo mknod -m 0600 ${MELVIX}-copy/dev/console c 5 1 +sudo chmod 4755 ${MELVIX}-copy/bin/busybox + +cd ${MELVIX}-copy/ +sudo tar cfJ ../melvix-build.tar.xz * \ No newline at end of file -- cgit v1.2.3