Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 16 years ago
parent
commit
2659ce1baa
5 changed files with 156 additions and 29 deletions
  1. +75
    -26
      package/target-finish/2nd-stage-livecd/2nd-stage-livecd.conf
  2. +12
    -0
      package/target-finish/2nd-stage-livecd/fixedfiles/etc_net_ifaces_default_options-eth
  3. +16
    -3
      package/target-finish/2nd-stage-livecd/fixedfiles/grml-x.init
  4. +45
    -0
      package/target-finish/2nd-stage-livecd/fixedfiles/network-setup.init
  5. +8
    -0
      package/target-finish/initramfs/files/initramfs-livecd/linuxrc.sh

+ 75
- 26
package/target-finish/2nd-stage-livecd/2nd-stage-livecd.conf

@ -42,6 +42,9 @@ install_pkg() {
done
}
# get the default kernel version
. $base/package/*/linux/kernelversion.sh
second_stage_mainfunction ()
{
if [ "$ROCK_BUILD_TARGET" != 1 ] ; then
@ -55,6 +58,9 @@ second_stage_mainfunction ()
if [ "$create_livecd" = 1 ] ; then
#
echo "Creating 2nd stage filesystem:"
# Unmount lingering dev and proc mounts from postinstall run, if any.
umount -l $disksdir/2nd_stage-livecd/{dev,proc} || true
rm -rf $disksdir/2nd_stage-livecd
mkdir -p $disksdir/2nd_stage-livecd
cd $disksdir/2nd_stage-livecd
@ -67,29 +73,42 @@ second_stage_mainfunction ()
xpkg="${pkg#*=}" ; pkg="${pkg%=*}"
for pkgfile in $( pkg_file $xpkg ) ; do
if [ -z "${pkgfile##*:doc*}" ]
then
# simply ignore :doc packages
case "$pkgfile" in
*:doc*|*linux*-source*)
# simply ignore :doc or kernel source packages
continue
else
;;
*)
echo "- Extracting $pkgfile ..."
install_pkg $pkgfile
fi
;;
esac
done
done
#
echo "Running ldconfig to create links ..."
ldconfig -r .
#
echo "Running depmod for target system ..."
depmod -b $PWD -F boot/System.map $pkg_linux_default_release
echo "Running mkfontscale/mkfontdir and fc-cache ..."
for dir in usr/X11R7/lib/X11/fonts/* ; do
[ -d $dir ] || continue
mkfontscale $dir
mkfontdir $dir
fc-cache -v $dir
done
if [ $stagelevel -ge 3 ] ; then
echo "Running postinstall scripts ..."
# Copy instead of bind-mount so /dev can't accidentially
# be deleted through $PWD/dev.
mount -n tmpfs $PWD/dev -t tmpfs ; cp -a /dev/* $PWD/dev/
mount -n proc $PWD/proc -t proc
# Disable flwrapper in this chroot, it isn't installed anyway.
LD_PRELOAD="" chroot $PWD bash -l -c "postinstall -a"
umount -n -l $PWD/dev $PWD/proc
else
echo "Running lcdonfig ..."
ldconfig -r .
#
echo "Running depmod for target system ..."
depmod -b $PWD -F boot/System.map $kernelversion
echo "Running mkfontscale/mkfontdir and fc-cache ..."
for dir in usr/X11R7/lib/X11/fonts/* ; do
[ -d $dir ] || continue
mkfontscale $dir
mkfontdir $dir
fc-cache -v $dir
done
fi
#
echo "Creating 2nd_stage-livecd.img image (this takes some time)... "
@ -112,29 +131,59 @@ second_stage_mainfunction ()
mkdir -p $disksdir/2nd_stage-overlay
cd $disksdir/2nd_stage-overlay
echo "Replacing some vital files for live useage ..."
# Set hostname
mkdir -p etc
echo "rock-linux-live" > etc/HOSTNAME
# Configure etcnet if installed
if pkginstalled etcnet ; then
mkdir -p etc/net/ifaces/default
cp -a $confdir/fixedfiles/etc_net_ifaces_default_options-eth \
etc/net/ifaces/default/options-eth
fi
mkdir -p etc/conf
echo 'export XDM="/usr/bin/kdm"' > etc/conf/xdm
# Use the first X11 display manager found; if none is found
# /usr/X11/bin/xdm will be used.
for x in /opt/kde{4,}/bin/kdm /usr/bin/kdm ; do
if [ -e "$x" ] ; then
echo "export XDM='$x'" > etc/conf/xdm
break
fi
done
mkdir -p etc/X11 sbin
cp -f $confdir/fixedfiles/inittab etc/inittab
# set default runlevel
cp -f $disksdir/2nd_stage-livecd/etc/inittab etc/
sed -i -e "s,\(.*\):.:\(initdefault:.*\),\1:5:\2," etc/inittab
cp -f $confdir/fixedfiles/login-shell sbin/login-shell
# this got drop once, so we ensure it's +xed.
chmod 0755 sbin/login-shell
mkdir -p etc/rc.d/{init,rc{1,2,3,4,5,X}}.d
# init script for automatically creating xorg.conf
root=. install_init grml-x $confdir/fixedfiles/grml-x.init
# init script for automatically configuring (eth) network devices
root=. install_init network-setup $confdir/fixedfiles/network-setup.init
#
echo "Creating home directories and users..."
mkdir -p home/{rocker,root}
chown 1000:100 home/rocker
cp -a ../2nd_stage-livecd/etc/{passwd,shadow,group} etc/
sed -i -e 's,root:.*,root:x:0:0:root:/home/root:/bin/bash,' etc/passwd
sed -i -e 's,root:.*,root:$1$6BYmvnok$F5z/SyZQr7MuBU7l19lgW/:13300:0:99999:7:::,' etc/shadow
echo 'rocker:x:1000:100:ROCK Live CD User:/home/rocker:/bin/bash' >> etc/passwd
# Set root and rocker passwords
sed -i -e 's,^root:.*,root:x:0:0:root:/home/root:/bin/bash,' etc/passwd
sed -i -e 's,^root:.*,root:$1$6BYmvnok$F5z/SyZQr7MuBU7l19lgW/:13300:0:99999:7:::,' etc/shadow
echo 'rocker:x:1000:100:ROCK Linux Live User (password is rock):/home/rocker:/bin/bash' >> etc/passwd
echo 'rocker:$1$b3mL1k/q$zneIjKcHqok1T80fp1cPI1:13300:0:99999:7:::' >> etc/shadow
sed -i -e 's,wheel:x:10:,wheel:x:10:rocker,' etc/group
sed -i -e 's,video:x:16:,video:x:16:rocker,' etc/group
sed -i -e 's,sound:x:17:,sound:x:17:rocker,' etc/group
sed -i -e 's,cdrom:x:29:,cdrom:x:29:rocker,' etc/group
# Add user to various groups
for group in wheel cdrom sound audio video polkituser plugdev ; do
sed -i -e "/^$group:/ { s+\(.*\):\(.*\)+\1:rocker,\2+ ; s+,$++ ; }" etc/group
done
#
echo "Creating 2nd_stage-livecd.img image... (this takes some time)... "
cd $disksdir

+ 12
- 0
package/target-finish/2nd-stage-livecd/fixedfiles/etc_net_ifaces_default_options-eth

@ -0,0 +1,12 @@
# This file doesn't contain comments any more.
# For detailed options description refer to etcnet-options(5) manpage,
# section 'Ethernet options'.
BOOTPROTO=dhcp-ipv4ll
CONFIG_WIRELESS=yes
USE_IFPLUGD=auto
PERSISTENT_IFPLUGD=yes
IFPLUGD_EXTRA_ARGS='--delay-up=0 --delay-down=10'
LINKDETECT=auto
AUTO_BROADCAST=yes

+ 16
- 3
package/target-finish/2nd-stage-livecd/fixedfiles/grml-x.init

@ -28,10 +28,23 @@
[ "$1" = stop ] && exit 0
grml_x_create_xorg_conf()
{
local XDM="/usr/X11/bin/xdm"
[ -f /etc/conf/xdm ] && . /etc/conf/xdm
check(`grml-x -force -nostart $XDM')
}
main_begin
block_begin(start, `Creating X server configuration with grml-x.')
XDM="kdm"
[ -f /etc/conf/xdm ] && . /etc/conf/xdm
check(`grml-x -force -nostart $XDM')
if [ -f "/etc/conf/X11/xorg.conf" ] ; then
echo "/etc/conf/X11/xorg.conf already exists, doing nothing ..."
else
grml_x_create_xorg_conf
fi
block_end
block_begin(restart, `Re-creating X server configuration with grml-x.')
grml_x_create_xorg_conf
block_end
main_end

+ 45
- 0
package/target-finish/2nd-stage-livecd/fixedfiles/network-setup.init

@ -0,0 +1,45 @@
#!/bin/sh
#
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/base/sysfiles/system.init
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
#
# Desc: Network Device Auto-Configuration
# Runlevel: 13 rcX rc3 rc4 rc5
#
[ "$1" = stop ] && exit 0
main_begin
block_begin(start, `Adding eth network interfaces to etcnet configuration.')
ifaces="$( ip link show | sed -e"s,^[0-9]: \([^:]*\).*,\1,p ; d" )"
for x in $ifaces ; do
[ -e "/etc/net/ifaces/$x/options" ] && continue
case $x in
eth*)
mkdir -p /etc/net/ifaces/$x
touch /etc/net/ifaces/$x/options
;;
esac
done
block_end
main_end

+ 8
- 0
package/target-finish/initramfs/files/initramfs-livecd/linuxrc.sh

@ -4,10 +4,18 @@ echo "$0: $*"
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export PATH
[ -z "$autoboot" ] && autoboot=0
if [ "$autoboot" -eq 0 ] ; then
echo "Interactive stage 1, spawning /bin/bash. Exit to continue booting..."
/bin/bash
fi
for x in /init.d/*
do
. $x
done
while : ; do
echo "going real..."
if [ -x /real-root/sbin/init ] ; then

Loading…
Cancel
Save