WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Persistence and boot codes  (Read 7816 times)

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Persistence and boot codes
« on: January 06, 2009, 03:21:48 AM »
Found a couple things dealing with boot codes

1. All the documentation shows that for PPI you use the boot code "tclocal=" where you actually need "local="

2. when using the boot codes "local=" and "opt=" and having both point at the same partition, opt does not get mounted.  the error on the boot screen says /dev/hdxy mounted or busy.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: Persistence and boot codes
« Reply #1 on: January 06, 2009, 08:45:46 AM »
2. This also applies when mixing in "home=" on the same partition.  The init script uses the flawed logic "if the mount command fails, then it isn't mounted", and so it simply gives up.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Persistence and boot codes
« Reply #2 on: January 06, 2009, 09:45:29 AM »
It was never intended to run that way.

Typically when doing a traditional hard drive installation, one makes many partitions for their installation and not use a single partition. I thought single partition installations was a relic. Regarding persistence, this I had this in mind.

I will take this as a feature enhancement.

@mikshaw, why the vinegar?
10+ Years Contributing to Linux Open Source Projects.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Persistence and boot codes
« Reply #3 on: January 06, 2009, 01:57:37 PM »
i would have guessed single partition installs would grow more common the more people use linux, so that partitioning is less "involved."

not necessarily for very large, popular debian-based distros that hold your hand through partitioning, (and must use swap) but for many others. then there is the swap file, removing need for a swap partition.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Persistence and boot codes
« Reply #4 on: January 06, 2009, 02:15:15 PM »
Chatted with Kingdomcome yesterday about this.  Came up with some sort of solution... there could be a better way of doing it.

Code: [Select]
is_mounted()
{
  awk_line="\$2 == \"\/mnt\/$1\" {print \$2}"
  found=$(awk "$awk_line" /etc/mtab )
  [ -n "$found" ]
  return $?
}

Then you could replace all mount lines as required with something like
Code: [Select]
is_mounted $MY_DEVICE || mount /mnt/$MY_DEVICE
---

For #1, he pointed out that it shows up on the F3 and the "getting started" doc.

I'm sure mikshaw didn't mean it like that :p  I vaguely remember someone running into this before with that...

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Persistence and boot codes
« Reply #5 on: January 06, 2009, 02:43:28 PM »
hats, see "mountpoint" :)
The only barriers that can stop you are the ones you create yourself.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Persistence and boot codes
« Reply #6 on: January 06, 2009, 03:06:15 PM »
aha.

On a similar note: looks like there's a find_mountpoint in tc-functions.  I wonder if my version (slightly edited) would be more efficient though, since it only has that one call to awk and it doesn't use those extra pipes...  Or is there something else that can do that too?
« Last Edit: January 06, 2009, 03:13:16 PM by ^thehatsrule^ »

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: Persistence and boot codes
« Reply #7 on: January 06, 2009, 03:37:11 PM »
Quote
@mikshaw, why the vinegar?
Quote
I'm sure mikshaw didn't mean it like that
I didn't mean to sound sour.
It did seem like an error to assume that if the mount command fails then the specified partition is not available. It will fail if it's already mounted, which isn't necessarily a problem because of the way the individual directories are mounted into the system.  I would understand this behavior better if it was mounting a full partition as a system directory rather than mounting in /mnt and then binding a subdirectory.  When using --bind you can theoretically have a pile of mounts on the same partition.

In any case, I wasn't aware that the behavior was intended.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Persistence and boot codes
« Reply #8 on: January 06, 2009, 06:26:11 PM »
i am sure that there are always multiple ways to do things and things can usually always be improved, sometimes, it is the intent and not the lack of knowledge to accomplish. It is quite simple to accomplish once intent is clear. Help in that regard was/is not necessary.
10+ Years Contributing to Linux Open Source Projects.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: Persistence and boot codes
« Reply #9 on: January 06, 2009, 08:35:21 PM »
i'm sure he was referring to tinycore's "logic," and only in one routine, not your logic. since you both agree there is room for improvement, and since his could be taken as nothing more than that, and, since he said he meant nothing more than that by it, i can't see any reason to insist he was offering anything in addition. you just took it differently than he meant it.

the logic of the routine, in the most literal sense of the word, has a flaw. there is no malice in that, no rudeness, only fact. it's a minor bug that could be improved upon in the future. i'm sure we can still mention them with our best intentions, even when they are only an opinion.

and i'm sure that any misunderstandings like this are easily resolved by simply falling back on the same trust that has existed between (and well served) both parties for all these years.

maybe 2008 was a time of adjustment, but it's 2009 now, and things look good for linux, and for tc. i think we're all very excited about it. and i'm sure there will be lots of suggestions, some worth taking seriously, others nothing to worry about, and perhaps most of them somewhere between the two.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Persistence and boot codes
« Reply #10 on: January 07, 2009, 12:55:56 AM »
FYI, the related thread that I somewhat recalled is here http://forum.tinycorelinux.net/index.php?topic=158.0