From de17b95791401bec5da5077db76ee485138ef968 Mon Sep 17 00:00:00 2001 From: lw-everestlinux Date: Mon, 22 Aug 2022 23:29:22 -0400 Subject: [PATCH] 8/22/22 --- scripts/build-3.sh | 40 +++++++++++++++++++++++++++++++-- scripts/sysfiles/default.script | 38 +++++++++++++++++++++++++++++++ scripts/sysfiles/hosts | 2 +- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 scripts/sysfiles/default.script diff --git a/scripts/build-3.sh b/scripts/build-3.sh index 6c3775b..248a58c 100755 --- a/scripts/build-3.sh +++ b/scripts/build-3.sh @@ -157,7 +157,7 @@ printf "[ i ] Creating system directories...\n" cat > ${EVEREST}/targetfs/etc/passwd << "EOF" root::0:0:root:/root:/bin/ash EOF - cat > ${CLFS}/targetfs/etc/group << "EOF" + cat > ${EVEREST}/targetfs/etc/group << "EOF" root:x:0: bin:x:1: sys:x:2: @@ -251,8 +251,44 @@ printf "[ i ] Building the Linux kernel...\n" printf "[ i ] Finished build of the Linux kernel...\n" printf "[ i ] NOTE: Bootloader will need to be installed manually by the user (unless utilizing the bootloader of another system)\n" +printf "[ i ] GRUB can be installed through Glacier.\n" wait 3 printf "[ i ] Bootstrapping Glacier package management system...\n" - + cd ${EVEREST}/tmp + git clone https://git.everestlinux.org/EverestLinux/glacier + cd install + tar xvf glacier.tar.gz + cd src + chmod +x INSTALL.sh + ./INSTALL.sh + cd ${EVEREST}/sources +printf "[ i ] Setting up bootscripts...\n" + tar -xvf master.tar.gz + cd bootscripts-embedded-master + make DESTDIR=${EVEREST}/targetfs install-bootscripts + +printf "[ i ] Creating system files...\n" +printf "[ i ] It may be a good idea to review the following files after this script finishes:\n" +printf " /etc/mdev.conf\n" +printf " /etc/profile\n" +printf " /etc/inittab\n" +printf " /etc/hostname\n" +printf " /etc/hosts\n" + + cd /home/everest/everest-install/scripts/sysfiles + cp mdev ${EVEREST}/targetfs/etc/mdev.conf + cp profile ${EVEREST}/targetfs/etc/profile + cp inittab ${EVEREST}/targetfs/etc/inittab + cp hostname ${EVEREST}/targetfs/etc/hostname + cp hosts ${EVEREST}/targetfs/etc/hosts + mkdir -pv ${EVEREST}/targetfs/etc/network/if-{post-{up,down},pre-{up,down},up,down}.d + mkdir -pv ${EVEREST}/targetfs/usr/share/udhcpc + + cat > ${EVEREST}/targetfs/etc/network/interfaces << "EOF" + auto eth0 + iface eth0 inet dhcp +EOF + cp default.script ${EVEREST}/targetfs/usr/share/udhcpc/default.script + chmod +x ${EVEREST}/targetfs/usr/share/udhcpc/default.script diff --git a/scripts/sysfiles/default.script b/scripts/sysfiles/default.script new file mode 100644 index 0000000..3ba2ee2 --- /dev/null +++ b/scripts/sysfiles/default.script @@ -0,0 +1,38 @@ +#!/bin/sh +# udhcpc Interface Configuration +# Based on http://lists.debian.org/debian-boot/2002/11/msg00500.html +# udhcpc script edited by Tim Riker + +[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 + +RESOLV_CONF="/etc/resolv.conf" +[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" +[ -n "$subnet" ] && NETMASK="netmask $subnet" + +case "$1" in + deconfig) + /sbin/ifconfig $interface 0.0.0.0 + ;; + + renew|bound) + /sbin/ifconfig $interface $ip $BROADCAST $NETMASK + + if [ -n "$router" ] ; then + while route del default gw 0.0.0.0 dev $interface ; do + true + done + + for i in $router ; do + route add default gw $i dev $interface + done + fi + + echo -n > $RESOLV_CONF + [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF + for i in $dns ; do + echo nameserver $i >> $RESOLV_CONF + done + ;; +esac + +exit 0 diff --git a/scripts/sysfiles/hosts b/scripts/sysfiles/hosts index 3255839..5a30242 100644 --- a/scripts/sysfiles/hosts +++ b/scripts/sysfiles/hosts @@ -1,6 +1,6 @@ # Begin /etc/hosts (network card version) 127.0.0.1 localhost -192.168.1.1 [.example.org] everest +192.168.1.1 everest.everestlinux.org everest # End /etc/hosts (network card version)