I did some investigation and this script is reponsible for booting the live system that porteus is.<br /><br />#!/bin/sh<br />### linuxc script by fanthom <http://www.porteus.org><br /><br />export PATH=/bin:/usr/bin:./<br /><br /># Enable pivot_root in initramfs to let it behave like initrd:<br />if [ -d /m ]; then<br />    mount -nt tmpfs tmpfs -o mode=0755 /m<br />    cp -a ??* /m 2>/dev/null<br />    exec switch_root /m linuxrc "$@"<br />fi<br /><br />mount -nt proc proc /proc<br />mount -nt sysfs sysfs /sys<br />echo 0 >/proc/sys/kernel/printk<br /><br />clear<br />echo """Starting init script <http://www.porteus.org/>"""<br /><br /># Functions:<br />param() { egrep -qo " $1( |\$)" /proc/cmdline; }<br />value() { egrep -o " $1=[^ ]+" /proc/cmdline | cut -d= -f2; }<br />debug() { param debug && { echo -e "\n=====\n: Debugging started. Here is the shell for you.\n: Type your desired commands, hit Ctrl+D to continue booting\n: or press Ctrl+Alt+Del to reboot."; sh; echo -e "\n\n"; }; }<br /><br /># Variables:<br />i=`echo """^ """`<br />m=`echo """->"""`<br />arch=`uname -m`; [ $arch = x86_64 ] || arch=i486<br />DELAY=`value delay`; [ $DELAY ] && { echo $i"delaying $DELAY sec (waiting for slow devices to settle up)"; sleep $DELAY; }<br />SGN=`value sgnfile`; [ $SGN ] || SGN=porteus-v3.0-$arch.sgn<br />FROM=`value from`; ISO=`echo $FROM | egrep ".*\.iso( |\$)"`<br />IP=`value ip | cut -d: -f2`<br />MOPT=`value mopt`; [ $MOPT ] || MOPT="noatime,nodiratime,suid,dev,exec,async"<br />CHANGES=`value changes`<br />RAMSIZE=`value ramsize`; [ $RAMSIZE ] || RAMSIZE=60%<br />LOAD=`value load | sed 's/;/|/g'`; [ $LOAD ] || LOAD=._null<br />NOLOAD=`value noload | sed 's/;/|/g'`; [ $NOLOAD ] || NOLOAD=._null<br />EXTRAMOD=`value extramod | sed 's/;/ /g'`<br />RAMMOD=`value rammod | sed 's/;/|/g'`<br />ROOTCOPY=`value rootcopy`<br />FOLDER=porteus<br />livedbg=/var/log/livedbg<br /><br /># Device Functions:<br />fstab() { rm -f /tmp/devices<br />param nocd || for x in /dev/sr*; do blkid $x >>/tmp/devices; done<br />param nohd || blkid | egrep -v '/dev/sr|/dev/loop|/dev/mapper' >>/tmp/devices<br />dev=`egrep -v 'TYPE="sw|TYPE="LVM|TYPE=".*_raid_member"' /tmp/devices 2>/dev/null | cut -d: -f1 | cut -d/ -f3 | sort | uniq`<br />cat > /etc/fstab << EOF<br /># Do not edit this file as fstab is recreated automatically during every boot.<br /># Please use /etc/rc.d/rc.local or sysvinit scripts if you want to mount/unmount<br /># drive, filesystem or network share.<br /><br /># System mounts:<br />aufs / aufs defaults 0 0<br />proc /proc proc defaults 0 0<br />sysfs /sys sysfs defaults 0 0<br />devtmpfs /dev devtmpfs defaults 0 0<br />devpts /dev/pts devpts rw,mode=0620,gid=5 0 0<br /><br /># Device partitions:<br />EOF<br />for x in $dev; do<br />    fs=`grep -w /dev/$x /tmp/devices | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`<br />    [ $fs = vfat ] && echo "/dev/$x /mnt/$x vfat $MOPT,umask=0,check=s,utf8 0 0" >>/etc/fstab || echo "/dev/$x /mnt/$x $fs $MOPT 0 0" >>/etc/fstab<br />    if [ ! -d /mnt/$x ]; then<br />    mkdir /mnt/$x<br />    if [ $fs = ntfs ]; then<br />        ntfs-3g /dev/$x /mnt/$x -o $MOPT 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }<br />    else<br />        mount -n /mnt/$x 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /mnt/$x 2>/dev/null || { sed -i "/$x /d" /etc/fstab; rmdir /mnt/$x; }; }<br />    fi<br />    fi<br />done<br /><br />if [ -z "`egrep -o " noswap( |\$)" /proc/cmdline`" -a -e /tmp/devices ]; then<br />    echo -e "\n# Swap partitions:" >>/etc/fstab<br />    for x in `grep 'TYPE="swap"' /tmp/devices | cut -d: -f1`; do echo "$x none swap sw,pri=1 0 0" >>/etc/fstab; done<br />fi }<br />mount_device() {<br />fs=`blkid /dev/$1 | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`<br />if [ "$fs" ]; then<br />    mkdir /mnt/$1<br />    if [ $fs = vfat ]; then<br />    mount -n /dev/$1 /mnt/$1 -o $MOPT,umask=0,check=s,utf8 2>/dev/null || rmdir /mnt/$1<br />    elif [ $fs = ntfs ]; then<br />    ntfs-3g /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || rmdir /mnt/$1<br />    else<br />    mount -n /dev/$1 /mnt/$1 -o $MOPT 2>/dev/null || { modprobe $fs 2>/dev/null && mount -n /dev/$1 /mnt/$1 -o $MOPT || rmdir /mnt/$1; }<br />    fi<br />fi }<br /><br /># Search functions:<br />search() { FND=none; for x in `ls /mnt`; do<br />[ $1 /mnt/$x/$2 ] && { DEV=$x; FND=y; break; }; done<br />[ $FND = y ]; }<br />lazy() { SLEEP=6; while [ $SLEEP -gt 0 -a $FND = none ]; do nap; let SLEEP=SLEEP-1; fstab; search $*; done }<br />locate() { LPATH=`echo $2 | cut -b-5 | sed s@/dev@/mnt@`<br />if [ $LPATH = /mnt/ ]; then<br />    DEV=`echo $2 | cut -d/ -f3`; LPTH=`echo $2 | cut -d/ -f4-`; SLEEP=6<br />    while [ $SLEEP -gt 0 -a ! -b /dev/$DEV ]; do nap; let SLEEP=SLEEP-1; fstab; done<br />    [ -d /mnt/$DEV ] || mount_device $DEV<br />    [ $1 /mnt/$DEV/$LPTH ]<br />elif [ $LPATH = UUID: -o $LPATH = LABEL ]; then<br />    ID=`echo $2 | cut -d: -f2 | cut -d/ -f1`; LPTH=`echo $2 | cut -d/ -f2-`; DEV=`blkid | grep $ID | cut -d: -f1 | cut -d/ -f3`; SLEEP=6<br />    while [ $SLEEP -gt 0 -a "$DEV" = "" ]; do nap; let SLEEP=SLEEP-1; fstab; DEV=`blkid | grep $ID | cut -d: -f1 | cut -d/ -f3`; done<br />    [ -d /mnt/$DEV ] || mount_device $DEV<br />    [ $1 /mnt/$DEV/$LPTH ]<br />else<br />    LPTH=$2; search $* || lazy $*<br />fi }<br /><br /># Other functions:<br />nap() { echo -en $i"device not ready yet? delaying $SLEEP seconds \r"; sleep 1; }<br />fail() { echo -e $i"couldn't find $1. Correct your cheatcodes if needed.\n  Press 'enter' to continue booting."; read -s; }<br />fail_chn() { mount -nt tmpfs -o size=$RAMSIZE tmpfs /memory/changes; CHANGES=memory; CHNDEV=memory; }<br />draw() { echo """---------------------------------------------------------"""; }<br />fsck_dat() { echo $i"checking $1 for errors"<br />fs=`blkid $1 | egrep -o ' TYPE=[^ ]+' | cut -b8-10`<br />if [ $fs = xfs ]; then<br />    echo $i"detected xfs - performing fsck at mount time"<br />elif [ $fs = ext ]; then<br />    draw; e2fsck -C 0 -p $1; wait; draw<br />elif [ $fs = rei ]; then<br />    draw; reiserfsck -p $1; wait; draw<br />else<br />    echo $i"detected unsupported fs - skipping fsck"<br />fi }<br />cpmod() { NUM=`grep -c '.' $1`<br />for x in `cat $1`; do<br />    echo -en """  ($NUM modules left)  \r"""; let NUM=NUM-1; NAME=`basename $x`<br />    cp $x /memory/copy2ram 2>/dev/null<br />    if [ $? -eq 0 ]; then<br />    sed -i s@^.*/$NAME@/memory/copy2ram/$NAME@ /tmp/modules<br />    else<br />    rm /memory/copy2ram/$NAME; echo -e $i"""Not enough memory to copy $NAME"""; echo -e $i"""Other modules will be skipped."""<br />    find /memory/copy2ram -name "*.xzm" | sort >/tmp/modules<br />    break<br />    fi<br />done<br />echo -en "                       \r"; }<br /><br />## Let's start!<br />mount -nt devtmpfs none /dev<br /><br /># Perform filesystem check:<br />if param fsck; then<br />    echo $i"performing linux filesystem check on all available devices:"<br />    draw<br />    for x in `blkid | grep 'TYPE="ext' | cut -d: -f1`; do e2fsck -C 0 -p $x; wait; done<br />    for x in `blkid | grep 'TYPE="reiserfs"' | cut -d: -f1`; do reiserfsck -p $x; wait; done<br />    draw<br />fi<br /><br /># Create /etc/fstab and mount devices:<br />fstab<br /><br />debug<br /># Find *.sgn file:<br />echo $i"searching for $SGN file"<br />if [ $IP ]; then BOOTDEV=network; SGNDEV=/mnt/nfs<br />    for x in `lspci | grep 0200: | cut -d: -f3-4 | sed s/:/.*/g | tr a-z A-Z`; do modprobe `grep $x /lib/modules/$(uname -r)/modules.alias | tail -n1 | rev | cut -d" " -f1 | rev` 2>/dev/null; done<br />    ls /sys/class/net | grep -q eth || { for x in `find /lib/modules/$(uname -r)/kernel/drivers/net -name "*.ko" | sed 's/.ko//g'`; do modprobe `basename $x` 2>/dev/null; ls /sys/class/net | grep -q eth && break || modprobe -r `basename $x` 2>/dev/null; done; }<br />    mkdir -p /mnt/nfs/porteus /mnt/nfs/storage; udhcpc; modprobe nfsv4; mount -t nfs4 $IP:/srv/pxe/porteus /mnt/nfs/porteus -o ro,nolock 2>/dev/null || { modprobe nfsv3; mount -t nfs $IP:/srv/pxe/porteus /mnt/nfs/porteus -o ro,nolock 2>/dev/null; }<br />    MAC=`ifconfig | grep eth0 | cut -d: -f5-7 | sed s/://g | cut -d" " -f1`<br />    if [ "$CHANGES" = /srv/pxe/storage ]; then<br />    if lsmod | grep -q nfsv3; then<br />        mount -t nfs $IP:/srv/pxe/storage /mnt/nfs/storage -o rw,nolock 2>/dev/null && { mkdir -p /mnt/nfs/storage/client-$MAC/changes/home; CHANGES="/storage/client-$MAC"; }<br />    else<br />        mount -t nfs4 $IP:/srv/pxe/storage /mnt/nfs/storage -o rw,nolock 2>/dev/null && { mkdir -p /mnt/nfs/storage/client-$MAC/changes/home; CHANGES="/storage/client-$MAC"; }<br />    fi<br />    fi<br />elif [ $ISO ]; then SGNDEV=/mnt/isoloop<br />    locate -e $FROM && { BOOTDEV=/mnt/$DEV; mkdir /mnt/isoloop; mount -o loop /mnt/$DEV/$LPTH /mnt/isoloop; }<br />else<br />    if [ $FROM ]; then<br />    locate -e $FROM/porteus/$SGN<br />    if [ $? -eq 0 ]; then<br />        DIR=`echo $LPTH | rev | cut -d/ -f3- | rev`; [ $DIR ] && FOLDER=$DIR/porteus<br />    else<br />        echo $i"from= cheatcode is incorrect, press enter to search through all devices"<br />        read -s; search -e porteus/$SGN<br />    fi<br />    else<br />    search -e porteus/$SGN || lazy -e porteus/$SGN<br />    fi<br />    SGNDEV=/mnt/$DEV<br />fi<br /><br />[ -e $SGNDEV/$FOLDER/$SGN ] && PTH=$SGNDEV/$FOLDER || . fatal<br />echo $i"using Porteus data from $PTH"<br /><br /># Make all drivers available:<br />mount -o loop $PTH/base/000-kernel.xzm /opt/000-kernel 2>/dev/null<br />mount -o bind /opt/000-kernel/lib/modules /lib/modules 2>/dev/null<br /><br /># Create symlinks used often by porteus scripts:<br />ln -sf $PTH/modules  /porteus/modules<br />ln -sf $PTH/optional /porteus/optional<br /><br />debug<br /># Setup changes:<br />if [ $CHANGES ]; then<br />    echo $i"setting up directory for changes"<br />    CHNEXIT=`echo $CHANGES | cut -d: -f1`; [ $CHNEXIT = EXIT ] && CHANGES=`echo $CHANGES | cut -d: -f2-`<br />    locate -r $CHANGES<br />    if [ $? -eq 0 ]; then<br />    if [ -d /mnt/$DEV/$LPTH ]; then<br />        mkdir -p /mnt/$DEV/$LPTH/changes 2>/dev/null && \<br />        mount -o bind /mnt/$DEV/$LPTH/changes /memory/changes && touch /memory/changes/._test1 2>/dev/null<br />    else<br />        if blkid /mnt/$DEV/$LPTH 2>/dev/null | cut -d" " -f3- | grep -q _LUKS; then<br />        for x in dm_crypt cryptd cbc sha256_generic aes_generic aes_x86_64; do modprobe $x 2>/dev/null; done<br />        losetup /dev/loop2 /mnt/$DEV/$LPTH<br />        echo $i"found encrypted .dat container"<br />        /opt/000-kernel/sbin/cryptsetup luksOpen /dev/loop2 crypt<br />        fsck_dat /dev/mapper/crypt<br />        mount /dev/mapper/crypt /memory/changes 2>/dev/null && touch /memory/changes/._test1 2>/dev/null<br />        else<br />        fsck_dat /mnt/$DEV/$LPTH<br />        mount -o loop /mnt/$DEV/$LPTH /memory/changes 2>/dev/null && touch /memory/changes/._test1 2>/dev/null<br />        fi<br />    fi<br />    if [ $? -eq 0 ]; then<br />        echo $i"testing filesystem on "$CHANGES" for posix compatibility"<br />        ln -s /memory/changes/._test1 /memory/changes/._test2 2>/dev/null && chmod +x /memory/changes/._test1 2>/dev/null && [ -x /memory/changes/._test1 ] && chmod -x /memory/changes/._test1 2>/dev/null && [ ! -x /memory/changes/._test1 ] && rm -f /memory/changes/._test1 /memory/changes/._test2<br />        if [ $? -ne 0 ]; then<br />        rm -f /memory/changes/._test1 /memory/changes/._test2; umount /memory/changes<br />        echo && echo -e """A Windows filesystem (FAT, NTFS) or other non-posix compatible filesystem\nhas been detected on $CHANGES.\nYour changes cannot be saved directly to the specified storage media with this\nsetup. Please use the 'Porteus save file manager' to create a .dat container\nand use it for saving your changes after your next reboot."""<br />        echo "press enter to continue in 'Always Fresh' mode for this session"<br />        read; rmdir /mnt/$DEV/$LPTH/changes; fail_chn<br />        else<br />        echo $i"filesystem is posix compatible"; CHNDEV=/mnt/$DEV<br />        rmdir /memory/changes/mnt/* 2>/dev/null<br />        rm -rf /memory/changes/var/lock/* /var/run/laptop-mode-tools/* /var/spool/cron/cron.??????<br />        for x in `find /memory/changes/var/run -name "*pid" 2>/dev/null`; do rm $x; done<br />        if [ $CHNEXIT = EXIT -o "`egrep -o " changes-ro( |\$)" /proc/cmdline`" ]; then<br />            CHNEXIT=$CHNDEV/$LPTH; echo $CHNEXIT >/tmp/changes-exit<br />            param changes-ro && echo $i"""changes will not be saved for this session""" || echo $i"""changes will be saved only during reboot/shutdown"""<br />            for x in `find /memory/changes -name ".wh.*"`; do cp -a --parents $x /var; done<br />            umount /memory/changes; mount -nt tmpfs -o size=$RAMSIZE tmpfs /memory/changes<br />            # need to fix busybox bug on 'cp -a' as it does not preserve perms on dirs:<br />            chown -R 1000:1000 /var/memory/changes/home/guest 2>/dev/null<br />            mv /var/memory/changes/* /memory/changes 2>/dev/null; CHANGES=memory<br />        fi<br />        fi<br />    else<br />        echo $i"changes not writable, using memory instead"; umount /memory/changes 2>/dev/null; fail_chn<br />    fi<br />    else<br />    fail $CHANGES; fail_chn<br />    fi<br />else<br />     echo $i"changes cheatcode not found, using memory only"; fail_chn<br />fi<br /><br />mkdir -p /memory/changes/mnt/live<br /><br />debug<br /># Setup aufs:<br />echo $i"creating live filesystem and inserting modules"<br />mount -t aufs -o nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw aufs /union<br />if [ $? -ne 0 ]; then echo -e """cant setup union (aufs) - read only filesystem?\nWhen you finish debugging press Ctrl+Alt+Del to reboot."""; sh; fi<br /><br /># Find modules:<br />find $PTH/base $PTH/modules -name "*.xzm" 2>/dev/null | egrep -v "$NOLOAD" | sort >/tmp/modules<br />find $PTH/optional -name "*.xzm" 2>/dev/null | egrep "$LOAD" | sort >>/tmp/modules<br /><br />if param vga_detect; then<br />    echo $i"detecting GPU"<br />    lspci >/tmp/lspci; nv=`grep "0300: 10de:" /tmp/lspci | cut -d":" -f4`; amd=`grep "0300: 1002:" /tmp/lspci | cut -d":" -f4`<br />    if [ $nv ]; then<br />    echo $i"$nv chipset found, checking which nVidia driver supports it"<br />    cd /usr/share/pciids/nVidia; NV=`grep $nv * | cut -d: -f1`; cd /<br />    if [ $NV ]; then<br />        echo $i"nVidia-$NV.xx driver will be activated -"<br />        echo $i"if present in $PTH/optional folder"<br />        find $PTH/optional -name "nVidia-$NV*" 2>/dev/null >>/tmp/modules<br />    else<br />        echo $i"latest nVidia driver will be activated -"<br />        echo $i"if present in $PTH/optional folder"<br />        find $PTH/optional -name "nVidia-*" 2>/dev/null | egrep -v '96.43.|173.14.|304.' >>/tmp/modules<br />    fi<br />    elif [ $amd ]; then<br />    echo $i"checking if $amd GPU belongs to 'Radeon HD' series"<br />    cd /usr/share/pciids/AMD; HD=`grep $amd * | cut -d: -f1`; cd /<br />    if [ $HD ]; then<br />            echo $i"AMD proprietary driver will be activated -"<br />            echo $i"if present in $PTH/optional folder"<br />            find $PTH/optional -name "$HD-1*" 2>/dev/null >>/tmp/modules<br />        else<br />            echo $i"$amd GPU is not supported by amd-catalyst driver - refusing activation"<br />        fi<br />    else<br />        echo $i"could not find any nVidia/AMD GPU on this PC"<br />    fi<br />fi<br /><br />if param base_only; then<br />    grep base/0 /tmp/modules > /tmp/mod<br />    mv /tmp/mod /tmp/modules<br />else<br />    if [ "$EXTRAMOD" ]; then<br />    for folder in $EXTRAMOD; do<br />        echo $i"searching for additional modules in $folder"<br />        locate -d $folder && { find /mnt/$DEV/$LPTH -name "*.xzm" 2>/dev/null | egrep -v "$NOLOAD" | sort >>/tmp/modules; } || fail $folder<br />    done<br />    fi<br />fi<br /><br /># Copy data to RAM:<br />if param copy2ram; then<br />    echo $i"copying Porteus data to RAM, this may take some time..."<br />    [ $RAMMOD ] && { egrep "$RAMMOD" /tmp/modules > /tmp/rammod; cpmod /tmp/rammod; } || cpmod /tmp/modules<br />fi<br /><br /># Populate aufs with modules:<br />umount /lib/modules /opt/000-kernel 2>/dev/null<br />for x in `cat /tmp/modules`; do<br />    NAME=`basename $x`; mkdir /memory/images/$NAME; mount -o loop $x /memory/images/$NAME 2>/dev/null<br />    if [ $? -eq 0 ]; then<br />    echo "  $m  $NAME"; mount -no remount,add:1:/memory/images/$NAME=rr aufs /union<br />    else<br />    echo $i"""Cannot read $NAME - corrupted module?"""; rmdir /memory/images/$NAME<br />    fi<br />done<br />mount -no bind /union/lib/modules /lib/modules 2>/dev/null<br /><br /># Add "changes on exit" device/file/folder:<br />if [ -e /tmp/changes-exit ]; then<br />    mkdir /memory/images/changes<br />    if [ -d $CHNEXIT ]; then<br />    mount -o bind $CHNEXIT/changes /memory/images/changes<br />    elif [ -b /dev/mapper/crypt ]; then<br />    mount /dev/mapper/crypt /memory/images/changes<br />    else<br />    mount -o loop $CHNEXIT /memory/images/changes<br />    fi<br />    echo "  $m  changes"; mount -no remount,add:1:/memory/images/changes=ro aufs /union<br />    echo $CHNEXIT/changes >>/tmp/modules<br />    param changes-ro && rm /tmp/changes-exit<br />fi<br /><br />debug<br /># Copy /rootcopy folder:<br />if param norootcopy; then<br />    ROOTCOPY=none<br />    echo $i"skipping /rootcopy directory"<br />else<br />    if [ $ROOTCOPY ]; then<br />    locate -d $ROOTCOPY<br />    if [ $? -eq 0 ]; then echo $i"copying content of $ROOTCOPY directory"; cp -af /mnt/$DEV/$LPTH/. /union/. 2>/dev/null; else fail $ROOTCOPY; ROOTCOPY=none; fi<br />    else<br />    ROOTCOPY=none<br />    echo $i"copying content of $PTH/rootcopy directory"<br />    cp -af $PTH/rootcopy/. /union/. 2>/dev/null<br />    fi<br />fi<br /><br />## Finish:<br /># Create 7 free loop devices for truecrypt, etc...<br />x=`losetup | tail -n1 | cut -d: -f1 | sed 's@/dev/loop@@'`; let y=x+7<br />while [ $x -le $y ]; do [ -b /dev/loop$y ] && break || mknod /dev/loop$y b 7 $y; let y=y-1; done<br /><br />if param nonetwork; then<br />    echo $i"disabling dhcpcd and NetworkManager services"<br />    chmod -x /union/etc/rc.d/rc.inet1 /union/etc/rc.d/rc.networkmanager 2>/dev/null<br />    nma=/union/etc/xdg/autostart/nm-applet.desktop<br />    test -e $nma && ! grep -q "Hidden=true" $nma && echo "Hidden=true" >> $nma<br />fi<br /><br />if [ "$IP" -a -x /union/etc/rc.d/rc.networkmanager ]; then<br />    if [ -z "`egrep -o " copy2ram( |\$)" /proc/cmdline`" -o -d /mnt/nfs/storage/client-$MAC ]; then<br />    echo "nameserver $IP" > /union/etc/resolv.conf<br />    nmc=/union/etc/NetworkManager/NetworkManager.conf; HW=`ifconfig | grep eth0 | cut -dW -f2 | cut -d" " -f2`<br />    ! grep -q "unmanaged-devices=mac:$HW" $nmc && sed -i '/\[keyfile\]/ a\unmanaged-devices=mac:'$HW'' $nmc<br />    fi<br />fi<br /><br />cp -af /dev/console /union/dev<br />cat > /union/etc/mtab << EOF<br />aufs / aufs rw 0 0<br />proc /proc proc rw 0 0<br />sysfs /sys sysfs rw 0 0<br />devtmpfs /dev devtmpfs rw 0 0<br />devpts /dev/pts devpts rw,mode=0620,gid=5 0 0<br />EOF<br />fstab<br /><br />debug<br />if param copy2ram; then<br />    [ $SGNDEV = /mnt/isoloop -o $SGNDEV = /mnt/nfs ] && { umount `grep $SGNDEV /etc/mtab | sed -n 1p | cut -d" " -f2`; SGNDEV=$BOOTDEV; }<br />    CHNDISK=`echo $CHNDEV | cut -b6-8`; SGNDISK=`echo $SGNDEV | cut -b6-8`; REMOVABLE=`cat /sys/block/$SGNDISK*/removable 2>/dev/null`<br />    if [ -z "`egrep -o " noeject( |\$)" /proc/cmdline`" -a "$CHNDISK" != "$SGNDISK" ]; then<br />    if [ "$REMOVABLE" = 1 ]; then<br />        for rdisk in `ls /mnt | grep $SGNDISK`; do<br />        umount -n /mnt/$rdisk 2>/dev/null && rmdir /mnt/$rdisk<br />        if [ $? -eq 0 ]; then<br />            grep -qw "/dev/$rdisk.*iso9660" /etc/fstab && /union/usr/bin/eject /dev/$rdisk<br />            sed -i "/$rdisk/d" /etc/fstab<br />        fi<br />        done<br />        [ `ls /mnt | grep $SGNDISK` ] || echo $i"""finished copying to RAM - booting media can be removed safely"""<br />    else<br />        if param nohd; then umount $SGNDEV 2>/dev/null; rmdir $SGNDEV 2>/dev/null; fi<br />    fi<br />    fi<br />fi<br /><br /># Create debug file:<br />[ -e /tmp/devices ] && { echo "# Recognized devices:" >$livedbg; cat /tmp/devices >>$livedbg; }<br />[ $BOOTDEV ] && SGNDEV=$BOOTDEV<br />echo -e "\n# Booting device:\n$SGNDEV\n\n# Porteus data found in:\n$PTH\n\n# Changes are stored in:\n$CHANGES\n\n# Non standard /rootcopy dir:\n$ROOTCOPY\n\n# Modules activated during boot time:" >>$livedbg; cat /tmp/modules >>$livedbg<br />cp -af $livedbg /union/var/log/porteus-livedbg<br /><br />echo $i"changing root directory"<br />if param noauto; then<br />    for x in `grep /mnt/ /etc/fstab | cut -d/ -f3`; do mkdir -p /union/mnt/$x; umount -n /mnt/$x 2>/dev/null && rmdir /mnt/$x; done<br />else<br />    grep /mnt/ /etc/fstab >> /union/etc/mtab<br />    for x in `grep /mnt/ /etc/fstab | cut -d/ -f3`; do mkdir -p /union/mnt/$x; mount -n --move /mnt/$x /union/mnt/$x; rmdir /mnt/$x; done<br />fi<br />sed -i 's/ ntfs / ntfs-3g /g' /etc/fstab<br />cp -f /etc/fstab /union/etc 2>/dev/null<br />umount -n /lib/modules 2>/dev/null<br />rm -r /lib/* /usr/*<br /><br />debug<br />echo """live system is ready now - starting Porteus"""<br />cp -f /union/sbin/init /bin<br />if [ $? -eq 0 ]; then<br />    pivot_root /union  /union/mnt/live<br />    exec bin/chroot . /mnt/live/bin/init "$@" <dev/console >dev/console 2>&1<br />else<br />    echo -e """!!ERROR!!\nSomething went wrong and I cannot continue.\nPress Ctrl+Alt+Del to reboot."""<br />    sh<br />fi<br /><br />I think the biggest problem is to make it work for systemd.  The script is found in the initrd of porteus.<br />Maybe make some service files for the module copying and activating. <br /><br />What do you expert think of it. <br /><br />Roelof<br /><br /><br /><br /><span>On 12/30/13, <b class="name">Roelof Wobben </b> <r.wobben@home.nl> wrote:</span><blockquote cite="mid:52C19D4C.2060004@home.nl" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimepart text plain">Koen Kooi schreef op 30-12-2013 15:50:<br />> Op 30 dec. 2013, om 13:36 heeft Mantas Mikulėnas <grawity@gmail.com> het volgende geschreven:<br />><br />>> On Mon, Dec 30, 2013 at 1:06 PM, Roelof Wobben <r.wobben@home.nl> wrote:<br />>>> hello,<br />>>><br />>>> Im trying to port Cinnamon to porteus.<br />>>> Porteus is a slackware based distro which work with modules.<br />>>><br />>>> The problem is that Cinnamon works the best with systemd and slackware<br />>>> refuses to use systemd.<br />>>> Now I want to try to make systemd work on a porteus system so that I have a<br />>>> slackware based system with systemd and Cinnamon.<br />>>><br />>>> The biggest problem is that im not a coder.<br />>> If you can port Cinnamon to a distro, most likely you can port systemd<br />>> to a distro just as well.<br />>><br />>> 0. Install all dependencies – a recent kernel with required options;<br />>> PAM; a /sbin/login with PAM support. The requirements are listed in<br />>> the README [1].<br />> Historically slackware has always refused to support PAM, so this is quite a big step to take :)<br />><br />> regards,<br />><br />> Koen<br /><br />I know. I have make build-scripts for it because Cinnamon needs PAM.<br /><br />Roelof<br /><br /><br />---<br />Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus actief is.<br /><a href="http://www.avast.com" target="l">http://www.avast.com</a><br /><br />_______________________________________________<br />systemd-devel mailing list<br />systemd-devel@lists.freedesktop.org<br /><a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="l">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br /></div></blockquote>