Another re-write of the "init" script - using OverlayFs?

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#136 Post by 01micko »

gyro wrote:@01micko,
Thanks for testing.

That's one of the thiings I like about the "Archive" save mechanism,
when you realise you don't have everything setup for a "Folder" based install,
you can just choose "Archive" and not lose any of the mods you have made.

gyro
Yes, very handy.. but we need an easy installer, perhaps to USB for testing anyway.

I have obliged. Seems to work ok, posting from a saved install to ext4 (no journal - to reduce writes).

1. Download the attached file [ 4th revision now available ]
2. run

Code: Select all

gunzip install2usb.gz; chmod 755 install2usb
3. plug in a USB stick that you can totally overwrite; in other words, make sure you have got any valuable data off of it
4. run it from your fav terminal emulator. I use urxvt

Code: Select all

./install2usb
5. if your pup supports f2fs or UEFI then that should be detected
6. choose what filesystem and boot type you want (choices are ext2, ext4-no journal,f2fs and legacy bios, UEFI or both respectively)
7. a summary is displayed; if anything is wrong please cancel out of this prog!
8. sit back and watch for errors
9. if succesful, make sure you can boot from USB and try to boot it, run it and save the session.

NOTE: booting is done from a FAT partition but only Linux partitions are allowed for the saving process at this stage. A 33MB FAT partition is created (labeled 'BOOT' - holds vmlinuz, initrd.gz) and a Linux partition of ext2 or 4 or f2fs (if supported) by choice - holds all the sfs files.

10. NO WARRANTY. BE CAREFUL.

BUGFIXES + FEATURE ADDITIONS
(v2)
* fix typo with f2fs variable
* fix f2fs formatting
* make sure iso gets unmounted
* check USB isn't mounted and abort if so (accidentally wiped my running install FAT partition :oops: )

(v3)
* added @gyro's patch (unpublished)

(v4)
* add ability to specify the label for the boot and system partitions (vfat and linux types respectively)
* bugfix: copy appropriate BOOT_SPECS to initrd,gz
* feature: add P_TZ and P_TZONE vars to TIME_ZONE file (based on running systems timezone) >> initrd.gz
* feature: add ability to use ext2, ext3 and ext4 (existing was ext4[no journal] and f2fs) as well as FAT32 as SYSTEM (ie 'save') partition - please see caveat in 'KNOWN ISSUES')
* fix some mount/umount issues
* code clean up

KNOWN ISSUES
* the image doesn't copy for the boot menu if Grub2-efi doesn't exist. Will be fixed when I make this a pet package
* sometimes the CD doesn't mount for copying files, I think it maybe is a hardware issue on this laptop (intermittent)
* CAVEAT from v4: There seems to be corruption, albeit fairly minor if you believe the start of the error message... ('This is mostly harmless')

Code: Select all

 fsck.fat /dev/sdb1
fsck.fat 3.0.28 (2015-05-16)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
  3:53/6d, 4:59/6b, 5:53/66, 6:4c/73, 7:49/2e, 8:4e/66, 9:55/61, 10:58/74
  , 90:fa/0e, 91:fc/1f, 92:31/be, 93:c9/77, 94:8e/7c, 95:d1/ac, 96:bc/22
  , 97:76/c0, 98:7b/74, 99:52/0b, 100:06/56, 101:57/b4, 102:1e/0e, 103:56/bb
  , 104:8e/07, 105:c1/00, 106:b1/cd, 107:26/10, 108:bf/5e, 109:78/eb
  , 110:7b/f0, 111:f3/32, 112:a5/e4, 113:8e/cd, 114:d9/16, 115:bb/cd
  , 116:78/19, 117:00/eb, 118:0f/fe, 119:b4/54, 120:37/68, 121:0f/69
  , 122:a0/73, 123:56/20, 124:20/69, 125:d2/73, 126:78/20, 127:1b/6e
  , 128:31/6f, 129:c0/74, 130:b1/20, 131:06/61, 132:89/20, 133:3f/62
  , 134:89/6f, 135:47/6f, 136:02/74, 137:f3/61, 138:64/62, 139:a5/6c
  , 140:8a/65, 141:0e/20, 142:18/64, 143:7c/69, 144:88/73, 145:4d/6b
  , 146:f8/2e, 147:50/20, 148:50/20, 150:50/6c, 151:cd/65, 152:13/61
  , 153:eb/73, 154:62/65, 155:8b/20, 156:55/69, 157:aa/6e, 158:8b/73
  , 159:75/65, 160:a8/72, 161:c1/74, 162:ee/20, 163:04/61, 164:01/20
  , 165:f2/62, 166:83/6f, 167:fa/6f, 168:4f/74, 169:76/61, 170:31/62
  , 171:81/6c, 172:fa/65, 173:b2/20, 174:07/66, 175:73/6c, 176:2b/6f
  , 177:f6/70, 178:45/70, 179:b4/79, 180:7f/20, 181:75/61, 182:25/6e
  , 183:38/64, 184:4d/0d, 185:b8/0a, 186:74/70, 187:20/72, 188:66/65
  , 189:3d/73, 190:21/73, 191:47/20, 192:50/61, 193:54/6e, 194:75/79
  , 195:10/20, 196:80/6b, 197:7d/65, 198:b8/79, 199:ed/20, 200:75/74
  , 201:0a/6f, 202:66/20, 203:ff/74, 204:75/72, 205:ec/79, 206:66/20
  , 207:ff/61, 208:75/67, 209:e8/61, 210:eb/69, 211:0f/6e, 212:51/20
  , 213:51/2e, 214:66/2e, 215:ff/2e, 216:75/20, 217:bc/0d, 218:eb/0a
  , 219:07/00, 220:51/00, 221:51/00, 222:66/00, 223:ff/00, 224:36/00
  , 225:1c/00, 226:7c/00, 227:b4/00, 228:08/00, 229:e8/00, 230:e9/00
  , 232:72/00, 233:13/00, 234:20/00, 235:e4/00, 236:75/00, 237:0f/00
  , 238:c1/00, 239:ea/00, 240:08/00, 241:42/00, 242:89/00, 243:16/00
  , 244:1a/00, 245:7c/00, 246:83/00, 247:e1/00, 248:3f/00, 249:89/00
  , 250:0e/00, 251:18/00, 252:7c/00, 253:fb/00, 254:bb/00, 255:aa/00
  , 256:55/00, 257:b4/00, 258:41/00, 259:e8/00, 260:cb/00, 262:72/00
  , 263:10/00, 264:81/00, 265:fb/00, 266:55/00, 267:aa/00, 268:75/00
  , 269:0a/00, 270:f6/00, 271:c1/00, 272:01/00, 273:74/00, 274:05/00
  , 275:c6/00, 276:06/00, 277:46/00, 278:7d/00, 280:66/00, 281:b8/00
  , 282:85/00, 283:55/00, 286:66/00, 287:ba/00, 292:bb/00, 294:80/00
  , 295:e8/00, 296:0e/00, 298:66/00, 299:81/00, 300:3e/00, 301:1c/00
  , 302:80/00, 303:a1/00, 304:f3/00, 305:42/00, 306:6f/00, 307:75/00
  , 308:74/00, 309:e9/00, 310:f8/00, 311:02/00, 312:66/00, 313:03/00
  , 314:06/00, 315:60/00, 316:7b/00, 317:66/00, 318:13/00, 319:16/00
  , 320:64/00, 321:7b/00, 322:b9/00, 323:10/00, 325:eb/00, 326:2b/00
  , 327:66/00, 328:52/00, 329:66/00, 330:50/00, 331:06/00, 332:53/00
  , 333:6a/00, 334:01/00, 335:6a/00, 336:10/00, 337:89/00, 338:e6/00
  , 339:66/00, 340:60/00, 341:b4/00, 342:42/00, 343:e8/00, 344:77/00
  , 346:66/00, 347:61/00, 348:8d/00, 349:64/00, 350:10/00, 351:72/00
  , 352:01/00, 353:c3/00, 354:66/00, 355:60/00, 356:31/00, 357:c0/00
  , 358:e8/00, 359:68/00, 361:66/00, 362:61/00, 363:e2/00, 364:da/00
  , 365:c6/00, 366:06/00, 367:46/00, 368:7d/00, 369:2b/00, 370:66/00
  , 371:60/00, 372:66/00, 373:0f/00, 374:b7/00, 375:36/00, 376:18/00
  , 377:7c/00, 378:66/00, 379:0f/00, 380:b7/00, 381:3e/00, 382:1a/00
  , 383:7c/00, 384:66/00, 385:f7/00, 386:f6/00, 387:31/00, 388:c9/00
  , 389:87/00, 390:ca/00, 391:66/00, 392:f7/00, 393:f7/00, 394:66/00
  , 395:3d/00, 396:ff/00, 397:03/00, 400:77/00, 401:17/00, 402:c0/00
  , 403:e4/00, 404:06/00, 405:41/00, 406:08/00, 407:e1/00, 408:88/00
  , 409:c5/00, 410:88/00, 411:d6/00, 412:b8/00, 413:01/00, 414:02/00
  , 415:e8/00, 416:2f/00, 418:66/00, 419:61/00, 420:72/00, 421:01/00
  , 422:c3/00, 423:e2/00, 424:c9/00, 425:31/00, 426:f6/00, 427:8e/00
  , 428:d6/00, 429:bc/00, 430:68/00, 431:7b/00, 432:8e/00, 433:de/00
  , 434:66/00, 435:8f/00, 436:06/00, 437:78/00, 439:be/00, 440:da/00
  , 441:7d/00, 442:ac/00, 443:20/00, 444:c0/00, 445:74/00, 446:09/00
  , 447:b4/00, 448:0e/00, 449:bb/00, 450:07/00, 452:cd/00, 453:10/00
  , 454:eb/00, 455:f2/00, 456:31/00, 457:c0/00, 458:cd/00, 459:16/00
  , 460:cd/00, 461:19/00, 462:f4/00, 463:eb/00, 464:fd/00, 465:8a/00
  , 466:16/00, 467:74/00, 468:7b/00, 469:06/00, 470:cd/00, 471:13/00
  , 472:07/00, 473:c3/00, 474:42/00, 475:6f/00, 476:6f/00, 477:74/00
  , 478:20/00, 479:65/00, 480:72/00, 481:72/00, 482:6f/00, 483:72/00
  , 484:0d/00, 485:0a/00, 504:fe/00, 505:02/00, 506:b2/00, 507:3e/00
  , 508:18/00, 509:37/00
  1) Copy original to backup
  2) Copy backup to original
  3) No action
  ?
	# option 1 works well, which indicates the backup is somehow corrupted.
So there is a work around in v4 that takes care of this issue until a real solution is found, which will be the topic of another thread in the near future. It should be noted that this issue is old in that exists in my old uefi and f2fs flash drive installer programs that both used the gparted GUI. While the 4th revision should be 'safe' there will be no next version until this issue is solved. Bear in mind this is experimental so use AT YOUR OWN RISK.
* this script is somewhat dependent on @gyro's vision of overlay in Puppy Linux. That may or may not change in the future.
Attachments
install2usb.gz
revision 4
(7.88 KiB) Downloaded 232 times
Last edited by 01micko on Tue 06 Mar 2018, 12:01, edited 3 times in total.
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#137 Post by 01micko »

I tried the second revision of install2usb on my slacko64 overlay install (upgraded from 0.2 to 0.4 without issue it seems) because that way I can test the UEFI feature. The installation went without error.

I booted it in my wife's macbook-air and got the grub2 screen and proceeded to boot. Booted, connected to wifi and a few other tweaks were made and saving to the second partition worked fine, except for an 'overlay failed to mount at /' error on shutdown. It might be this kernel (4.9.73 64 bit). I don't know but it doesn't seem to affect anything. I rebooted fine.

Subsequent shutdowns and reboots do not show the overlay error.

Cheers!
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#138 Post by gyro »

01micko wrote:I booted it in my wife's macbook-air and got the grub2 screen and proceeded to boot. Booted, connected to wifi and a few other tweaks were made and saving to the second partition worked fine, except for an 'overlay failed to mount at /' error on shutdown. It might be this kernel (4.9.73 64 bit). I don't know but it doesn't seem to affect anything. I rebooted fine.
That would be an attempt to remount the main overlay as "ro".
If there's no complaints from "fsck" on the subsequent boot, then no problem.
In the "normal" rc.shutdown, these kinds of remounts are redirectd to /dev/null, so it's display could be seen as being residule "debug".

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#139 Post by gyro »

01micko wrote:Yes, very handy.. but we need an easy installer, perhaps to USB for testing anyway.

I have obliged. Seems to work ok, posting from a saved install to ext4 (no journal - to reduce writes).
Thanks, I'll try it.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

01micko's install2usb

#140 Post by gyro »

@01micko,
I've tested a slightly patched version of "install2usb" and it works great in both UEFI, and LEGACY.
Please consider the attached patch file as a suggestion.

The patch file, "install2usb.diff", does 3 things:
1. Overides DISTRO_FILE_PREFIX with data from the name of the target puppy...sfs, so the boot config files reflect the target Puppy, not the host Puppy.
2. Removes the "psave=" parameter from all boot configs.
This is not needed, since the save partition is the same as the sfs partition. And it resuilts in the bootspecs file being stored in the root of partition 2, instead of in the directory with the sfs files.
3. For backwards compatibility, specifies the save partition with "pupsfs=" and the sfs directory with "psubdir=".

Note: If this script were to be aimed at only "overlay_init" then it would be preferable to use "psfspart=" and "psfsdir=" instead of "pupsfs=" and "psubdir=".

Additional features I would like it to have:
1. An option to have a normal ext4 partition, i.e. with journal.
Given the price of USB sticks, I think the "cost" of the journal is good value as insurance against data corruption.
2. An option to specify a label for the Linux partition.
The label on the vfat partition could also be optional and able to be specified.

gyro
Attachments
install2usb.diff.gz
gunzip to produce "install2usb.diff"
(810 Bytes) Downloaded 236 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Re: 01micko's install2usb

#141 Post by 01micko »

gyro wrote:Note: If this script were to be aimed at only "overlay_init" then it would be preferable to use "psfspart=" and "psfsdir=" instead of "pupsfs=" and "psubdir=".
We'll see where this goes first. May well be worth including 'overlay' facility in mainline 'puppy'.. or not.
gyro wrote:Additional features I would like it to have:
1. An option to have a normal ext4 partition, i.e. with journal.
Given the price of USB sticks, I think the "cost" of the journal is good value as insurance against data corruption.
2. An option to specify a label for the Linux partition.
The label on the vfat partition could also be optional and able to be specified.

gyro
Done and done. See revision 4.
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: 01micko's install2usb

#142 Post by gyro »

01micko wrote:Done and done. See revision 4.
Thanks. I'll test.
I intend to include this installer in my next release of "onverly_init", so I've been playing with it a bit and come up with a couple of other possible changes.
1. Include a copy of "puppy.png" with the binary, and always use it.
(I assume that the host Puppy and the target Puppy will be different.)
2. Make "ext4 (no journal), the default with "ext2" last.
3. Align the partitions to 4MiB.
(I came across a suggestion that some usb sticks work better this way, although it's not been obvious in my testing.)
4. Copy "vmlinuz" and "initrd.gz" into a sub-directory of the fat32 partition with the same name as the sub-directory on the Linux partition.
This means a second puppy can be added manually, using this one as a template.

Sorry about this, I'll get back with another "patch" for these suggestions, after I've tested your new version.

I've been tesing on an el-chepo 8MiB stick, thats very slow at writing,
"ext2" was so slow, I almost decided that the machine was hung.
"f2fs" worked fine with a UEFI boot, but failed to boot with SYSLINUX. This may be a problem with the SYSLINUX on my host Puppy.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Recent kernel 4.9.86

#143 Post by gyro »

I've uploaded "huge-4.9.86-gyro-pae.tar.bz2". This kernel was released on 2018-03-03.

I compiled it on Xenialpup 7.5, using the woof-ce kernel-kit,

It's a 32bit PAE kernel.
It contains only a small set of firmware.
It contains overlayfs support built-in.

Downloads:
http://www.fishprogs.software/puppy/ini ... ae.tar.bz2
http://www.fishprogs.software/puppy/ini ... z2.md5.txt
http://www.fishprogs.software/puppy/ini ... sha256.txt

I use this kernel for all my xenialpup 7.5 Puppies.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#144 Post by gyro »

01micko wrote:* bugfix: copy appropriate BOOT_SPECS to initrd,gz
* feature: add P_TZ and P_TZONE vars to TIME_ZONE file (based on running systems timezone) >> initrd.gz
Unfortunately both these are obseleted by the next version of "overlay_init". In that neither of these files now exist in "initrd.gz".

I'm not sure that a general installer should be updrading the "initrd.gz", rather it should just be installing the Puppy that's provided.

On the other hand I like the idea of adding timezone information.
Wheras it's inappropriate to have timezone information in an initrd.gz in an iso,
it's quite resonable to have timezone information in the initrd.gz of a local install.

So I'll bring forward the next relsease of "overlay_init" so this installer can be properly sorted before the final release.
For this version I'll include a slightly modified version of your version 4 installer, as an application. It will update the timezone information in initrd.gz if it's an 'overlay' Puppy and there is none already there.

I've tested your version 4, with 2 modifications:
* changed the order of the filesystems so that "ext4 (no journal)" is the first, and therefore default.
* deleted the 2 obseleted features as per above.
Both UEFI and LEGACY boots worked fine using "ext4 (no journal)".
Also the fsck issue with the vfat partition is "fixed", though it looks a bit scary when the installer is run from a terminal.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: 01micko's install2usb

#145 Post by gyro »

gyro wrote:I intend to include this installer in my next release of "onverly_init", so I've been playing with it a bit and come up with a couple of other possible changes.
1. Include a copy of "puppy.png" with the binary, and always use it.
(I assume that the host Puppy and the target Puppy will be different.)
2. Make "ext4 (no journal), the default with "ext2" last.
3. Align the partitions to 4MiB.
(I came across a suggestion that some usb sticks work better this way, although it's not been obvious in my testing.)
4. Copy "vmlinuz" and "initrd.gz" into a sub-directory of the fat32 partition with the same name as the sub-directory on the Linux partition.
This means a second puppy can be added manually, using this one as a template.
On further reflection, only 2 is important.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Release of overlay_init-0.5

#146 Post by gyro »

Release of overlay_init-0.5

This release is to get the latest (and hopefully the last) version of "init" out there, so that others don't waste their time doing stuff that I am busily obseleting.

The utilities are now pretty much functionally complete, but may get some re-organisation.

Download from http://www.fishprogs.software/puppy/ini ... it-0.5.tar.

There's a delta for artfulpup-17.11+15.iso http://www.fishprogs.software/puppy/ini ... .iso.delta.
And a delta for slacko-700-RC3_k4.4.70-PAE_2017-12-10.iso http://www.fishprogs.software/puppy/ini ... .iso.delta.

Changes for this version:
1. Instead of "initrd.gz" containing a TIME_ZONE file and a default bootspecs file, it now contains just an "OVERLAY_SPECS" file.
The bootspecs file exists only outside "initrd.gz" and is now called "${DISTRO_FILE_PREFIX}BOOTspecs".
2. Contains a version of 01micko's "install2usb" as "USB Installer - Flash Drives" in the "Setup" menu.
I've modified it a bit so I've changed the version to "0.4.1", my patch is attached.
The patch, changes the order of the filesystems in the selection dialog.
It also replaces the obseleted "initrd.gz" functions with a timezone facility that works with the current "init".

gyro
Attachments
install2usb-0.4.1.diff.gz
gunzip to produce "install2usb-0.4.1.diff"
(1.09 KiB) Downloaded 231 times

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

comments on "install2usb"

#147 Post by gyro »

"install2usb" is great, it's rather cool to be able to install an "overlay" iso to a usb stick and have the timezone automatically set.
So again, a big thanks to 01micko for this utility.

I recommend that labels are used to identify the partitions(s), just make sure that they are unique for your computer.

The layout of files over the 2 partitions is interesting, i.e. "vmlinuz" and "initrd.gz" on the vfat boot partition and the puppy sfs files on the Linux partition.

This overlay "init" has no problem with this, but there could be some possible confusion when changing the kernel, with the "vmlinuz" in one partition and the "zdrv" in the other. It may be an idea to provide some mechanism to indicate to the booted Puppy where the "vmlinuz" file is located.

The 'testing' "init" has no problem with this, but the subsequent running system does, i.e. "initmodules -q" does nothing and "bootmanager" does not show "initmodules" as an option.
In both cases it's because they can't locate "initrd.gz" in the frugal install directory with "puppy...sfs".
This "overlay_init" package contains patches so that both "initmodules" and "bootmanager" look for the "DOIMODS" variable in "/etc/rc.d/PUPSTATE" instead of greping "initrd.gz" for "pimod".
This patch could be ported to woof-ce 'testing'.
This patch was introduced because it's a lot lot faster starting "intmodules" or "bootmanager" off a slow usb stick.

The "classic" "init" script would not handle this at all, because it searches for an appropriate "vmlinuz" and assumes that that is the frugal install directoty.

gyro

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

Re: comments on "install2usb"

#148 Post by 01micko »

gyro wrote:"install2usb" is great, it's rather cool to be able to install an "overlay" iso to a usb stick and have the timezone automatically set.
So again, a big thanks to 01micko for this utility.
You're welcome. :)
gyro wrote:The layout of files over the 2 partitions is interesting, i.e. "vmlinuz" and "initrd.gz" on the vfat boot partition and the puppy sfs files on the Linux partition.
There are 2 reasons for this. Probably the most important is that UEFI requires a FAT filesystem to do it's thing.The kernel and initial ramdisk must be on the same partition as the UEFI stuff. The second is that at this time, no bootloader supports F2FS filesystem. I expect the latter to change if F2FS ever grows in popularity but I doubt that the former will at any point in time soon. Why such a modern technology as EFI decided that using FAT to boot was a good idea is way beyond me, but I suppose there are reasons. Perhaps the simplicity and the universal nature of it had it's appeal to the developers.
gyro wrote:This overlay "init" has no problem with this, but there could be some possible confusion when changing the kernel, with the "vmlinuz" in one partition and the "zdrv" in the other. It may be an idea to provide some mechanism to indicate to the booted Puppy where the "vmlinuz" file is located.
You are correct and I am aware of the issue and I suppose I should get this sorted before your final overlay release. 'testing' also has this bug because the F2FS usb installer naturally does the same thing (boots off fat, runs on linux FS partition)
gyro wrote:The 'testing' "init" has no problem with this, but the subsequent running system does, i.e. "initmodules -q" does nothing and "bootmanager" does not show "initmodules" as an option.
In both cases it's because they can't locate "initrd.gz" in the frugal install directory with "puppy...sfs".
This "overlay_init" package contains patches so that both "initmodules" and "bootmanager" look for the "DOIMODS" variable in "/etc/rc.d/PUPSTATE" instead of greping "initrd.gz" for "pimod".
This patch could be ported to woof-ce 'testing'.
This patch was introduced because it's a lot lot faster starting "intmodules" or "bootmanager" off a slow usb stick.

The "classic" "init" script would not handle this at all, because it searches for an appropriate "vmlinuz" and assumes that that is the frugal install directoty.
yes the patch probably should be ported to 'testing'. I should test and fix the 'install2usb' script for testing which will make obsolete the UEFI and F2FS usb installers. I'll get onto that after I fix the 'change_kernels' issue.

I have been thinking that if a users wants an ext(2,3,4) save partition and doesn't want UEFI (or can't use UEFI) to make a single partition with 'install2usb'. It does make things simpler in those cases. I'll think about that.

BTW, v0.5 of overlay init is working ok for me after some initial upgrade teething problems from 0.4 on my slacko64 frugal install to my laptop. I intend to burn a new dvd of the 32 bit slacko v0.5 (updated with delta) and perform a usb install off the dvd. Soon.

Cheers and a big thanks to you too for the overlay init initiative!
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: comments on "install2usb"

#149 Post by gyro »

01micko wrote:
gyro wrote:This overlay "init" has no problem with this, but there could be some possible confusion when changing the kernel, with the "vmlinuz" in one partition and the "zdrv" in the other. It may be an idea to provide some mechanism to indicate to the booted Puppy where the "vmlinuz" file is located.
You are correct and I am aware of the issue and I suppose I should get this sorted before your final overlay release. 'testing' also has this bug because the F2FS usb installer naturally does the same thing (boots off fat, runs on linux FS partition)
My first thought would be for the kernel change script to "guess" that the "vmlinuz" file is in the root of the "1" partition corresponding to the "PDEV1" partition.
Or write a text file, e.g. "vmlinuz_location", in the sfs directory on the Linux partition that contains information that allows the kernel change script to establish the correct location of "vmlinuz".
Just my 2 cents worth.
01micko wrote:
gyro wrote:This "overlay_init" package contains patches so that both "initmodules" and "bootmanager" look for the "DOIMODS" variable in "/etc/rc.d/PUPSTATE" instead of greping "initrd.gz" for "pimod".
This patch could be ported to woof-ce 'testing'.
This patch was introduced because it's a lot lot faster starting "intmodules" or "bootmanager" off a slow usb stick.
yes the patch probably should be ported to 'testing'.
I'll try to do this soon.
I have a little git problem to sort first.

Later edit:
Support for "DOIMODS" is now committed in woof-CE 'testing'.

gyro

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

change_kernels

#150 Post by 01micko »

Attached is a diff for the /usr/sbin/change_kernels script taken from slacko-overlay0.5-700-RC3_k4.4.70-PAE_2017-12-10.iso (created from delta).

While I conclude that it works with a split fat/ext (boot/save on separate partitions - typical of the 'install2usb' script) I did have a failure. Using the huge-4.9.86-gyro-pae.tar.bz2 from here the kernel change appeared to go fine but on reboot my system would not boot. Probably not the fault of the adjusted script but an incompatibility with slacko versus xenial; something to do with ext4. In the end the main sfs could not be found and I was dropped to the init prompt.
Later I changed kernels with my slacko64 kernel (because this hardware is 64 bit capable) and the change of kernel and boot went fine.

You can of course use the attached diff with the 'patch' utility after it is decompressed. This isn't tested with the 'testing' init as yet but should be OK. Will test later,
Attachments
change_kernels.diff.gz
(701 Bytes) Downloaded 238 times
Screenshot.png
(52.56 KiB) Downloaded 340 times
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#151 Post by gyro »

@01micko,

I just tested a patched "change_kernels" script and it worked fine.

I setup a directory containig the files from the release xenialpup 7.5 iso.
I then patched it's "change_kernels" script with your diff and added it as a ydrv.
I then installed these files to a usb stick using "install2usb".
After rebooting the usb stick into pupmode=13, I ran the patched "change_kernels" script, to upgrade to my 32bit PAE 4.9.86 kernel.
On reboot everything worked fine, using the new kernel.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#152 Post by gyro »

@01micko,
I have a slight concern with your patch to "change_kernels":
Could it cope with a device that contains multiple Puppies, each in their own PSUBDIR, but with files split between sdx1 and sdx2 a bit like "install2usb" except that "vmlinuz" and "initrd.gz" are in their own PSUBDIR on sdx1, (so sdx1 can cope with multiple Puppies)?

I'm assuming that this "install2usb' will become the "standard" installer for usb sticks.
And then some folk might use it's file layout as a template to setup a multiple Puppy usb HD.

PS: This instller should be seen as the upcomming "standard" installer for usb sticks, and have it's own forum topic.

gyo

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#153 Post by 01micko »

gyro wrote:@01micko,
I have a slight concern with your patch to "change_kernels":
Could it cope with a device that contains multiple Puppies, each in their own PSUBDIR, but with files split between sdx1 and sdx2 a bit like "install2usb" except that "vmlinuz" and "initrd.gz" are in their own PSUBDIR on sdx1, (so sdx1 can cope with multiple Puppies)?
Not multiple. It is only searching for 'vmlinuz'. However, as you previously mentioned, it would be ideal to place the boot files (vmlinuz, initrd.gz) in a PSUBDIR at the root of the vfat partition. That way, the 'change_kernels' script could search for $PSUBDIR/vmlinuz. Much neater if one does want to have multiple installs to a USB device.
gyro wrote:I'm assuming that this "install2usb' will become the "standard" installer for usb sticks.
And then some folk might use it's file layout as a template to setup a multiple Puppy usb HD.

PS: This instller should be seen as the upcomming "standard" installer for usb sticks, and have it's own forum topic.

gyo
Well there is no reason why it shouldn't be the 'standard', but I think I would still like to include single partition installs for ext[2,3,4] when UEFI is not wanted/not an option. ALL files should go to the PSUBDIR in their respective partitions.

I'll tidy that up next and then create a thread for 'install2usb' (which may have a name change.. something like 'pupinstall2usb' :? ? - open to suggestions)
Puppy Linux Blog - contact me for access

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#154 Post by gyro »

@01micko,

I have another suggestion concerning the "hidden" "vmlinuz" issue.
When running "install2usb" on the host Puppy, the location of "vmlinuz" is known. So how can we communicate this information to "change_kernels" in the runnng target Puppy?

In "install2usb", a "pvmlinuzpart" boot parameter is added for the target Puppy, whose value is the LABEL or UUID of the vfat partition.
The "init" script is modified so that it picks-up "pvmlinuzpart" and writes it to PUPSTATE as "PVMLINUZPART", (also add support for "pvmlinuzdir" for completeness). This is a fairly trivial patch to "init", so it could be applied to any "init" script.
In "change_kernels", if "PVMLINUZPART" is empty then use "PDEV1".

It looks complicated, but none of the modifications are difficult, and the result is very flexible, and it's all setup by the process that "knows".
"change_kernels" doesn't have to "guess".

I'll upload an "overlay_init-0.5b.tar" containg a patched "init" script.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#155 Post by gyro »

01micko wrote:I'll tidy that up next and then create a thread for 'install2usb' (which may have a name change.. something like 'pupinstall2usb' :? ? - open to suggestions)
How about 'pupinstall2usbstick'.
Unless it is also targeted to support multiple frugal installs to a usb HD, i.e. an option to skip partitioning.
Then 'pupinstall2usb'.

gyro

Post Reply