morpheus

suckless linux distro
git clone git://git.2f30.org/morpheus
Log | Files | Refs | Submodules | README | LICENSE

install-morpheus (1161B)


      1 #!/bin/sh
      2 
      3 set -e -x
      4 
      5 root="/ns/morpheus"
      6 test x"$1" != x"" && root="$1"
      7 tmpdir="$root/tmp/morpheus_install"
      8 pkgdir="$tmpdir/pkgs"
      9 
     10 # list of important packages
     11 pkgs="curl#7.36.0.pkg.tgz
     12 e2fsprogs#1.42.9.pkg.tgz
     13 elinks#0.12pre6.pkg.tgz
     14 extlinux#6.02.pkg.tgz
     15 file#5.17.pkg.tgz
     16 fs.pkg.tgz
     17 hbase.pkg.tgz
     18 ii.pkg.tgz
     19 libarchive#3.1.2.pkg.tgz
     20 linux#3.10.32.pkg.tgz
     21 iproute2#3.14.0.pkg.tgz
     22 mksh#R47.pkg.tgz
     23 pkgtools.pkg.tgz
     24 sbase.pkg.tgz
     25 sdhcp.pkg.tgz
     26 shadow#4.2.1.pkg.tgz
     27 sinit.pkg.tgz
     28 smdev.pkg.tgz
     29 tmux#1.9a.pkg.tgz
     30 ubase.pkg.tgz
     31 vim#7.4.pkg.tgz"
     32 
     33 # prepare root
     34 mkdir -p "$root/var/pkg"
     35 mkdir -p "$pkgdir"
     36 mkdir -p "$tmpdir"
     37 
     38 # fetch pkgtools in tmpdir
     39 cd "$tmpdir"
     40 pkgtools="pkgtools.pkg.tgz"
     41 if ! test -f "$pkgtools"; then
     42 	wget "http://morpheus.2f30.org/0.0/packages/x86_64/${pkgtools}"
     43 fi
     44 if ! test -d "$tmpdir/bin"; then
     45 	tar -xzf "$pkgtools"
     46 fi
     47 export PATH="$tmpdir/bin:$PATH"
     48 
     49 # fetch packages
     50 cd "$pkgdir"
     51 for i in $pkgs; do
     52 	searchpkg "$i" | fetchpkg
     53 done
     54 cd - 1>/dev/null
     55 
     56 # install packages
     57 for i in $pkgs; do
     58 	installpkg -r "$root" "$pkgdir/$i"
     59 done
     60 
     61 # copy etc/resolv.conf
     62 cp /etc/resolv.conf "$root/etc/resolv.conf"
     63 chmod 644 "$root/etc/resolv.conf"