diff -Naur slackware-live-0.4.1-orig/scripts/build-slackware-live.sh slackware-live-0.4.1/scripts/build-slackware-live.sh --- slackware-live-0.4.1-orig/scripts/build-slackware-live.sh 2015-07-18 13:46:20.800153443 +0300 +++ slackware-live-0.4.1/scripts/build-slackware-live.sh 2015-07-18 14:30:59.841295933 +0300 @@ -1,11 +1,18 @@ #!/bin/sh +LIVELABEL="LIVE" #edit in init script too + CMDERROR=1 PARTITIONERROR=2 FORMATERROR=3 BOOTERROR=4 INSUFFICIENTSPACE=5 +if [ `uname -m` == "x86_64" ] +then grublibdir="/usr/lib64/grub" +else grublibdir="/usr/lib/grub" +fi + function add_packages() { packagesdirectory=$1 rootdirectory=$2 @@ -57,9 +64,9 @@ umount $rootdirectory/proc rm -f $rootdirectory/tmp/initrd.gz rm -f $rootdirectory/tmp/initrd-tree/{initrd-name,keymap,luksdev,resumedev,rootfs,rootdev,wait-for-root} - cp $initscriptbasepath/share/slackware-live/init $rootdirectory/tmp/initrd-tree/ + cp $initscriptbasepath/share/slackware-live/{init,keymaps} $rootdirectory/tmp/initrd-tree/ chmod +x $rootdirectory/tmp/initrd-tree/init - + cp $initscriptbasepath/sbin/build-slackware-live.sh $rootdirectory/tmp/initrd-tree/ for prg in unionfs mkfs.ext3; do @@ -86,18 +93,23 @@ #BIOS/syslinux mkdir -p $livedirectory/boot/syslinux cp /usr/share/syslinux/menu.c32 $livedirectory/boot/syslinux/ + cp /usr/share/syslinux/vesamenu.c32 $livedirectory/boot/syslinux/ if [ ! -f $livedirectory/boot/syslinux/syslinux.cfg ]; then cat > $livedirectory/boot/syslinux/syslinux.cfg << EOF -prompt 1 -timeout 10 -default slackware - -label slackware - kernel /boot/vmlinuz - append max_loop=255 initrd=/boot/initrd.gz runlevel=5 +INCLUDE /boot/menus/mainmenu.cfg EOF fi + #Copy menus,splash image + if [ -d menus ]; then + cp -r menus $livedirectory/boot/ + cp salix.png relinfo.msg $livedirectory/boot/syslinux/ + fi + +# if [ -d install_on_usb ]; then +# cp install_on_usb/* $livedirectory/boot/syslinux/ +# fi + #UEFI/elilo if [ `uname -m` == "x86_64" ]; then mkdir -p $livedirectory/EFI/BOOT @@ -105,17 +117,23 @@ cp $livedirectory/boot/initrd.gz $livedirectory/EFI/BOOT/ cp $livedirectory/boot/vmlinuz $livedirectory/EFI/BOOT/ if [ ! -f $livedirectory/EFI/BOOT/elilo.conf ]; then - cat > $livedirectory/EFI/BOOT/elilo.conf << EOF -prompt -timeout=10 -default=slackware - -image=vmlinuz - label=slackware - initrd=initrd.gz - append="max_loop=255 runlevel=5" -EOF + if [ -d ../common/elilo ]; then + cp ../common/elilo/* $livedirectory/EFI/BOOT/ + fi fi + +# if [ ! -f $livedirectory/EFI/BOOT/elilo.conf ]; then +# cat > $livedirectory/EFI/BOOT/elilo.conf << EOF +#prompt +#timeout=10 +#default=salix +# +#image=vmlinuz +# label=salix +# initrd=initrd.gz +# append="max_loop=255 runlevel=4" +#EOF +# fi dd if=/dev/zero of=/tmp/efi.img bs=1k count=16384 mkdosfs -n "EFIBOOT" /tmp/efi.img mount -o loop /tmp/efi.img /mnt/floppy @@ -253,7 +271,7 @@ if [ `uname -m` == "x86_64" ]; then altboot="-eltorito-alt-boot -no-emul-boot -eltorito-platform efi -eltorito-boot efi.img" fi - mkisofs -J -d -N -l -r -V "Slackware-Live" -hide-rr-moved -o $imagefilename \ + mkisofs -J -d -N -l -r -V "$LIVELABEL" -hide-rr-moved -o $imagefilename \ -b boot/syslinux/isolinux.bin -boot-load-size 4 -boot-info-table -no-emul-boot \ -c boot/syslinux/boot.catalog -hide boot.catalog -hide-joliet boot.catalog $altboot \ $livedirectory @@ -273,13 +291,18 @@ if [ "$installdevice" == "$installmedia" ]; then #install on whole disk: partition and format media if [ `uname -m` == "x86_64" ]; then #EFI/GPT - partitionnumber=2 + partitionnumber=1 installmedia="$installdevice$partitionnumber" dd if=/dev/zero of=$installdevice bs=512 count=34 >/dev/null 2>&1 - echo -e "2\nn\n\n\n+32M\nef00\nn\n\n\n\n\nr\nh\n1 2\nn\n\ny\n\nn\n\nn\nwq\ny\n" | gdisk $installdevice || return $PARTITIONERROR + #echo -e "2\nn\n\n\n+32M\nef00\nn\n\n\n\n0700\nr\nh\n1 2\nn\n\ny\n\nn\n\nn\nwq\ny\n" | gdisk $installdevice || return $PARTITIONERROR + echo -e "2\nn\n\n\n\n0700\nr\nh\n1 2\nn\n\ny\n\nn\n\nn\nwq\ny\n" | gdisk $installdevice || return $PARTITIONERROR + #hybrid MBR with BIOS boot partition (1007K) EFI partition (32M) and live partition + #echo -e "2\nn\n\n\n+32M\nef00\nn\n\n\n\n0700\nn\n128\n\n\nef02\nr\nh\n1 2\nn\n\ny\n\nn\nn\nwq\ny\n" | gdisk $installdevice || return $PARTITIONERROR partprobe $installdevice >/dev/null 2>&1; sleep 3 mkfs.fat -n "efi" $installdevice"1" || return $FORMATERROR - mkfs.ext3 -L "Slackware-Live" $installmedia || return $FORMATERROR + #mkfs.ext3 -L "$LIVELABEL" $installmedia || return $FORMATERROR + fat32option="-F 32" + mkfs.vfat $fat32option -n "$LIVELABEL" $installmedia || return $FORMATERROR else #BIOS/MBR partitionnumber=4 installmedia="$installdevice$partitionnumber" @@ -289,9 +312,12 @@ fi mkdiskimage $installdevice 1 $heads $sectors || return $PARTITIONERROR dd if=/dev/zero of=$installdevice bs=1 seek=446 count=64 >/dev/null 2>&1 - echo -e ',0\n,0\n,0\n,,83,*' | sfdisk $installdevice || return $PARTITIONERROR + #echo -e ',0\n,0\n,0\n,,83,*' | sfdisk $installdevice || return $PARTITIONERROR + echo -e ',0\n,0\n,0\n,,b,*' | sfdisk $installdevice || return $PARTITIONERROR partprobe $installdevice; sleep 3 - mkfs.ext3 -L "Slackware-Live" $installmedia || return $FORMATERROR + #mkfs.ext3 -L "$LIVELABEL" $installmedia || return $FORMATERROR + fat32option="-F 32" + mkfs.vfat $fat32option -n "$LIVELABEL" $installmedia || return $FORMATERROR fi sleep 3 @@ -310,7 +336,7 @@ fi case $partitiontype in 83|8300) - mkfs.ext3 -L "Slackware-Live" $installmedia || return $FORMATERROR + mkfs.ext3 -L "$LIVELABEL" $installmedia || return $FORMATERROR ;; *) partition=`echo $installmedia | cut -c6-` @@ -319,30 +345,30 @@ if (( $size > 1024 )); then fat32option="-F 32" fi - mkfs.fat $fat32option -n "Slackware-Live" $installmedia || return $FORMATERROR + mkfs.fat $fat32option -n "$LIVELABEL" $installmedia || return $FORMATERROR esac sleep 3 fi fi #live system files copy - if [ `uname -m` == "x86_64" ]; then #EFI/GPT - efipartition="$installdevice"`gdisk -l $installdevice 2>/dev/null | grep " EF00 " | sed 's/ */:/g' | cut -f2 -d:` - if [ ! -z "$efipartition" ] && [ "$efipartition" != "$installmedia" ]; then - mkdir -p /mnt/tmp - if mount $efipartition /mnt/tmp >/dev/null 2>&1; then - sleep 1 - umount /mnt/tmp - else - mkfs.fat -n "efi" $efipartition || return $FORMATERROR - fi - mkdir -p /mnt/efi - mount $efipartition /mnt/efi - cp -r $livedirectory/EFI /mnt/efi/ - umount /mnt/efi - rmdir /mnt/efi - fi - fi +# if [ `uname -m` == "x86_64" ]; then #EFI/GPT +# efipartition="$installdevice"`gdisk -l $installdevice 2>/dev/null | grep " EF00 " | sed 's/ */:/g' | cut -f2 -d:` +# if [ ! -z "$efipartition" ] && [ "$efipartition" != "$installmedia" ]; then +# mkdir -p /mnt/tmp +# if mount $efipartition /mnt/tmp >/dev/null 2>&1; then +# sleep 1 +# umount /mnt/tmp +# else +# mkfs.fat -n "efi" $efipartition || return $FORMATERROR +# fi +# mkdir -p /mnt/efi +# mount $efipartition /mnt/efi +# cp -r $livedirectory/EFI /mnt/efi/ +# umount /mnt/efi +# rmdir /mnt/efi +# fi +# fi mkdir -p /mnt/install mount $installmedia /mnt/install @@ -374,21 +400,77 @@ rootdirectory=$1 systempart=$2 loadersetup=$3 - SYSINSTALLFS="ext4" + username=$4 + userpassword=$5 + installation_mode=$6 + home_dir=$7 + bootloader=$8 - mkfs.$SYSINSTALLFS $systempart || return $FORMATERROR + SYSINSTALLFS="ext4" # set default filesystem of root mkdir -p /mnt/install + + if mount $systempart /mnt/install 2>/dev/null; then # if there is a filesystem find it + fs=`mount | grep "$systempart" | cut -f5 -d' '` + if echo $fs | grep -q "ext" || echo $fs | grep -q "brtfs" || echo $fs | grep -q "reiser"|| echo $fs | grep -q "xfs"; then + SYSINSTALLFS=$fs # find filesystem type + fi + umount /mnt/install + fi + mkfs.$SYSINSTALLFS $systempart || return $FORMATERROR # format partition + mount $systempart /mnt/install + #handles home partition + if [ "$home_dir" != "" ] && [ "$home_dir" != "$systempart" ]; then + mkdir -p /mnt/install/home + if ! mount $home_dir /mnt/install/home 2>/dev/null; then + mkfs.$SYSINSTALLFS $home_dir + mount $home_dir /mnt/install/home + fi + #fs=`mount | grep "$home_dir" | cut -f5 -d' '` + #if echo $fs | grep -q "ext" || echo $fs | grep -q "brtfs" || echo $fs | grep -q "reiser"|| echo $fs | grep -q "xfs"; then + # echo "$home_dir /home $fs defaults 1 1" >> /mnt/install/etc/fstab + #fi + fi + #Copy begin - for directory in $rootdirectory/*; do - cp -dpr $directory /mnt/install/ - done + echo "Installing system" + # core, basic or full mode + if [ "$installation_mode" = "core" ]; then + echo "core installation" + modules=(01-core.slm 04-common.slm 05-kernel.slm 06-live.slm) + for directory in ${modules[@]}; do + cp -dpr $rootdirectory/$directory/* /mnt/install/ + done + fi + + if [ "$installation_mode" = "basic" ]; then + echo "basic installation" + modules=(01-core.slm 02-basic.slm 04-common.slm 05-kernel.slm 06-live.slm) + for directory in ${modules[@]}; do + cp -dpr $rootdirectory/$directory/* /mnt/install/ + done + fi + + if [ "$installation_mode" = "full" ]; then + echo "full installation" + modules=(01-core.slm 02-basic.slm 03-full.slm 04-common.slm 05-kernel.slm 06-live.slm) + for directory in ${modules[@]}; do + cp -dpr $rootdirectory/$directory/* /mnt/install/ + done + + #for directory in $rootdirectory/*; do + #cp -dpr $directory /mnt/install/ + #done + fi mkdir -p /mnt/install/{dev,proc,sys,tmp} cp -dpr /dev/sd* /mnt/install/dev/ #create disk nodes needed for LiLo - cp -dpr $rootdirectory/lib/udev/devices/* /mnt/install/dev/ + if [ "$rootdirectory" = "/live/modules" ]; then + cp -dpr /live/system/lib/udev/devices/* /mnt/install/dev/ + fi + #cp -dpr $rootdirectory/lib/udev/devices/* /mnt/install/dev/ sed -i /^root:/d /mnt/install/etc/shadow #setup root password cat /etc/shadow | sed -n /^root:/p >> /mnt/install/etc/shadow @@ -397,8 +479,8 @@ cp -f /etc/rc.d/rc.keymap /mnt/install/etc/rc.d/ fi cp -f /etc/profile.d/lang.sh /mnt/install/etc/profile.d/ - if [ -f /etc/X11/xorg.conf.d/20-keyboard.conf ]; then - cp -f /etc/X11/xorg.conf.d/20-keyboard.conf /mnt/install/etc/X11/xorg.conf.d/ + if [ -f /etc/X11/xorg.conf.d/10-keymap.conf ]; then + cp -f /etc/X11/xorg.conf.d/10-keymap.conf /mnt/install/etc/X11/xorg.conf.d/ fi if [ -f /etc/X11/xorg.conf ]; then cp -f /etc/X11/xorg.conf /mnt/install/etc/X11/ @@ -411,23 +493,75 @@ cp -f /etc/hardwareclock /mnt/install/etc/ fi #Copy end - + echo "Setting up fstab" #FSTab begin cat > /mnt/install/etc/fstab << EOF proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 +tmpfs /dev/shm tmpfs defaults 0 0 $systempart / $SYSINSTALLFS defaults 1 1 EOF + + if [ "$home_dir" != "" ] && [ "$home_dir" != "$systempart" ]; then + fs=`mount | grep "$home_dir" | cut -f5 -d' '` + if echo $fs | grep -q "ext" || echo $fs | grep -q "brtfs" || echo $fs | grep -q "reiser"|| echo $fs | grep -q "xfs"; then + echo "$home_dir /home $fs defaults 1 1" >> /mnt/install/etc/fstab + fi + fi + cat /etc/fstab | grep " swap " >> /mnt/install/etc/fstab - cat /etc/fstab | grep "/mnt" | grep -v "$systempart" >> /mnt/install/etc/fstab - cat /etc/fstab | grep "/mnt" | grep -v "$systempart" | cut -f2 -d' ' | while read mountpoint; do - mkdir /mnt/install$mountpoint - done + #cat /etc/fstab | grep "/mnt" | grep -v "$systempart" >> /mnt/install/etc/fstab + #cat /etc/fstab | grep "/mnt" | grep -v "$systempart" | cut -f2 -d' ' | while read mountpoint; do + # mkdir /mnt/install$mountpoint + #done echo "$systempart / $SYSINSTALLFS defaults 1 1" > /mnt/install/etc/mtab #FSTab end - + + # First, determine our slackware kernel name: + for ELEMENT in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do + if $(cat /proc/cmdline | cut -f $ELEMENT -d ' ' | grep -q BOOT_IMAGE) ; then + SLACK_KERNEL=$(cat /proc/cmdline | cut -f $ELEMENT -d ' ' | cut -f 2 -d = | sed "s/\/boot\///") + fi + done + unset ELEMENT + + # Next, find the kernel's release version: + VERSION=$(uname -r | tr - _) + + # Next find our initrd name + for ELEMENT in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do + if $(cat /proc/cmdline | cut -f $ELEMENT -d ' ' | grep -q initrd) ; then + SLACK_INITRD=$(cat /proc/cmdline | cut -f $ELEMENT -d ' ' | cut -f 2 -d = | sed "s/\/boot\///") + fi + done + unset ELEMENT + + ( cd /mnt/install/boot + if [ "$SLACK_KERNEL" == "vmlinuz" ]; then + if [ -r vmlinuz-huge-smp-$VERSION ]; then + ln -sf vmlinuz-huge-smp-$VERSION vmlinuz + ln -sf config-huge-smp-$VERSION config + ln -sf System.map-huge-smp-$VERSION System.map + fi + fi + + if [ "$SLACK_KERNEL" == "vmlinuznp" ]; then + if [ -r vmlinuz-huge-$VERSION ]; then + ln -sf vmlinuz-huge-$VERSION vmlinuz + ln -sf config-huge-$VERSION config + ln -sf System.map-huge-$VERSION System.map + fi + fi + + if [ "$SLACK_INITRD" == "nosmp.gz" ]; then + cp initrd.gz smp.gz + cp nosmp.gz initrd.gz + fi + ) + #InitRD begin if [ ! -f /mnt/install/boot/initrd.gz ]; then + echo "Setting initrd" kv=`basename /mnt/install/lib/modules/*` if lsmod | grep -q $SYSINSTALLFS; then moduleslist="$SYSINSTALLFS" @@ -451,10 +585,11 @@ fi fi #InitRD end - + if [ "$bootloader" == "lilo" ]; then #LiLo begin if [ "$loadersetup" == "-auto" ]; then installdevice=`echo $systempart | cut -c1-8` + echo "Setting (e)Lilo" if [ -d /sys/firmware/efi ]; then #UEFI modprobe efivars efipartnum=`gdisk -l $installdevice | grep "EF00" | sed 's/ \+/ /g' | cut -f2 -d' '` @@ -462,7 +597,7 @@ if [ ! -z "$efipartition" ]; then mkdir -p /mnt/efi mount $efipartition /mnt/efi - efilabel="Slackware" + efilabel="Salix" if [ -d /mnt/efi/EFI/$efilabel ]; then conflictpart=`cat /mnt/efi/EFI/$efilabel/elilo.conf | grep "append" | sed 's/.*root=\([^ ]*\).*/\1/'` if [ "$conflictpart" == "$systempart" ] @@ -476,10 +611,10 @@ cp /mnt/install/boot/vmlinuz /mnt/efi/EFI/$efilabel/ cat > /mnt/efi/EFI/$efilabel/elilo.conf << EOF timeout=1 -default=slackware +default=salix image=vmlinuz - label=slackware + label=salix append="root=$systempart ro" read-only EOF @@ -489,14 +624,14 @@ fi umount /mnt/efi rmdir /mnt/efi - efibootmgr -q -c -d $installdevice -p $efipartnum -l "\\EFI\\$efilabel\\elilo.efi" -L "Slackware ($systempart)" + efibootmgr -q -c -d $installdevice -p $efipartnum -l "\\EFI\\$efilabel\\elilo.efi" -L "Salix ($systempart)" fi else #BIOS echo "boot = $installdevice" > /mnt/install/etc/lilo.conf - if [ -f /mnt/install/boot/slack.bmp ]; then + if [ -f /mnt/install/boot/salix.bmp ]; then cat >> /mnt/install/etc/lilo.conf << EOF -bitmap = /boot/slack.bmp +bitmap = /boot/salix.bmp bmp-colors = 255,0,255,0,255,0 bmp-table = 60,6,1,16 bmp-timer = 65,27,0,255 @@ -514,7 +649,7 @@ image = /boot/vmlinuz root = $systempart -label = Linux +label = salix read-only EOF if [ -f /mnt/install/boot/initrd.gz ]; then @@ -534,7 +669,200 @@ chroot /mnt/install umount /proc fi fi - #LiLo end + fi #LiLo end + + if [ "$bootloader" == "grub" ]; then + #grub begin + if [ "$loadersetup" == "-auto" ]; then + grustatus=$GRUBERROR + installdevice=`echo $systempart | cut -c1-8` + echo "Installing Grub Boot Loader on $installdevice" + efipartnum=`gdisk -l $installdevice 2>/dev/null | grep " EF00 " | sed 's/ */:/g' | cut -f2 -d:` + #if [ -d /sys/firmware/efi ] && [ ! -z "$efipartnum" ]; then #EFI + if [ ! -z "$efipartnum" ] && [ -d $grublibdir/x86_64-efi ]; then + efipartition="$installdevice$efipartnum" + #modprobe efivars #for efibootmgr; unneded here: done by grub install + mkdir -p /mnt/efi + mount $efipartition /mnt/efi + if [ `uname -m` != "x86_64" ] ; then #modprobe efivars fails on 32 bits Slackware + mv /lib/modules/`uname -r`/kernel/drivers/firmware/efi/efivars.{ko,ok} + efidir="slackware-`cat /etc/slackware-version | cut -f2 -d' '`" + echo "*** add boot entry for '\\EFI\\$efidir\\grubx64.efi' from UEFI setup ***" + fi + grub-install --efi-directory /mnt/efi --boot-directory /mnt/install/boot/ --target=x86_64-efi 2>/dev/null && grubstatus=0 + umount /mnt/efi + else #CSM + if echo -e "print\nquit" | parted $installdevice | grep -q ": msdos$" || + gdisk -l $installdevice 2>/dev/null | grep -q " EF02 "; then + grub-install --target=i386-pc --boot-directory /mnt/install/boot $installdevice && grubstatus=0 #grub-bios-setup + else + echo "Warning : GRUB can't be installed:" + #if [ -d /sys/firmware/efi ]; then + if [ -z "$efipartnum" ]; then + echo "- UEFI boot: no 'ef00' - efi partition on $installdevice" + else + echo "- CSM (legacy) boot: no 'ef02' - BIOS boot partition on $installdevice (GPT)" + fi + fi + fi + for dir in sys proc dev; do mount --bind /$dir /mnt/install/$dir; done + chroot /mnt/install grub-mkconfig -o /boot/grub/grub.cfg + for dir in sys proc dev; do umount /mnt/install/$dir; done + fi + fi # end grub + + liveuser=$(cat /etc/passwd | grep /bin/bash | grep /home/| cut -d : -f 1) + if [ "$liveuser" != "" ]; then + echo "Deleting liveuser $liveuser" + chroot /mnt/install mount /proc + chroot /mnt/install /usr/sbin/userdel -r $liveuser 2>/dev/null + chroot /mnt/install umount /proc + fi + + if [ "$username" != "" ]; then + echo "Creating user $username with password $userpassword" + chroot /mnt/install mount /proc + chroot /mnt/install /usr/sbin/useradd -s /bin/bash -g users -m -k /etc/skel -G lp,floppy,audio,video,cdrom,plugdev,power,netdev,scanner,wheel "$username" + chroot /mnt/install umount /proc + fi + + if [ "$userpassword" != "" ]; then + echo "Setting password for user $username to $userpassword" + chroot /mnt/install mount /proc + echo ${username}:${userpassword} | chroot /mnt/install chpasswd + chroot /mnt/install umount /proc + fi + + if [ -f /mnt/install/etc/kde/kdm/kdmrc ]; then + sed -i "s/NoPassEnable=.*/NoPassEnable=/g" /mnt/install/etc/kde/kdm/kdmrc + sed -i "s/NoPassUsers=.*/NoPassUsers=/g" /mnt/install/etc/kde/kdm/kdmrc + sed -i "s/DefaultUser=.*/DefaultUser=/g" /mnt/install/etc/kde/kdm/kdmrc + sed -i "s/AllowNullPasswd=.*/AllowNullPasswd=/g" /mnt/install/etc/kde/kdm/kdmrc + sed -i "s/AutoLoginEnable=.*/AutoLoginEnable=/g" /mnt/install/etc/kde/kdm/kdmrc + sed -i "s/AutoLoginUser=.*/AutoLoginUser=/g" /mnt/install/etc/kde/kdm/kdmrc + fi + + + if [ -f /mnt/install/etc/gdm/custom.conf ]; then + cat > /mnt/install/etc/gdm/custom.conf << EOF +# GDM Custom Configuration file. +# +# This file is the appropriate place for specifying your customizations to the +# GDM configuration. If you run gdmsetup, it will automatically edit this +# file for you and will cause the daemon and any running GDM GUI programs to +# automatically update with the new configuration. Not all configuration +# options are supported by gdmsetup, so to modify some values it may be +# necessary to modify this file directly by hand. +# +# This file overrides the default configuration settings. These settings +# are stored in the GDM System Defaults configuration file, which is found +# at the following location. +# +# /usr/share/gdm/defaults.conf. +# +# This file contains comments about the meaning of each configuration option, +# so is also a useful reference. Also refer to the documentation links at +# the end of this comment for further information. In short, to hand-edit +# this file, simply add or modify the key=value combination in the +# appropriate section in the template below this comment section. +# +# For example, if you want to specify a different value for the Enable key +# in the "[debug]" section of your GDM System Defaults configuration file, +# then add "Enable=true" in the "[debug]" section of this file. If the +# key already exists in this file, then simply modify it. +# +# Older versions of GDM used the "gdm.conf" file for configuration. If your +# system has an old gdm.conf file on the system, it will be used instead of +# this file - so changes made to this file will not take effect. Consider +# migrating your configuration to this file and removing the gdm.conf file. +# +# If you hand edit a GDM configuration file, you can run the following +# command and the GDM daemon will immediately reflect the change. Any +# running GDM GUI programs will also be notified to update with the new +# configuration. +# +# gdmflexiserver --command="UPDATE_CONFIG " +# +# e.g, the "Enable" key in the "[debug]" section would be "debug/Enable". +# +# You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and +# re-read the new configuration settings. You can also restart GDM by sending +# a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes +# any user session started by GDM to exit immediately while USR1 behaves like +# gdm-safe-restart and will wait until all users log out before restarting GDM. +# +# For full reference documentation see the gnome help browser under +# GNOME|System category. You can also find the docs in HTML form on +# http://www.gnome.org/projects/gdm/ +# +# NOTE: Lines that begin with "#" are considered comments. +# +# Have fun! + +[daemon] + +[security] + +[xdmcp] + +[gui] + +[greeter] + +[chooser] + +[debug] + +# Note that to disable servers defined in the GDM System Defaults +# configuration file (such as 0=Standard, you must put a line in this file +# that says 0=inactive, as described in the Configuration section of the GDM +# documentation. +# +[servers] + +# Also note, that if you redefine a [server-foo] section, then GDM will +# use the definition in this file, not the GDM System Defaults configuration +# file. It is currently not possible to disable a [server-foo] section +# defined in the GDM System Defaults configuration file. +# +EOF + fi + + echo "Removing installer" + chroot /mnt/install mount /proc + chroot /mnt/install rm -f /home/one/Desktop/sli*.desktop + chroot /mnt/install spkg -d sli + chroot /mnt/install umount /proc + + # Run various slackware install routines + echo "Run various slackware install routines" + chroot /mnt/install mount /proc + if [ -f /mnt/install/var/log/setup/setup.04.mkfontdir ]; then + chroot /mnt/install /var/log/setup/setup.04.mkfontdir + fi + + if [ -f mnt/install/var/log/setup/setup.08.gtk-update-icon-cache ]; then + chroot /mnt/install /var/log/setup/setup.08.gtk-update-icon-cache + fi + + if [ -f mnt/install/usr/sbin/update-all ]; then + chroot /mnt/install /usr/sbin/update-all + fi + + if [ -f mnt/install/var/log/setup/setup.services ]; then + chroot /mnt/install /var/log/setup/setup.services + fi + + chroot /mnt/install umount /proc + + # Set the hostname. + chmod 777 /mnt/install/etc/HOSTNAME + echo "darkstar.example.net" > /mnt/install/etc/HOSTNAME + chmod 644 /mnt/install/etc/HOSTNAME + + if [ "$home_dir" != "" ] && [ "$home_dir" != "$systempart" ]; then + umount /mnt/install/home + fi umount /mnt/install rmdir /mnt/install @@ -730,6 +1058,12 @@ rootdirectory=$2 systempart=$3 loadersetup=$4 + username=$5 + userpassword=$6 + installation_mode=$7 + home_dir=$8 + bootloader=$9 + if [ -d "$rootdirectory" ] && [ -b "$systempart" ]; then systemsize=`du -s -m $rootdirectory | sed 's/\t.*//'` device=`echo $systempart | cut -c6-8` @@ -741,11 +1075,11 @@ echo "error: insufficant space on device '$systempart'" exit $INSUFFICIENTSPACE else - install_system $rootdirectory $systempart $loadersetup + install_system $rootdirectory $systempart $loadersetup $username $userpassword $installation_mode $home_dir $bootloader exit $! fi else - echo "`basename $0` --install root_dir device [-auto|-expert]" + echo "`basename $0` --install root_dir device [-auto|-expert] username userpassword installation_mode" exit $CMDERROR fi ;; @@ -780,7 +1114,7 @@ echo "`basename $0` --module root_dir live_dir module_file [-xz|-gzip] [-optional]" echo "`basename $0` --iso live_dir iso_file" echo "`basename $0` --usb live_dir device" - echo "`basename $0` --install root_dir device [-auto|-expert]" + echo "`basename $0` --install root_dir device [-auto|-expert] username userpassword [core|basic|full] home_dir [grub|lilo]" echo "`basename $0` --share live_dir listen_interface ip_range [modules_list|auto]" echo "`basename $0` --unshare" exit $CMDERROR diff -Naur slackware-live-0.4.1-orig/scripts/init slackware-live-0.4.1/scripts/init --- slackware-live-0.4.1-orig/scripts/init 2015-07-18 13:46:20.800153443 +0300 +++ slackware-live-0.4.1/scripts/init 2015-07-18 13:43:30.895921000 +0300 @@ -1,5 +1,8 @@ #!/bin/ash +LIVELABEL="LIVE" #edit in build-slackware-live.sh script too +DISTRONAME="Salix" + echo "" echo "*** Live system initialization ***" mount -v proc /proc -t proc @@ -30,23 +33,33 @@ fi sleeptime=0 alreadycheckedpartitions="" + while [ "$mediadetected" == "none" ] && [ "$sleeptime" != "10" ]; do #try each seconds, but don't wait (USB) more than 10 seconds - for partition in `cat /proc/partitions | sed -e 1d -e 2d | cut -c26-`; do - if mount -o ro /dev/$partition /slroot/live/media >/dev/null 2>/dev/nul; then - if [ -f /slroot/live/media/boot/liveboot ]; then - if [ "$partition" == "sr0" ] || [ "$partition" == "sr1" ] - then mediadetected="cd" - else mediadetected="sd" + if blkid | grep -q "LABEL=\"$LIVELABEL\""; then + livedevice=`blkid | grep "LABEL=\"$LIVELABEL\"" | sed -n 1p | cut -f1 -d:` + echo "$DISTRONAME-Live found on $livedevice" + mount -o ro $livedevice /slroot/live/media + if blkid | grep "LABEL=\"$LIVELABEL\"" | sed -n 1p | grep -q "TYPE=\"iso9660\"" + then mediadetected="cd" + else mediadetected="sd" + fi + else + for partition in `cat /proc/partitions | sed -e 1d -e 2d | cut -c26-`; do + if mount -o ro /dev/$partition /slroot/live/media >/dev/null 2>/dev/nul; then + if [ -f /slroot/live/media/boot/liveboot ]; then + if [ "$partition" == "sr0" ] || [ "$partition" == "sr1" ] + then mediadetected="cd" + else mediadetected="sd" + fi + livedevice="/dev/$partition" + echo "$DISTRONAME-Live found on $livedevice" + break + else + umount /slroot/live/media fi - livedevice="/dev/$partition" - title=`cat /slroot/live/media/boot/syslinux/syslinux.cfg | grep "menu title " | cut -f3 -d' '` - echo "$title found on $livedevice" - break - else - umount /slroot/live/media fi - fi - done + done + fi if [ "$mediadetected" == "none" ]; then sleep 1 let sleeptime+=1 @@ -136,17 +149,17 @@ changes=`echo "$changes" | cut -f1 -d=` fi if [ ! -d /slroot/live/media/$changes ] && [ ! -f /slroot/live/media/$changes ] && [ ! -b $changes ]; then #storage space creation - if [ ! -z "$filesize" ]; then - echo "Creating $changes ($filesize MB) persistent system storage ..." - dd if=/dev/zero of=/slroot/live/media/$changes bs=1024k count=0 seek=$filesize #TODO: check available space - sleep 1 - mkfs.ext3 -F /slroot/live/media/$changes - sleep 1 - else - #if mount | grep -q "$livedevice on /slroot/live/media type ext3"; then #TODO: check FS type + #if [ ! -z "$filesize" ]; then + # echo "Creating $changes ($filesize MB) persistent system storage ..." + # dd if=/dev/zero of=/slroot/live/media/$changes bs=1024k count=0 seek=$filesize #TODO: check available space + # sleep 1 + # mkfs.ext3 -F /slroot/live/media/$changes + # sleep 1 + #else + if mount | grep -q "$livedevice on /slroot/live/media type ext3"; then #TODO: check FS type mkdir -p /slroot/live/media/$changes - #fi - fi + fi + #fi fi if [ -d /slroot/live/media/$changes ] || [ -f /slroot/live/media/$changes ] || [ -b $changes ]; then echo "Using persistent system storage ($changes)" @@ -262,25 +275,25 @@ home=`echo "$home" | cut -f1 -d=` fi if [ ! -d /slroot/live/media/$home ] && [ ! -f /slroot/live/media/$home ] && [ ! -b $home ]; then #storage space creation - if [ ! -z "$filesize" ]; then - echo "Creating $home ($filesize MB) persistent home directory ..." - dd if=/dev/zero of=/slroot/live/media/$home bs=1024k count=0 seek=$filesize #TODO: check available space - sleep 1 - mkfs.ext3 -F /slroot/live/media/$home - sleep 1 - mount -o loop /slroot/live/media/$home /slroot/$homedir - cp -dpR /slroot/live/union/etc/skel/.??* /slroot/$homedir/ - cp -dpR /slroot/live/union/etc/skel/* /slroot/$homedir/ - chown -R $uid:$gid /slroot/$homedir - umount /slroot/$homedir - else - #if mount | grep -q "$livedevice on /slroot/live/media type ext3"; then #TODO: check FS type (vfat not supported) + #if [ ! -z "$filesize" ]; then + # echo "Creating $home ($filesize MB) persistent home directory ..." + # dd if=/dev/zero of=/slroot/live/media/$home bs=1024k count=0 seek=$filesize #TODO: check available space + # sleep 1 + # mkfs.ext3 -F /slroot/live/media/$home + # sleep 1 + # mount -o loop /slroot/live/media/$home /slroot/$homedir + # cp -dpR /slroot/live/union/etc/skel/.??* /slroot/$homedir/ + # cp -dpR /slroot/live/union/etc/skel/* /slroot/$homedir/ + # chown -R $uid:$gid /slroot/$homedir + # umount /slroot/$homedir + #else + if mount | grep -q "$livedevice on /slroot/live/media type ext3"; then #TODO: check FS type (vfat not supported) mkdir -p /slroot/live/media/$home cp -dpR /slroot/live/union/etc/skel/.??* /slroot/live/media/$home/ cp -dpR /slroot/live/union/etc/skel/* /slroot/live/media/$home/ chown -R $uid:$gid /slroot/live/media/$home - #fi - fi + fi + #fi fi if [ -d /slroot/live/media/$home ] || [ -f /slroot/live/media/$home ] || [ -b $home ]; then echo "Setting up persistent home directory ($home)" @@ -308,7 +321,7 @@ #autologin runlevel=`cat /slroot/live/union/etc/inittab | sed -n /^id:[1-5]:initdefault:$/p | cut -f2 -d:` if [ $runlevel == 5 ]; then - sed -i 's/^c1:.*$/c1:5:respawn:\/sbin\/agetty -a linomad 38400 tty1 linux/' /slroot/live/union/etc/inittab + sed -i 's/^c1:.*$/c1:5:respawn:\/sbin\/agetty -a one 38400 tty1 linux/' /slroot/live/union/etc/inittab if [ -x /slroot/live/union/usr/bin/startx ]; then cat > /slroot/live/union/etc/profile.d/x.sh << END @@ -328,30 +341,59 @@ then sed -i s/^export\ LANG=.*/export\ LANG=$locale/ /slroot/live/union/etc/profile.d/lang.sh else echo "export LANG=$locale" >> /slroot/live/union/etc/profile.d/lang.sh fi + if [ -f /slroot/live/union/etc/kde/kdm/kdmrc ]; then + locale_noutf8=$(echo $lang | sed 's/\.utf8//') + sed -i "s/\(^\|^#\)Language=.*/Language=$locale_noutf8/" /slroot/live/union/etc/kde/kdm/kdmrc + fi + # Make firefox match OS locale + # Now included in $DISTRONAME version, but keep it for other Slackware version or distro + if [ -w /slroot/live/union/usr/lib$LIBSUFFIX/firefox/greprefs/all.js ]; then + sed -i -e 's/pref("intl.locale.matchOS", false);/pref("intl.locale.matchOS", true);/g' /slroot/live/union/usr/lib$LIBSUFFIX/firefox/greprefs/all.js + fi + # Make thunderbird match OS locale + # Now included in $DISTRONAME version, but keep it for other Slackware version or distro + if [ -w /slroot/live/union/usr/lib$LIBSUFFIX/thunderbird/greprefs/all.js ]; then + sed -i -e 's/pref("intl.locale.matchOS", false);/pref("intl.locale.matchOS", true);/g' /slroot/live/union/usr/lib$LIBSUFFIX/thunderbird/greprefs/all.js + fi fi if [ ! -z "$keymap" ]; then - echo "Setting up keymap ($keymap)" - cat > /slroot/live/union/etc/rc.d/rc.keymap < /slroot/live/union/etc/X11/xorg.conf.d/20-keyboard.conf << END + keyb=$keymap + if [ -n "$keyb" ] || [-n "$numlock" ] || [ -n "$scim" ] || [ -n "$ibus" ]; then + # keyboard settting + [ -n "$keyb" ] || keyb=us + [ -n "$numlock" ] || numlock=off + [ -n "$scim" ] || scim=off + [ -n "$ibus" ] || ibus=off + + grep "^$keyb|.*|.*|.*" /keymaps | sed -e "s/^.*|\(.*\)|\(.*\)|\(.*\)/\1|\2|\3/" > /slroot/live/union/tmp/xkb + xkblayout="$(sed -e "s/^\(.*\)|.*|.*/\1/" /slroot/live/union/tmp/xkb)" + xkbvariant="$(sed -e "s/^.*|\(.*\)|.*/\1/" /slroot/live/union/tmp/xkb)" + xkboptions="$(sed -e "s/^.*|.*|\(.*\)/\1/" /slroot/live/union/tmp/xkb)" + rm /slroot/live/union/tmp/xkb + # Fall back to keymap if no xkb maping available + if [ -z "$xkblayout" ]; then + xkblayout="$keyb" + xkbvariant="" + xkboptions="" + fi + /usr/bin/loadkeys -u $keyb.map 1>&2 2>/dev/null + if [ -e /slroot/live/union/etc/rc.d/rc.keymap ]; then + sed -i "s/\(^[ \t]*\/usr\/bin\/loadkeys -u\).*$/\1 $keyb.map/" /slroot/live/union/etc/rc.d/rc.keymap + fi + if [ -e /slroot/live/union/etc/X11/xorg.conf.d ]; then + cat < /slroot/live/union/etc/X11/xorg.conf.d/10-keymap.conf Section "InputClass" - Identifier "keyboard-all" - Driver "evdev" - Option "XkbLayout" "$xkblayout" - MatchIsKeyboard "on" +Identifier "Keyboard settings" +MatchIsKeyboard "yes" +Driver "evdev" +Option "XkbLayout" "$xkblayout" +Option "XkbVariant" "$xkbvariant" +Option "XkbOptions" "$xkboptions" EndSection -END +EOF fi + fi fi if [ ! -z "$tz" ]; then @@ -385,9 +427,9 @@ else echo "/dev/$partition none swap defaults,noauto 0 0" >> /slroot/live/union/etc/fstab fi - else - echo "/dev/$partition /mnt/$partition auto defaults,noauto,user 0 0" >> /slroot/live/union/etc/fstab - mkdir -p /slroot/live/union/mnt/$partition + #else + # echo "/dev/$partition /mnt/$partition auto defaults,noauto,user 0 0" >> /slroot/live/union/etc/fstab + # mkdir -p /slroot/live/union/mnt/$partition fi fi done