2007-10-22 08:26:34 +02:00
|
|
|
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
|
|
|
|
|
|
|
install ()
|
|
|
|
{
|
2009-05-24 15:47:17 +02:00
|
|
|
SCRIPT="arch_base_lowmem"
|
2009-05-31 14:20:14 +02:00
|
|
|
BINARIES="init agetty mount modprobe umount head basename clear nano printf tail test tty wc which xargs yes syslog-ng bash swapon uniq cut seq find sort fdisk sfdisk cfdisk parted gawk cp mv shutdown ls rm sed less chgrp chmod chown df dialog dmesg egrep fgrep grep kill killall killall5 more ps pwd rmdir stty sync tar touch uname hdparm true mktemp chroot dirname bzip2 date hwclock depmod cat gzip tr sdparm expr tput ifconfig ln losetup mkdir mkfifo mknod readlink echo gunzip zcat reset swapoff halt telinit awk dir poweroff reboot pidof nc lzcat lzcmp lzdiff lzegrep lzfgrep lzgrep lzless lzma lzmadec lzmore unlzma unxz xz xzcat xzdec"
|
2009-05-24 15:47:17 +02:00
|
|
|
|
2007-10-22 08:26:34 +02:00
|
|
|
### setting up base structure
|
|
|
|
add_dir "/proc"
|
|
|
|
add_dir "/sys"
|
|
|
|
add_dir "/dev"
|
|
|
|
add_dir "/mnt"
|
2008-03-16 22:57:21 +01:00
|
|
|
add_dir "/media"
|
|
|
|
add_dir "/media/cdrom"
|
|
|
|
add_dir "/media/dvd"
|
|
|
|
add_dir "/media/floppy"
|
2007-10-22 08:26:34 +02:00
|
|
|
add_dir "/tmp"
|
2008-03-16 22:57:21 +01:00
|
|
|
add_dir "/tmp/install"
|
2007-10-22 08:26:34 +02:00
|
|
|
add_dir "/var/run"
|
|
|
|
add_dir "/var/log"
|
|
|
|
add_dir "/addons"
|
|
|
|
add_dir "/home"
|
|
|
|
add_device "/dev/null" c 1 3
|
|
|
|
add_device "/dev/zero" c 1 5
|
|
|
|
add_device "/dev/console" c 5 1
|
|
|
|
|
|
|
|
### adding klibc lib files
|
|
|
|
for f in $(find /lib -name klibc-*.so); do
|
|
|
|
add_file $f
|
|
|
|
done
|
|
|
|
|
2009-05-24 15:47:17 +02:00
|
|
|
### adding klibc binaries, stripping out all programs we use real version!
|
2008-12-06 19:12:19 +01:00
|
|
|
for f in $(find /usr/lib/klibc/bin/ ! -name "mount" ! -name "umount" ! -name "reboot" ! -name "halt" ! -name "chroot" ! -name "sh" ! -name "modprobe" ! -name "cat" ! -name "cpio" ! -name "dd" ! -name "gunzip" ! -name "gzip" ! -name "insmod" ! -name "zcat" ! -name "lsmod" ! -name "mv" ! -name "kill" ! -name "ln" ! -name "losetup" ! -name "mkdir" ! -name "mkfifo" ! -name "mknod" ! -name "poweroff" ! -name "readlink" ! -name "sync" ! -name "dmesg" ! -type d); do
|
2007-10-22 08:26:34 +02:00
|
|
|
add_file $f /bin/$(basename $f)
|
|
|
|
done
|
|
|
|
|
|
|
|
### adding needed programs from running system
|
|
|
|
add_file "${CONFIG}" "/config"
|
2009-05-24 15:47:17 +02:00
|
|
|
|
2008-12-06 19:12:19 +01:00
|
|
|
add_file "/usr/share/archboot/base/init" "/init"
|
2007-10-22 08:26:34 +02:00
|
|
|
add_file "/usr/share/terminfo/l/linux"
|
|
|
|
add_file "/etc/rc.d/functions"
|
2008-12-06 19:12:19 +01:00
|
|
|
add_file "/usr/share/archboot/base/etc/rc.conf" "/etc/rc.conf"
|
2007-10-22 08:26:34 +02:00
|
|
|
add_file "/etc/rc.d/syslog-ng"
|
|
|
|
|
|
|
|
### adding config files of installation system
|
2008-12-06 19:12:19 +01:00
|
|
|
for i in $(find /usr/share/archboot/base/etc/*); do
|
2007-10-22 08:26:34 +02:00
|
|
|
add_file "$i" "/etc/$(basename $i)"
|
|
|
|
done
|
|
|
|
|
|
|
|
### fixing network support
|
|
|
|
add_file "/lib/libnss_files.so.2"
|
|
|
|
add_file "/lib/libnss_dns.so.2"
|
2009-05-24 15:47:17 +02:00
|
|
|
|
2009-04-26 15:09:49 +02:00
|
|
|
### add copy-mountpoint.sh
|
|
|
|
add_file "/usr/bin/copy-mountpoint.sh"
|
2009-05-24 15:47:17 +02:00
|
|
|
|
|
|
|
### fix licenses
|
2009-05-08 08:05:45 +02:00
|
|
|
add_file "/usr/share/licenses/bzip2/LICENSE"
|
|
|
|
add_file "/usr/share/licenses/hdparm/LICENSE.TXT"
|
|
|
|
add_file "/usr/share/licenses/ncurses/license.txt"
|
|
|
|
add_file "/usr/share/licenses/pcre/LICENSE"
|
2009-05-08 08:49:58 +02:00
|
|
|
add_file "/usr/share/licenses/shadow/COPYING"
|
2009-05-08 08:05:45 +02:00
|
|
|
add_file "/usr/share/licenses/sdparm/COPYING"
|
|
|
|
add_file "/usr/share/licenses/zlib/license.txt"
|
2007-10-22 08:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
help ()
|
|
|
|
{
|
|
|
|
cat <<HELPEOF
|
|
|
|
This hook sets up all initial directories and installs base
|
|
|
|
klibc utilities and libraries for a lowmem arch boot image.
|
|
|
|
DO NOT remove this one unless you know what you're doing.
|
|
|
|
HELPEOF
|
|
|
|
}
|