Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 25 Sep 2017, 00:32
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
The strange case of init script in initrd.gz
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [32 Posts]   Goto page: 1, 2, 3 Next
Author Message
mistfire

Joined: 04 Nov 2008
Posts: 570
Location: PH

PostPosted: Sat 28 Jan 2017, 10:16    Post subject:  The strange case of init script in initrd.gz
Subject description: There is a flaw in init script
 

Hello

I will tell you the strange case of init script in initrd.gz. My USB pendrive has puppy files (Slacko 6.3.2) inside /boot folder using syslinux as a bootloader (FAT32 filesystem is used). At first when booting from USB puppy works fine even there is no main SFS file in the hard disk.

However after subsequent boot, suddenly the init script of slacko cannot find the main SFS file even it is exists. I try to other computer, the same error is shown. However if I boot older puppies (Puppy Linux 4.0 and Puppy 4.3.1) it finds the their main SFS file on my pendrive and load it on RAM. While the newer slacko 6.3.2 cant find its puppy SFS file from my pendrive unless if the slacko main SFS file is put on the hard drive partition.

I used the latest woof-ce init script. It shows the same error according to the last bootlog created by woof-ce init main SFS in sda1 is missing. It does not jump to my pendrive and search for main SFS file.

What is the problem within the init script?
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Sat 28 Jan 2017, 10:28    Post subject:  

I'm not sure about the problem, the init script had a major rewrite, a few months ago.

And you can't use the latest initrd init script from woofce for old releases unless you built the whole iso using the woofce build scripts.

It's changing and is practically incompatible with older puppies. I'm about to add support for luks-encrypted savefiles.
Back to top
View user's profile Send private message 
mcradventures

Joined: 25 Jan 2017
Posts: 10

PostPosted: Sat 28 Jan 2017, 10:33    Post subject:  

It sounds like a problem I read about in another post (sorry, can't remember where it's at). If it is, try booting again a few times. I usually have to boot my Slacko 2-3 times before it finds the main sfs file. It's a bug, but that's the only workaround I've found. At first when I noticed it I thought it was a misconfiguration with the bootloader but later found out it wasn't.
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 684

PostPosted: Sat 28 Jan 2017, 10:55    Post subject:  

I have tahr64 on usb drive booting with syslinux.
Savefolder is on sda7, ext4, on top not in a subdirectory.

If I put no boot parameter in append line, it fails to find the savefolder.
Even the Boot parameters wiki page says it's best not to add pmedia option and puppy will find the files automatically.
It only finds the savefolder when I put pmedia=satacd.
I have to fool puppy that it boots from a CD.

I would very much like to boot puppy from USB but load savefile, main sfs and adrive, ydrive or zdrive from where I put them on hdd.

I can do this easily in fatdog with boot parameters 'savefile=location', 'basesfs=location', 'extrasfs=location'.

So my fatdog doesn't waste time searching for files and boots faster as it loads those files from hdd.

I searched for similar boot options for a puppy, didn't find them yet.

Could anyone with the knowledge guide me?
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Sat 28 Jan 2017, 11:13    Post subject:  

drunkjedi wrote:

I can do this easily in fatdog with boot parameters 'savefile=location', 'basesfs=location', 'extrasfs=location'.

So my fatdog doesn't waste time searching for files and boots faster as it loads those files from hdd.

I searched for similar boot options for a puppy, didn't find them yet.


In https://raw.githubusercontent.com/puppylinux-woof-CE/woof-CE/testing/initrd-progs/0initrd/README.txt

see Boot parameters:
psave=
pupsfs=
zdrv=
fdrv=
adrv=
ydrv=
Back to top
View user's profile Send private message 
mistfire

Joined: 04 Nov 2008
Posts: 570
Location: PH

PostPosted: Sat 28 Jan 2017, 11:27    Post subject:  

@jlst I used the rewritten init script on slacko 6.3.2 initrd.gz, I extract the initrd.gz apply the rewritten init script, put some missing scripts needed by new init script, and return it back to initrd.gz.

The scenario was just boot slacko 6.3.2 without any parameters. But based on bootlog created by new initrd it always stops at sda1 on searching main SFS file it does not jump to other drive to search main SFS if it not exists on sda1.

@drunkjedi I already tried pmedia parameter but still it cant find the main SFS file even it exists.
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Sat 28 Jan 2017, 11:45    Post subject:  

mistfire wrote:
@jlst I used the rewritten init script on slacko 6.3.2 initrd.gz, I extract the initrd.gz apply the rewritten init script, put some missing scripts needed by new init script, and return it back to initrd.gz.

It's the other way round. You must use a recent woofce initrd.gz.

The init script is tested with all the new compiled static binaries... they are all the latest releases (except grep). I compile and release new static binaries when an update is available.

The only thing you have to replace is the DISTRO_SPECS file... the latest release (posted by Sailor Enceladus, peebee) comes with a initrd.gz with busybox 1.26.2

Beyond that, i can't help. People are supposed to follow the "main" development team, giving suggestions on what to do, and testing the latest releases.

This a fairly recent release by Sailor Enceladus:
https://my.pcloud.com/publink/show?code=XZ62WKZl09pUA22VpJmLy373sFHxVMKn2dy

You might want to try to make it smaller... of course it's possible to build slackos with older slackware versions. I'll see if someone is willing build one of those...
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 684

PostPosted: Sat 28 Jan 2017, 13:18    Post subject:  

jlst wrote:
In https://raw.githubusercontent.com/puppylinux-woof-CE/woof-CE/testing/initrd-progs/0initrd/README.txt

see Boot parameters:
psave=
pupsfs=
zdrv=
fdrv=
adrv=
ydrv=
Thanks mate.
I am at work now, I will try them tomorrow.
I will remove that pmedia option and try with these options.

Thanks for the link too. The wiki I found didn't have this much details.
Thanks again.
Back to top
View user's profile Send private message 
Marv


Joined: 04 May 2005
Posts: 868
Location: SW Wisconsin

PostPosted: Sat 28 Jan 2017, 13:29    Post subject:  

@jlist I have a quick question on the new init, maybe a better place to post but you are here... When passing fsck as a kernel parameter, even though the OS is set to use a utc hardware clock and that hardware clock is correctly set, the fsck always reports the last savefile mount was in the future etc. date and hwclock agree run in the system agree. Running fsck on the savefiles from within the system doesn't give that error. Putting a BOOT_SPECS file in the initrd.gz with TZ='XXX-6' in it (my TZ) doesn't change things at all. At first glance, it seems that the TZ/hwclock set occurs at line 896 in init while the fsck occurs earlier around line 130. Could it be that at the time fsck is invoked the timezone hasn't been applied while later and when unmounting a savefile it has? Sorry if this is dumb but no-one better to point me right than you. I was modifying my ignore=usb utility to work with the new init so I took a look.
_________________
Pups currently in kennel Very Happy X-slacko 4.3 and X-tahr 2.0 for my users; LxPupSc and LxPupXenial for me. All good pups indeed, and all running browsers, office etc. solely from SFS.
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Sat 28 Jan 2017, 13:47    Post subject:  

Marv wrote:
@jlist I have a quick question on the new init, maybe a better place to post but you are here... When passing fsck as a kernel parameter, even though the OS is set to use a utc hardware clock and that hardware clock is correctly set, the fsck always reports the last savefile mount was in the future etc. date and hwclock agree run in the system agree. Running fsck on the savefiles from within the system doesn't give that error. Putting a BOOT_SPECS file in the initrd.gz with TZ='XXX-6' in it (my TZ) doesn't change things at all. At first glance, it seems that the TZ/hwclock set occurs at line 896 in init while the fsck occurs earlier around line 130. Could it be that at the time fsck is invoked the timezone hasn't been applied while later and when unmounting a savefile it has? Sorry if this is dumb but no-one better to point me right than you. I was modifying my ignore=usb utility to work with the new init so I took a look.


Actually the hwclock set occurs early. All the code before MAIN consists of functions that will be used later.

This is the code:
Code:
[ "$TZ" ] || TZ='XXX-20'
export TZ
hwclock -l -s


I'm not sure it was already there before or gyro added it

Change it to this:
Code:
[ "$TZ" ] && export TZ
hwclock -l -s


And don't add TZ= to BOOT_SPECS.

Repackage initrd.gz, test and report here if that makes any difference..
Back to top
View user's profile Send private message 
Marv


Joined: 04 May 2005
Posts: 868
Location: SW Wisconsin

PostPosted: Sat 28 Jan 2017, 14:24    Post subject:  

jlst wrote:
Marv wrote:
@jlist I have a quick question on the new init, maybe a better place to post but you are here... When passing fsck as a kernel parameter, even though the OS is set to use a utc hardware clock and that hardware clock is correctly set, the fsck always reports the last savefile mount was in the future etc. date and hwclock agree run in the system agree. Running fsck on the savefiles from within the system doesn't give that error. Putting a BOOT_SPECS file in the initrd.gz with TZ='XXX-6' in it (my TZ) doesn't change things at all. At first glance, it seems that the TZ/hwclock set occurs at line 896 in init while the fsck occurs earlier around line 130. Could it be that at the time fsck is invoked the timezone hasn't been applied while later and when unmounting a savefile it has? Sorry if this is dumb but no-one better to point me right than you. I was modifying my ignore=usb utility to work with the new init so I took a look.


Actually the hwclock set occurs early. All the code before MAIN consists of functions that will be used later.

This is the code:
Code:
[ "$TZ" ] || TZ='XXX-20'
export TZ
hwclock -l -s


I'm not sure it was already there before or gyro added it

Change it to this:
Code:
[ "$TZ" ] && export TZ
hwclock -l -s


And don't add TZ= to BOOT_SPECS.

Repackage initrd.gz, test and report here if that makes any difference..
That fixes it. Several reboots to check and fsck now reports as expected.

Edit: init in LxPup 17.01.23, built from Rationalize branch, also patched per above. Works there also. Now tested on core 2 duo, Pentium M and Bay Trail (J1900) machines.

Thanks,

_________________
Pups currently in kennel Very Happy X-slacko 4.3 and X-tahr 2.0 for my users; LxPupSc and LxPupXenial for me. All good pups indeed, and all running browsers, office etc. solely from SFS.

Last edited by Marv on Sat 28 Jan 2017, 19:46; edited 1 time in total
Back to top
View user's profile Send private message 
mistfire

Joined: 04 Nov 2008
Posts: 570
Location: PH

PostPosted: Sat 28 Jan 2017, 18:10    Post subject:  

@jlst it seems that the init script seems loose reliability a little bit compared to previous init script. I suggest to look at the code of previous (puppy 4.x) init (searching main SFS part) and adapt some part to the latest init script.

By the way aside from searching main sfs issue. the execution of depmod is slow on highly compressed main sfs file (This can be done by setting 1M block size in mksquashfs). Is there anyway to make the execution of depmod faster for highly compressed sfs file
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Sat 28 Jan 2017, 20:25    Post subject:  

mistfire wrote:
@jlst it seems that the init script seems loose reliability a little bit compared to previous init script. I suggest to look at the code of previous (puppy 4.x) init (searching main SFS part) and adapt some part to the latest init script.

By the way aside from searching main sfs issue. the execution of depmod is slow on highly compressed main sfs file (This can be done by setting 1M block size in mksquashfs). Is there anyway to make the execution of depmod faster for highly compressed sfs file

Probably, but with the latest init you can provide debug info.

You see that it's not able to boot, just type 'debugsave', specify the partition where the debug data will be saved.. then reboot. Post the whole directory here.

Well, there is a reason people with slow hardware complain about xz compression. If you don't want it to slow down the boot process, then include the generated depmod stuff by default. I think woofce puppies include it by default, at least the recent ones..
Back to top
View user's profile Send private message 
mistfire

Joined: 04 Nov 2008
Posts: 570
Location: PH

PostPosted: Sat 28 Jan 2017, 20:51    Post subject:  

@jlst however, generated depmod stuff does not include on puppy remastering.

UPDATE: Okay I made some hack on puppy remaster script to include generated depmod files.
Back to top
View user's profile Send private message 
mistfire

Joined: 04 Nov 2008
Posts: 570
Location: PH

PostPosted: Sat 28 Jan 2017, 23:14    Post subject:  

@jlst here is the debug files that you need.

Here is the content of bootinit.log

Code:
0: PMEDIA= PDRV= PSUBDIR= pfix=
1: PDRV= P_BP_ID= P_BP_FN=
2: LOOK_PUP=yes LOOK_SAVE= PMEDIA=
3: PSUBDIR= P_BP_FN= P_DEF_FN=puppy_xslacko_4.2.sfs
HAVE_PARTS='sda1|ntfs'
TRY_PARTS='sda1|ntfs'
4: ONE_PART=sda1
2: USBDRVS=sdb| -> sdb
3: PSUBDIR= P_BP_FN= P_DEF_FN=puppy_xslacko_4.2.sfs
HAVE_PARTS='sda1|ntfs
sdb1|vfat'
param='sdb'
TRY_PARTS='sdb1|vfat
sda1|ntfs'
4: ONE_PART=sdb1
4: ONE_PART=sda1
6: ONE_PART=sda1 ONE_TRY_FN=/puppy_xslacko_4.2.sfs PDRV=


Note: The init does not jump on sdb1 if the main sfs file is not exists on sda1
zz_initrd_tmp.zip
Description 
zip

 Download 
Filename  zz_initrd_tmp.zip 
Filesize  23.05 KB 
Downloaded  39 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [32 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0751s ][ Queries: 12 (0.0097s) ][ GZIP on ]