Change LinuxLiveKit

Post your comments, questions, bug reports or suggest new features for alphaOS
Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Change LinuxLiveKit

Postby Scooby » 22 Aug 2014, 19:15

LinuxLiveKit re-writes /etc/fstab each time you boot

You cannot add lines to it neither by savefile nor by modules
not even rootcopy

I consider this a wrong approach.
( and have emailed Tomas M, the author, but I don't think he will change it )

I am not sure how to fix it?

maybe add something similar to rc.local that is if a file /etc/fstab.local exist
add the lines to fstab at startup i.e.

in linuxlivekitlib

fstab_create()
{
debug_log "fstab_create" "$*"

local FSTAB
FSTAB="$1/etc/fstab"
echo aufs / aufs defaults 0 0 > $FSTAB
echo proc /proc proc defaults 0 0 >> $FSTAB
echo sysfs /sys sysfs defaults 0 0 >> $FSTAB
echo devpts /dev/pts devpts gid=5,mode=620 0 0 >> $FSTAB
echo tmpfs /dev/shm tmpfs defaults 0 0 >> $FSTAB
[ -e "$1/etc/fstab.local" ] && cat "$1/etc/fstab.local" >> $FSTAB
}


Sim

What is your thoughts?

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change rc.d/functions not Change LinuxLiveKit

Postby Scooby » 23 Aug 2014, 20:16

I'm thinking it may be better not to change linuxlivekit

the fstab.local logic coulld be added to

/etc/rc.d/functions-->activating_swap()

If nothing is done activating_swap() is totally meaningless
since swapon -a reads fstab and you cannot add to fstab

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change rc.d/functions not Change LinuxLiveKit

Postby Scooby » 24 Aug 2014, 13:27

I have settled on a way to make fstab usable
My main issue was to make swap working but this will work for other entries as well

In the create_swap script I will try add it when installing in an automatic way
Adding the finishing touches now and will soon share it

Sim, I am not sure if you want to use it but below is the code

To make it work

/etc/rc.d/functions--->activating_swap()
will be changed to

Code: Select all

activating_swap()
{
  echo -en $Green"* "$Color_Off"Activating swap" >/dev/console
 
  local UMOUNT_LIST=()
  [ -e "/etc/fstab.local" ] && cat "/etc/fstab.local" >> "/etc/fstab"
 
  if grep -q "swap" /etc/fstab; then
     for i in $(blkid -o list | grep "(not mounted)" | sort | cut -d" " -f1 | grep -E -v "/loop|sr0" | sed 's|/dev/||g'); do
        if [ ! -d "/mnt/$i" ]; then mkdir "/mnt/$i"; fi
        mount /dev/$i /mnt/$i 2>/dev/null
         UMOUNT_LIST+=("/mnt/$i")
     done
  fi
 
  swapon -a 2>/dev/null
  status_func
  [ "${#UMOUNT_LIST[@]}" -ne 0  ] && umount "${UMOUNT_LIST[@]}" 2>/dev/null 
}


BTW
Sim, I am not sure ntfs-3g part of mount_all function is still needed?
For me mount works just fine with ntfs
This need confirmation though
and if so guess_fstype is not needed anymore?

pentajazz
Advanced
Posts: 48
Joined: 27 Apr 2014, 23:09

Re: Change rc.d/functions not Change LinuxLiveKit

Postby pentajazz » 24 Aug 2014, 15:21

is this why i could not make a swap permanent isn't it? I have managed though to do it manually by adding the mkswap and swapon lines to startup profile config, don't know if relevant but just letting you know, seems this rc.d function will work better though. to help further, fatdog64 has permanent swap, slacko64 has a mechanism to swapon swap partitions if exist (not sure about files)

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change rc.d/functions not Change LinuxLiveKit

Postby Scooby » 24 Aug 2014, 15:36

pentajazz wrote:is this why i could not make a swap permanent isn't it? I have managed though to do it manually by adding the mkswap and swapon lines to startup profile config, don't know if relevant but just letting you know, seems this rc.d function will work better though


It is relevant and you could of course solve it the way you describe

but do you want to do mkswap at every startup?

Anyway I think fstab is a more elegant solution
not mine with the activating_swap(), that's a hack

I might wanna put other things in fstab. I don't think it should be locked down

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change LinuxLiveKit

Postby Scooby » 24 Aug 2014, 15:44

Actually when I think about I would want to
add a /etc/fstab to alpha_XX.sb with defaults
That would make it possible to overide it

Then if someone screwed up their fstab system could be
started with boot paramter that signals a load of default fstab.

i.e

add to livekitlib-->fstab_create() at the beginning

Code: Select all

if grep -vwq fstab /proc/cmdline; then return; fi


This will introduce boot param "fstab". When present default fstab will be loaded.

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change LinuxLiveKit

Postby Scooby » 24 Aug 2014, 16:31

The above approach works I have tested it but I aint sure
so what do you users want?

Do you want an fstab you can add to?

pentajazz
Advanced
Posts: 48
Joined: 27 Apr 2014, 23:09

Re: Change LinuxLiveKit

Postby pentajazz » 24 Aug 2014, 22:11

it should be writable, why not
and the emergency parameter could be a useful option

ducklin5
Advanced
Posts: 54
Joined: 24 Jun 2014, 08:27

Re: Change LinuxLiveKit

Postby ducklin5 » 21 Sep 2014, 15:07

so what do i have to do to activate my swap partition because currently it just says activating swap while in fact it isnt :?:

Scooby
Site Admin
Posts: 826
Joined: 09 Sep 2013, 16:52

Re: Change LinuxLiveKit

Postby Scooby » 21 Sep 2014, 18:00

I have not used a swap partition only swap file

Do you need fstab to make it work?

if your'e OK with swapfile have a look at
viewtopic.php?f=6&t=1160


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests

cron