Open Source & Linux Lab

It's better when it's simple

User Tools

Site Tools


etc:users:jcmvbkbc:linux128

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
etc:users:jcmvbkbc:linux128 [2008/04/23 01:07] – создано jcmvbkbcusers:jcmvbkbc:linux128 [2016/08/07 00:34] – ↷ Page moved from user:jcmvbkbc:linux128 to users:jcmvbkbc:linux128 kel
Line 1: Line 1:
 ====== GNU/Linux, rootfs <128 Mb ====== ====== GNU/Linux, rootfs <128 Mb ======
  
-  * шаг первый, самый простой: минимальная установка обыкновенной системырезультатотрицательный (fedora8kickstart ниже; даже без X11/qtInstallation target minimized to **292172K**; образ squashfs: **87598K**);+__Проблема__: имеется множество разных конфигураций машинна которых хочется запускать свой софт. Общее в них -- это PC, x86, не хуже Pentium-200. Хочется иметь базовую конфигурацию, которая будет работать **без настройки** на всех этих машинах. 
 + 
 +__Цель__с минимальными усилиями получить GNU/Linux rootfs <128Mbвключающий в себя X и работающий на всем. 
 + 
 +__Решение__собирать livecd, заливать его на винт/usb/cd/... 
 + 
 +__Детали__ (kickstart для Fedora8):
  
 <file> <file>
Line 10: Line 16:
 selinux --disabled selinux --disabled
 firewall --disabled firewall --disabled
-part / --size 384+part / --size 1024 
 + 
 +#X11 
 +xconfig --startxonboot
  
 repo --name=e8 --baseurl=ftp://192.168.4.23/pub/fedora/linux/releases/8/Everything/i386/os/ repo --name=e8 --baseurl=ftp://192.168.4.23/pub/fedora/linux/releases/8/Everything/i386/os/
 +repo --name=u8 --baseurl=ftp://192.168.4.23/pub/fedora/linux/updates/8/i386/
  
 %packages --excludedocs --nobase %packages --excludedocs --nobase
-#@core 
-#filesystem 
 glibc glibc
 initscripts initscripts
 +chkconfig
  
 bash bash
 kernel kernel
 passwd passwd
-#policycoreutils +authconfig 
-#chkconfig + 
-#authconfig +# cyrillic console 
-#rootfiles+kbd 
 + 
 +#X11 
 +xorg-x11-drivers 
 +xorg-x11-xinit 
 + 
 +#window manager 
 +#xorg-x11-xdm 
 +#xorg-x11-twm 
 +metacity 
 + 
 +xterm 
 +system-config-display 
 + 
 +#fonts 
 +liberation-fonts 
 + 
 +#qt4 
 +#qt4-devel 
 +unixODBC-kde 
 + 
 +#debugging 
 +rpm 
 +strace 
 +vim-minimal 
 +fedora-logos 
 + 
 +%end 
 + 
 + 
 +%post 
 +cat > /etc/rc.d/init.d/fedora-live << EOF 
 +#!/bin/bash 
 +
 +# live: Init script for live image 
 +
 +# chkconfig: 345 00 99 
 +description: Init script for live image. 
 + 
 +. /etc/init.d/functions 
 + 
 +if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-configured ] ; then 
 +    exit 0 
 +fi 
 + 
 +exists() { 
 +    which \$1 >/dev/null 2>&1 || return 
 +    \$* 
 +
 + 
 +touch /.liveimg-configured 
 + 
 +mount live image 
 +if [ -b /dev/live ]; then 
 +   mkdir -p /mnt/live 
 +   mount -o ro /dev/live /mnt/live 
 +fi 
 + 
 +# read some variables out of /proc/cmdline 
 +for o in \`cat /proc/cmdline\` ; do 
 +    case \$o in 
 +    ks=*) 
 +        ks="\${o#ks=}" 
 +        ;; 
 +    xdriver=*) 
 +        xdriver="--set-driver=\${o#xdriver=}" 
 +        ;; 
 +    esac 
 +done 
 + 
 + 
 +# if liveinst or textinst is given, start anaconda 
 +if strstr "\`cat /proc/cmdline\`" liveinst ; then 
 +   /usr/sbin/liveinst \$ks 
 +fi 
 +if strstr "\`cat /proc/cmdline\`" textinst ; then 
 +   /usr/sbin/liveinst --text \$ks 
 +fi 
 + 
 +# enable swaps unless requested otherwise 
 +swaps=\`blkid -t TYPE=swap -o device\` 
 +if ! strstr "\`cat /proc/cmdline\`" noswap -a [ -n "\$swaps" ] ; then 
 +  for s in \$swaps ; do 
 +    action "Enabling swap partition \$s" swapon \$s 
 +  done 
 +fi 
 + 
 +# configure X, allowing user to override xdriver 
 +exists system-config-display --noui --reconfig --set-depth=24 \$xdriver 
 + 
 +# add fedora user with no passwd 
 +useradd -c "Fedora Live" fedora 
 +passwd -d fedora > /dev/null 
 + 
 +# turn off firstboot for livecd boots 
 +echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot 
 + 
 +# don't start yum-updatesd for livecd boots 
 +chkconfig --level 345 yum-updatesd off 2>/dev/null 
 + 
 +# don't start cron/at as they tend to spawn things which are 
 +# disk intensive that are painful on a live image 
 +chkconfig --level 345 crond off 2>/dev/null 
 +chkconfig --level 345 atd off 2>/dev/null 
 +chkconfig --level 345 anacron off 2>/dev/null 
 +chkconfig --level 345 readahead_early off 2>/dev/null 
 +chkconfig --level 345 readahead_later off 2>/dev/null 
 + 
 +# Stopgap fix for RH #217966; should be fixed in HAL instead 
 +touch /media/.hal-mtab 
 + 
 +# workaround clock syncing on shutdown that we don't want (#297421) 
 +sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt 
 +EOF 
 + 
 + 
 +# workaround avahi segfault (#279301) 
 +touch /etc/resolv.conf 
 +/sbin/restorecon /etc/resolv.conf 
 + 
 +chmod 755 /etc/rc.d/init.d/fedora-live 
 +/sbin/restorecon /etc/rc.d/init.d/fedora-live 
 +/sbin/chkconfig --add fedora-live 
 + 
 +# save a little bit of space at least... 
 +rm -f /boot/initrd* 
 +# make sure there aren't core files lying around 
 +rm -f /core* 
 + 
 +rpm -e --nodeps fedora-release-notes 
 +rpm -e --nodeps avahi 
 +#rpm -e --nodeps cracklib-dicts 
 + 
 +#glibc-common 
 +rm -rf /usr/share/doc 
 +rm -rf /usr/lib/locale/
 +localedef -i /usr/share/i18n/locales/ru_RU -f UTF-8 ru_RU 
 +localedef -i /usr/share/i18n/locales/ru_RU -f UTF-8 ru_RU.UTF-8 
 +localedef -i /usr/share/i18n/locales/ru_RU -f KOI8-R ru_RU.KOI8-R 
 +find /usr/share/i18n/locales -mindepth 1 -maxdepth 1 | grep -v ru | xargs rm -rf 
 +find /usr/share/locale -mindepth 1 -maxdepth 1 | grep -v ru | xargs rm -rf 
 + 
 +#kernel 
 +rm -rf /lib/modules/*/kernel/{sound,drivers/{atm,bluetooth,firewire,mtd,net,pcmcia,watchdog}} 
 + 
 +#perl is needed only during setup 
 +rpm -e --nodeps perl perl-libs 
 + 
 +#funny X setup 
 +cat >/etc/X11/xinit/xinitrc << EOF 
 +metacity & 
 +xterm 
 +EOF 
 + 
 +chmod +x /etc/X11/xinit/xinitrc 
 + 
 +cat >/etc/X11/prefdm << EOF 
 +#! /bin/sh 
 + 
 +PATH=/sbin:/usr/sbin:/bin:/usr/bin 
 +# We need to source this so that the login screens get translated 
 +[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n 
 +startx 
 +EOF 
 + 
 +chmod +x /etc/X11/prefdm
  
 %end %end
 </file> </file>
 +
 +Оно работает! ((:
 +
etc/users/jcmvbkbc/linux128.txt · Last modified: 2016/08/08 20:53 by kel