initial rescue image
NB: this implementation is awfully cut-n-paste one, there are lots of common code with install2 which are subject to careful surgery
This commit is contained in:
parent
5569b4fce1
commit
0e57149de9
@ -59,6 +59,10 @@ distro/minicd: distro/server-base
|
||||
@$(call set,KFLAVOURS,pure-emerald) # usually recent drivers
|
||||
@$(call add,MAIN_PACKAGES,etcnet-full)
|
||||
|
||||
distro/rescue: distro/.branding sub/rescue use/stage1kernel use/syslinux/ui-menu
|
||||
@$(call set,KFLAVOURS,un-def) # usually recent drivers too
|
||||
@$(call add,RESCUE_PACKAGES,etcnet-full)
|
||||
|
||||
# desktop distributions
|
||||
|
||||
distro/desktop-base: distro/installer sub/main \
|
||||
|
@ -1,7 +1,6 @@
|
||||
use/installer: sub/install2 use/syslinux/install2.cfg
|
||||
use/installer: use/stage1kernel sub/install2 use/syslinux/install2.cfg
|
||||
@$(call add,FEATURES,installer)
|
||||
@$(call set,INSTALL2_PACKAGES,installer-distro-$$(INSTALLER)-stage2)
|
||||
@$(call add,INSTALL2_PACKAGES,branding-$$(BRANDING)-alterator)
|
||||
@$(call add,MAIN_PACKAGES,branding-$$(BRANDING)-release)
|
||||
# @$(call set,BASE_LISTS,base)
|
||||
@$(call add,BASE_LISTS,$(call tags,basesystem))
|
||||
|
3
features.in/stage1kernel/README
Normal file
3
features.in/stage1kernel/README
Normal file
@ -0,0 +1,3 @@
|
||||
Эта фича предназначена для обобщения скриптовых хуков,
|
||||
нужных для различных live-образов, загружаемых с ядром
|
||||
из stage1 (инсталятор, спасательная и живая система).
|
2
features.in/stage1kernel/config.mk
Normal file
2
features.in/stage1kernel/config.mk
Normal file
@ -0,0 +1,2 @@
|
||||
use/stage1kernel: sub/stage1
|
||||
@$(call add,FEATURES,stage1kernel)
|
@ -1,4 +1,5 @@
|
||||
label rescue
|
||||
menu label ^Rescue LiveCD
|
||||
kernel alt0/vmlinuz
|
||||
append initrd=alt0/full.cz live fastboot stagename=rescue
|
||||
append initrd=alt0/full.cz live ramdisk_size=72000 fastboot stagename=rescue showopts automatic=method:cdrom
|
||||
### FIXME: see m-p-d::profiles/scripts.d/03-syslinux
|
||||
|
@ -4,9 +4,10 @@
|
||||
sub/%:
|
||||
@$(call add,SUBPROFILES,$(@:sub/%=%))
|
||||
|
||||
sub/install2: sub/stage1
|
||||
sub/install2 sub/rescue: sub/stage1
|
||||
|
||||
boot/%: distro/.init
|
||||
# FIXME: maybe syslinux feature belongs to distro/.init?
|
||||
boot/%: distro/.init use/syslinux
|
||||
@$(call set,BOOTLOADER,$*)
|
||||
|
||||
# initalize config from scratch, put some sane defaults in
|
||||
|
@ -1,13 +1,18 @@
|
||||
Этот каталог содержит субпрофили; содержимое заказанных
|
||||
в формируемый профиль (названия которых содержатся в значении
|
||||
переменной SUBPROFILES, которую обычно заполняют цели sub/* --
|
||||
см. ditro.mk в корневом каталоге) будет скопировано в каталог
|
||||
$(BUILDDIR)/image/.
|
||||
см. ../distro.mk) будет скопировано в каталог $(BUILDDIR)/image/.
|
||||
|
||||
Просьба ответственно относиться к модификации существующих
|
||||
и вдумчиво -- к созданию новых; возможно, достаточно всего лишь
|
||||
оформить нужное новой фичей (см. ../features.in/).
|
||||
|
||||
Новый субпрофиль технологически обоснован тогда, когда он может
|
||||
потребоваться одновременно с уже существующим схожим (поскольку
|
||||
сборка частей образа и происходит в каталогах субпрофилей, т.е.
|
||||
повторное использование одного субпрофиля в рамках одного уже
|
||||
сгенерированного профиля штатным образом невозможно).
|
||||
|
||||
Краткое описание существующих:
|
||||
|
||||
- stage1: propagator и загрузчик (при подключении фичи syslinux);
|
||||
@ -19,3 +24,5 @@ $(BUILDDIR)/image/.
|
||||
- main: пакетная база, укладываемая на образ (NB: поскольку рабочий
|
||||
чрут в этом случае не содержит ничего, кроме пакетов, добавлять
|
||||
image-scripts.d/* смысла нет, только scripts.d/*)
|
||||
|
||||
- rescue: спасательная система
|
||||
|
40
sub.in/rescue/Makefile
Normal file
40
sub.in/rescue/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
# step 4: build rescue subprofile (custom livecd)
|
||||
|
||||
ifndef GLOBAL_BUILDDIR
|
||||
$(error GLOBAL_BUILDDIR not defined)
|
||||
endif
|
||||
|
||||
default: all
|
||||
|
||||
include $(GLOBAL_BUILDDIR)/distcfg.mk
|
||||
include $(GLOBAL_BUILDDIR)/functions.mk
|
||||
include $(MKIMAGE_PREFIX)/config.mk
|
||||
|
||||
# this might have been prepared by ../stage1/scripts.d/03-test-kernel
|
||||
-include $(GLOBAL_BUILDDIR)/squashcfg.mk
|
||||
|
||||
# here we also try and come up with the stage1 kernel/modules, if any;
|
||||
# no kernel flavour specified will result in no modules for stage1 vmlinuz
|
||||
STAGE1_KFLAVOUR ?= $(lastword $(KFLAVOURS))
|
||||
|
||||
ifeq "$(STAGE1_KFLAVOUR)" ""
|
||||
$(error STAGE1_KFLAVOUR is utterly empty; cannot guess either)
|
||||
endif
|
||||
|
||||
# need kernel modules only (which require corresponding kernel-image);
|
||||
# these go into work chroot; NB: no vmlinuz there
|
||||
IMAGE_PACKAGES_REGEXP = $(call kpackages,$(STAGE1_KMODULES),$(STAGE1_KFLAVOUR))
|
||||
IMAGE_PACKAGES = $(COMMON_PACKAGES) \
|
||||
$(RESCUE_PACKAGES) \
|
||||
./packages
|
||||
|
||||
MKI_PACK_RESULTS = squash:rescue
|
||||
|
||||
include $(MKIMAGE_PREFIX)/targets.mk
|
||||
|
||||
all: | $(GLOBAL_DEBUG) build-image run-image-scripts pack-image \
|
||||
$(GLOBAL_CLEAN_WORKDIR)
|
||||
|
||||
debug:
|
||||
@echo "** rescue: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"
|
||||
@echo "** rescue: IMAGE_PACKAGES_REGEXP: $(IMAGE_PACKAGES_REGEXP)"
|
5
sub.in/rescue/README
Normal file
5
sub.in/rescue/README
Normal file
@ -0,0 +1,5 @@
|
||||
Этот каталог содержит субпрофиль "живой" второй стадии,
|
||||
подходящей для сборки спасательных образов.
|
||||
|
||||
Результат -- squashfs в файле rescue, подлежащем копированию
|
||||
в итоговый образ.
|
9
sub.in/rescue/image-scripts.d/50udev
Executable file
9
sub.in/rescue/image-scripts.d/50udev
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# for udev, "FATAL ERROR IN INIT: overmounting /image" otherwise
|
||||
ln -sf /proc/mounts /etc/mtab
|
||||
|
||||
# pam_console_apply is harmful during install
|
||||
find /etc/udev/rules.d/ -type f -print0 |
|
||||
xargs -r0 fgrep -Zl pam_console_apply -- |
|
||||
xargs -r0 rm -fv --
|
22
sub.in/rescue/image-scripts.d/85cleanup-cjk
Executable file
22
sub.in/rescue/image-scripts.d/85cleanup-cjk
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# remove unused fonts
|
||||
cd /usr/share/fonts/bitmap/misc/ &&
|
||||
rm -f *ja.* *ko.* han* gb* jis* k14* rk* *rk.* *kana* cl* *JIS*
|
||||
|
||||
# drop unneeded translations
|
||||
cd /usr/share/qt4/translations/ && rm -f *_zh* *_ja*
|
||||
|
||||
# l10n
|
||||
cd /usr/share/X11/locale && rm -rf ja* ko* th* vi* zh*
|
||||
|
||||
# xkb
|
||||
cd /usr/share/X11/xkb/symbols && rm -rf jp kr th vn cn
|
||||
|
||||
# locales
|
||||
cd /usr/lib*/locale && rm -rf ja_* ko_* th_* zh_*
|
||||
|
||||
# gconv
|
||||
cd /usr/lib*/gconv && rm -f JIS* T*
|
||||
|
||||
:
|
15
sub.in/rescue/image-scripts.d/85cleanup-legacy
Executable file
15
sub.in/rescue/image-scripts.d/85cleanup-legacy
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# remove unused legacy/tiny fonts
|
||||
cd /usr/share/fonts/bitmap/misc/ && rm -f *ISO* *KOI* [1456]*
|
||||
|
||||
# l10n
|
||||
cd /usr/share/X11/locale/ && rm -rf *[^C8]/ iso*
|
||||
|
||||
# xkb
|
||||
cd /usr/share/X11/xkb/symbols && rm -rf *_vndr
|
||||
|
||||
# gconv
|
||||
cd /usr/lib*/gconv && rm -f CP* ISO* *JIS* KOI* HP* MAC*
|
||||
|
||||
:
|
123
sub.in/rescue/image-scripts.d/90cleanup
Executable file
123
sub.in/rescue/image-scripts.d/90cleanup
Executable file
@ -0,0 +1,123 @@
|
||||
#!/bin/sh
|
||||
|
||||
# remove all docs
|
||||
rpmquery -adl |grep ^/ |xargs -r rm -f --
|
||||
rm -rf /usr/share/{doc,man,info,license,gfxboot}
|
||||
|
||||
# remove unused icons
|
||||
rm -rf /usr/share/icons/{hicolor,large,mini}
|
||||
|
||||
# remove PAM plugins
|
||||
rm -rf /lib*/security
|
||||
|
||||
# remove some unused files
|
||||
rm -rf /usr/share/ca-certificates
|
||||
rm -rf /usr/lib/qt4/plugins/codecs
|
||||
rm -f /usr/lib*/gconv/IBM*
|
||||
rm -f /usr/lib*/gconv/BIG5*
|
||||
rm -f /usr/lib*/gconv/EBCDIC*
|
||||
|
||||
# remove unneeded timezones
|
||||
rm -rf /usr/share/zoneinfo/{posix,right}/
|
||||
|
||||
# remove unneeded l10n
|
||||
find /usr/share/locale/ -type f \! -name 'alterator*' -delete
|
||||
|
||||
# remove non-utf8 locales
|
||||
find /usr/lib*/locale -mindepth 1 -maxdepth 1 -type d \! -name '*.utf8' -print0 |
|
||||
xargs -r0 rm -rf --
|
||||
|
||||
# xorg modules
|
||||
rm -r /usr/lib*/X11/modules/dri
|
||||
|
||||
# remove ogfs
|
||||
rm -f /lib*/evms/*/ogfs*
|
||||
|
||||
# remove cpp, gcc and perl
|
||||
rpmquery -a cpp\* gcc\* perl-base |
|
||||
xargs -r rpmi -e --nodeps --
|
||||
|
||||
# remove unneeded kernel modules
|
||||
rm -rf /lib/modules/*/kernel/arch
|
||||
rm -rf /lib/modules/*/kernel/drivers/atm
|
||||
rm -rf /lib/modules/*/kernel/drivers/char/ipmi
|
||||
rm -rf /lib/modules/*/kernel/drivers/char/watchdog
|
||||
rm -rf /lib/modules/*/kernel/drivers/cpufreq
|
||||
rm -rf /lib/modules/*/kernel/drivers/edac
|
||||
rm -rf /lib/modules/*/kernel/drivers/firmware ###
|
||||
rm -rf /lib/modules/*/kernel/drivers/hwmon
|
||||
rm -rf /lib/modules/*/kernel/drivers/infiniband ###
|
||||
rm -rf /lib/modules/*/kernel/drivers/input/{gameport,joy*}
|
||||
rm -rf /lib/modules/*/kernel/drivers/isdn
|
||||
rm -rf /lib/modules/*/kernel/drivers/media
|
||||
rm -rf /lib/modules/*/kernel/drivers/mmc
|
||||
rm -rf /lib/modules/*/kernel/drivers/mtd*
|
||||
rm -rf /lib/modules/*/kernel/drivers/net/irda
|
||||
rm -rf /lib/modules/*/kernel/drivers/net/wireless
|
||||
rm -rf /lib/modules/*/kernel/drivers/staging
|
||||
rm -rf /lib/modules/*/kernel/drivers/spi
|
||||
rm -rf /lib/modules/*/kernel/drivers/telephony
|
||||
rm -rf /lib/modules/*/kernel/drivers/usb/{misc,mon}
|
||||
rm -rf /lib/modules/*/kernel/drivers/w1
|
||||
rm -rf /lib/modules/*/kernel/fs/9p
|
||||
rm -rf /lib/modules/*/kernel/fs/adfs
|
||||
rm -rf /lib/modules/*/kernel/fs/affs
|
||||
rm -rf /lib/modules/*/kernel/fs/afs
|
||||
rm -rf /lib/modules/*/kernel/fs/autofs
|
||||
rm -rf /lib/modules/*/kernel/fs/autofs4
|
||||
rm -rf /lib/modules/*/kernel/fs/befs
|
||||
rm -rf /lib/modules/*/kernel/fs/bfs
|
||||
rm -rf /lib/modules/*/kernel/fs/btrfs
|
||||
rm -rf /lib/modules/*/kernel/fs/cifs
|
||||
rm -rf /lib/modules/*/kernel/fs/coda
|
||||
rm -rf /lib/modules/*/kernel/fs/configfs
|
||||
rm -rf /lib/modules/*/kernel/fs/cramfs
|
||||
rm -rf /lib/modules/*/kernel/fs/efs
|
||||
rm -rf /lib/modules/*/kernel/fs/freevxfs
|
||||
rm -rf /lib/modules/*/kernel/fs/fuse
|
||||
rm -rf /lib/modules/*/kernel/fs/hfs
|
||||
rm -rf /lib/modules/*/kernel/fs/hfsplus
|
||||
rm -rf /lib/modules/*/kernel/fs/hpfs
|
||||
rm -rf /lib/modules/*/kernel/fs/jffs
|
||||
rm -rf /lib/modules/*/kernel/fs/jffs2
|
||||
rm -rf /lib/modules/*/kernel/fs/lockd
|
||||
rm -rf /lib/modules/*/kernel/fs/minix
|
||||
rm -rf /lib/modules/*/kernel/fs/ncpfs
|
||||
rm -rf /lib/modules/*/kernel/fs/nilfs2
|
||||
rm -rf /lib/modules/*/kernel/fs/ocfs2
|
||||
rm -rf /lib/modules/*/kernel/fs/qnx4
|
||||
rm -rf /lib/modules/*/kernel/fs/smbfs
|
||||
rm -rf /lib/modules/*/kernel/fs/sysv
|
||||
rm -rf /lib/modules/*/kernel/fs/udf
|
||||
rm -rf /lib/modules/*/kernel/fs/ufs
|
||||
rm -rf /lib/modules/*/kernel/net/*/netfilter
|
||||
rm -rf /lib/modules/*/kernel/net/appletalk
|
||||
rm -rf /lib/modules/*/kernel/net/ax25
|
||||
rm -rf /lib/modules/*/kernel/net/bluetooth
|
||||
rm -rf /lib/modules/*/kernel/net/dccp
|
||||
rm -rf /lib/modules/*/kernel/net/decnet
|
||||
rm -rf /lib/modules/*/kernel/net/econet
|
||||
rm -rf /lib/modules/*/kernel/net/ipv6
|
||||
rm -rf /lib/modules/*/kernel/net/ipx
|
||||
rm -rf /lib/modules/*/kernel/net/irda
|
||||
rm -rf /lib/modules/*/kernel/net/netfilter
|
||||
rm -rf /lib/modules/*/kernel/net/netrom
|
||||
rm -rf /lib/modules/*/kernel/net/rose
|
||||
rm -rf /lib/modules/*/kernel/net/sctp
|
||||
rm -rf /lib/modules/*/kernel/net/tipc
|
||||
rm -rf /lib/modules/*/kernel/net/x25
|
||||
rm -rf /lib/modules/*/kernel/sound
|
||||
|
||||
# remove blacklisted kernel modules
|
||||
sed -n 's/^blacklist[[:space:]]\+\([^[:space:]]\+\).*/\1/p' /etc/modprobe.d/* |
|
||||
while read i; do
|
||||
find /lib/modules/ -type f -name "$i.ko" -delete
|
||||
done
|
||||
|
||||
# run depmod after kernel modules removal
|
||||
for i in /lib*/modules/*; do
|
||||
/sbin/depmod -a -F /boot/System.map-${i##*/} ${i##*/}
|
||||
done
|
||||
|
||||
# remove kernel images
|
||||
rm -rf /boot/*
|
21
sub.in/rescue/image-scripts.d/98systemM
Executable file
21
sub.in/rescue/image-scripts.d/98systemM
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# stage1 needs this
|
||||
mkdir -p /image
|
||||
|
||||
# m-p-d::profiles/rescue/image-scripts.d/999system
|
||||
mv -f -- /etc/inittab.rescue /etc/inittab
|
||||
|
||||
# enable NFS mounts
|
||||
chkconfig rpcbind on
|
||||
sed -i 's,#\(RPCBIND_ARGS="-l".*\),\1,' /etc/sysconfig/rpcbind
|
||||
|
||||
# remove unwanted startup scripts
|
||||
find /etc/rc.d/rc{2,3,4,5}.d/ -type l -name 'S*' \
|
||||
-not -name '*logd' \
|
||||
-not -name '*network' \
|
||||
-not -name '*rpcbind' \
|
||||
-not -name '*random' \
|
||||
-not -name '*sysreport' \
|
||||
-not -name '*udev*' \
|
||||
-delete -print
|
6
sub.in/rescue/image-scripts.d/99cleanupdb
Executable file
6
sub.in/rescue/image-scripts.d/99cleanupdb
Executable file
@ -0,0 +1,6 @@
|
||||
# remove rpm database
|
||||
rm -rf /var/lib/rpm/*
|
||||
|
||||
# remove apt data files
|
||||
rm -rf /var/cache/apt /var/lib*/apt
|
||||
|
141
sub.in/rescue/packages
Normal file
141
sub.in/rescue/packages
Normal file
@ -0,0 +1,141 @@
|
||||
udev
|
||||
e2fsprogs
|
||||
glibc-nss
|
||||
|
||||
firmware-linux
|
||||
firmware-aic94xx-seq
|
||||
|
||||
#altlinux-release
|
||||
interactivesystem
|
||||
|
||||
### Startup
|
||||
#kernel-image-@KERNEL@
|
||||
rootfiles
|
||||
sysvinit
|
||||
startup
|
||||
startup-rescue
|
||||
|
||||
udev
|
||||
|
||||
### Common
|
||||
coreutils
|
||||
glibc-locales
|
||||
glibc-nss
|
||||
glibc-utils
|
||||
lilo
|
||||
man
|
||||
man-pages
|
||||
sysfsutils
|
||||
sysklogd
|
||||
util-linux
|
||||
|
||||
### CPU utils
|
||||
cpuburn
|
||||
x86info
|
||||
|
||||
### Disk utils
|
||||
bonnie++
|
||||
cfdisk
|
||||
ddrescue
|
||||
disktype
|
||||
evms
|
||||
evms-ncurses
|
||||
gpart
|
||||
hdparm
|
||||
lvm2
|
||||
mdadm
|
||||
ms-sys
|
||||
parted
|
||||
sdparm
|
||||
sfdisk
|
||||
smartmontools
|
||||
testdisk
|
||||
mtools
|
||||
partimage
|
||||
|
||||
### Applications
|
||||
binutils
|
||||
dmidecode
|
||||
hexedit
|
||||
pciutils
|
||||
procps
|
||||
quota
|
||||
shadow-suite
|
||||
sharutils
|
||||
time
|
||||
openssl
|
||||
|
||||
### Applications/Archiving
|
||||
arj
|
||||
bzip2
|
||||
gzip
|
||||
unrar
|
||||
unzip
|
||||
zip
|
||||
|
||||
### Applications/Editors
|
||||
vim-console
|
||||
|
||||
### Applications/File
|
||||
findutils
|
||||
file
|
||||
less
|
||||
mtools
|
||||
|
||||
### Filesystem utils
|
||||
dosfstools
|
||||
e2fsprogs
|
||||
jfsprogs
|
||||
ntfs-3g
|
||||
recover
|
||||
recoverdm
|
||||
reiserfsprogs
|
||||
xfsprogs
|
||||
btrfs-progs
|
||||
|
||||
### Applications/Networking
|
||||
arpwatch
|
||||
bridge-utils
|
||||
dhcpcd
|
||||
elinks
|
||||
etcnet
|
||||
hostinfo
|
||||
ifrename
|
||||
iftop
|
||||
iproute2
|
||||
iptables
|
||||
iputils
|
||||
lftp
|
||||
mailx
|
||||
netcat
|
||||
netlist
|
||||
nfs-utils
|
||||
ngrep
|
||||
nmap
|
||||
openssh-clients
|
||||
openssh-server
|
||||
p0f
|
||||
postfix
|
||||
rsync
|
||||
scanssh
|
||||
#stunnel
|
||||
tcpdump
|
||||
tcptraceroute
|
||||
telnet
|
||||
traceroute
|
||||
wget
|
||||
whois
|
||||
wireless-tools
|
||||
wpa_supplicant
|
||||
|
||||
|
||||
### Applications/Shells
|
||||
ash
|
||||
bash
|
||||
bc
|
||||
gpm
|
||||
mc
|
||||
|
||||
### Development/Debuggers
|
||||
strace
|
||||
sysstat
|
Loading…
Reference in New Issue
Block a user