You are not logged in.

#26 2017-11-11 03:04:23

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 792

Re: Remastering Bunsen

Hmm. Would it be possible to "ghost" an already built system into an install iso using some variant of this? Like copy / recursively into squashfs-root, then build the iso? That would be extremely handy.

Offline

#27 2017-11-11 13:59:50

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

^ Oooh, interesting question glasses

The only problem with that would be the way the live system creates the user on-the-fly so I think any pre-existing users might b0rk things somewhat.

My method is a complete hack, to create installable live ISO images see the official Debian documentation:

http://debian-live.alioth.debian.org/li … al.en.html


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#28 2017-11-11 17:47:26

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 779

Re: Remastering Bunsen

Random (and untested) thought about installing from a live usb to hdd. Perhaps dd command to copy from t-drive to partition or rsync, as per the way I now tend to backup and/or move a gnu/Nix OS around on the partitions. A bit of fiddling required but seems to get the job done fine. ie: Changing a couple of the relevant files grub.cfg and /etc/fstab to the correct partition layout. Not really seeing why it wouldn't work for installing to disk from t-drive.

Vll! smile

PS, just something that came to mind while reading over the thread and seeing lack of installer mentioned. Also not likely the easiest or best method. And remembered this assuming someone REALLY wanted to remaster whichever gnu/Linux and did want to include an installer along with it.

Last edited by BLizgreat! (2017-11-11 18:02:39)

Offline

#29 2017-11-11 18:31:12

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

BLizgreat! wrote:

lack of installer mentioned

The installer is still present on the image and it might still manage to function but I think the changes wrought in the live environment would probably mess things up later in the installed system (if it actually completed).


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#30 2017-11-15 01:22:59

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,409
Website

Re: Remastering Bunsen

Head_on_a_Stick wrote:

...to create installable live ISO images see the official Debian documentation:

http://debian-live.alioth.debian.org/li … al.en.html

BL are using the live-build described there, which used to be the software used to build Debian images too. Now they are built using live-wrapper, which is distinguished by its wonderful lack of documentation. Some day, maybe they'll release something which we can use...

...but live-build continues to be maintained (by Raphael Herzog) so it's still a good option.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#31 2017-11-15 10:31:29

Steve
Member
Registered: 2017-01-03
Posts: 606

Re: Remastering Bunsen

@John, what is the average build time for a distro like Bunsenlabs. I recently tried lfs out but my computer is not powerful enough to be a) everyday driver b) build environment, the laptop just became unresponsive using only 4 cores from 8 building gcc so decided to can it. Just curious.

Offline

#32 2017-11-15 13:22:07

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 792

Re: Remastering Bunsen

^ On a four core laptop, live-build would take an hour to an hour and a half to build a very basic system up. Once you have the configuration setup correctly, most of it is pretty straight-forward, with apt-get doing a lot of work in the chroot environment.

I always had to worry about heat in the makesquashfs stage, however, because it will take whatever cpu it can get to run it., i.e all 4 cores on my laptop would run at 100%. Live-build is definitely not something you want to run if heat is a worry. It has been awhile since I did my last build. I am pretty sure my desktop could handle the stress and make that hour to hour and a half significantly less painful.

Last edited by tknomanzr (2017-11-15 13:22:46)

Offline

#33 2017-11-16 03:14:03

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 3,409
Website

Re: Remastering Bunsen

This desktop is pretty old (4 cores Intel i3 3.2GHz, 4GB RAM) but the last Deuterium isos built in just under an hour I seem to remember. The only time when the whole machine was taken over was making the squashfs at the end, as tk mentioned.

I found a big reduction in the time came by setting the best local mirror for package downloads: '--mirror-bootstrap' in live-build's auto/config. This doesn't affect the mirror set in the final iso.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#34 2017-11-16 21:30:45

nashjc
Member
Registered: 2016-04-01
Posts: 16

Re: Remastering Bunsen

This is in regard to Head_on_a_Stick recipe Nov 10.

I already have the filesystem.squashfs (from my crunchmaster run) so did not do any chroot.

Did all the other steps. Tried both dd and cp to load 2 different sticks.

Both sticks boot on Asus UL30A. Neither recognized on Asus UX303L, which is a surprise as the
original bl-Deuterium (April version) does boot. Wondering if it could be something to do with
specifying filesystem.squashfs size and related files.

I've managed to get an EFI bootable stick (using an Arch recipe), with no legacy boot. Sigh.

My plan is to carefully try the latter again making more extensive notes. Also to research the extra files related to the squashfs image a bit more. I'd really like boot on both.

One note: I'm using an i386 base because I've some old hardware that is of interest for my project. Maybe that is part of the issue?

Cheers, JN

Offline

#35 2017-11-17 15:14:24

nashjc
Member
Registered: 2016-04-01
Posts: 16

Re: Remastering Bunsen

Further follow-up on the recipe by Head_on_a_Stick:

I decided to try just unpacking and repacking the distribution iso. Here is a script taken from the recipe.

#!/bin/bash
# remixscrip1.sh JN 171117

# sudo apt install squashfs-tools genisoimage syslinux-utils
# sudo mount bl*.img /mnt
# But site only contains iso
sudo mount ~/Downloads/bl-Deuterium-i386_20170429.iso /mnt
mkdir -p ~/iso
cp -a /mnt ~/iso/remix
cd ~/iso/remix/live
sudo unsquashfs filesystem.squashfs
## for i in proc sys dev dev/pts; do sudo mount --bind /$i squashfs-root/$i; done
## sudo chroot squashfs-root /bin/bash

## . /etc/profile && . ~/.bashrc

## exit # or <Ctrl+d>
#  unmount proc?? JN addn
## for i in proc sys dev dev/pts; do sudo umount squashfs-root/$i; done
sudo rm filesystem.squashfs
## typo??
##sudo mksquashfs squahsfs-root filesystem.squashfs
sudo mksquashfs squashfs-root filesystem.squashfs
# If the kernel has been updated or changed,
# copy the new version to ~/iso/remix/live/ along
# with the associated initial ramdisk:
## sudo cp squashfs-root/{vmlinuz,boot/initrd*.img} .
# And then clean up:
sudo rm -r squashfs-root
# Finally, generate the new ISO image:
cd ~/iso/remix
## ?? sudo JN
sudo genisoimage -l -r -J -V "BUNSENLABS_HYDROGEN" -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o ../remix.img ./

# The resulting image can be burned directly to a CD or DVD
# but it needs to be "treated" before flashing to a USB stick:
# ??sudo
sudo isohybrid ~/iso/remix.img
# With the usual method for the transfer:
## sudo cp ~/iso/remix.img /dev/sdX

Note that I fixed some minor typos and missing "sudo" elements.

So this should give back a bootable thumb drive. As a test, I formatted a 2GB drive, did the
last (commented out) line above, with sdX changed to sde for my system using the ORIGINAL bl iso (not img). This boots fine on UX303L and UL30A i.e., EFI and legacy. Then I ran the script, reformatted drive, and did the copy of the remix.img. Boots legacy on UL30A, not EFI on UX303L.

I'm thinking there's some parameter missing somewhere in the genisoimage line, or else I'm missing a step.

Ideas welcome.

JN

Offline

#36 2017-11-17 23:39:33

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

nashjc wrote:

I fixed some minor typos

Thanks! (But it was only a single typo, surely?)

missing "sudo" elements

I'm pretty sure that my steps are correct but you may have to `chmod +w isolinux/isolinux.bin` before running `genisoimage` as your normal user.

I formatted a 2GB drive, did the last (commented out) line above, with sdX changed to sde for my system using the ORIGINAL bl iso (not img). This boots fine on UX303L and UL30A i.e., EFI and legacy. Then I ran the script, reformatted drive, and did the copy of the remix.img. Boots legacy on UL30A, not EFI on UX303L

I haven't looked at UEFI support (yet) but I know that my tweaked images do not support it, I think this is because a special type of image is needed to boot in UEFI mode and the `genisoimage` command does not produce this.

All UEFI machines should have a firmware ("BIOS") option to boot in Legacy mode but some motherboard manufacturers are happy to ship broken implementations of the UEFI standard, unfortunately.

Check the official Debian Live Build Manual for instructions on how to build an image correctly from scratch:

http://debian-live.alioth.debian.org/li … al.en.html


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#37 2017-11-18 01:21:09

nashjc
Member
Registered: 2016-04-01
Posts: 16

Re: Remastering Bunsen

Thanks. Will keep at it on a slow and steady pace. It's already close enough to be usable for many machines,
but will be a big step up if user doesn't have to think about EFI/Legacy.

Cheers, JN

Offline

#38 2017-11-18 11:31:47

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

Found this:

https://stackoverflow.com/questions/318 … e-and-uefi

I will be trying that myself at some point, I will post back then.


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#39 2017-11-18 15:54:37

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

I'm doing all this from Arch and the -eltorito-boot option won't accept -e as a flag in their package so I've made this function using `xorriso` instead:

function burn {
	xorriso -as mkisofs -iso-level 3 -full-iso9660-filenames -volid "$1" -eltorito-boot isolinux/isolinux.bin -eltorito-catalog isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -output ../"$2" ./
}

It can be called from the top of the ISO filesystem tree with the name of the image volume as the first argument and the name of the actual file to be output as the second argument, like this:

burn BUNSENLABS_HYDROGEN sharpbang-stretch.img

This seems to create a hybrid partition table on the image (as required for UEFI booting) but my (broken) UEFI laptop still won't boot it  hmm

The search continues...


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#40 2017-11-18 21:34:49

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

Refined version of my ISO making function (with a name change and an added `isohybdrid` line):

function mkiso {
	xorriso -as mkisofs \
	-iso-level 3 \
	-full-iso9660-filenames \
	-volid "$1" \
	-eltorito-boot isolinux/isolinux.bin \
	-eltorito-catalog isolinux/boot.cat \
	-no-emul-boot -boot-load-size 4 -boot-info-table \
	-eltorito-alt-boot \
	-e boot/grub/efi.img \
	-no-emul-boot -isohybrid-gpt-basdat \
	-output ../"$2" ./
	isohybrid ../"$2"
}

As before, run the function from the top of the ISO tree and pass the label to be applied as the first argument and the image name as the second argument, for example:

mkiso BUNSENLABS_HYDROGEN custom.img

The resulting images still will not boot on my UEFI machine though (unless Legacy mode is enabled), perhaps you will have more luck.


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#41 2017-11-20 20:40:02

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

Nailed it  glasses

New function:

function mkiso {
	xorriso -as mkisofs \
	-iso-level 3 \
	-full-iso9660-filenames \
	-volid "$1" \
	-eltorito-boot isolinux/isolinux.bin \
	-eltorito-catalog isolinux/boot.cat \
	-no-emul-boot -boot-load-size 4 -boot-info-table \
	-isohybrid-mbr isolinux/isohdpfx.bin \
	-eltorito-alt-boot \
	-e boot/grub/efi.img \
	-no-emul-boot -isohybrid-gpt-basdat \
	-output ../"$2" ./
}

The isohdpfx.bin file is not included in the stock BL image, that was the missing puzzle piece.

Here is one I cut out of an Arch live ISO:

https://github.com/Head-on-a-Stick/conf … ohdpfx.bin

Copy that to isolinux/isohdpfx.bin (in the image's filesystem tree) and run the `mkiso` function (from the top of the tree and with arguments, as before) to generate the image.

Good luck!

EDIT: the UEFI boot menu is configured via boot/grub/grub.cfg  wink

Last edited by Head_on_a_Stick (2017-11-20 20:40:52)


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#42 2017-11-21 06:57:38

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Remastering Bunsen

Just been through this thread again and I missed this detail the first time around:

nashjc wrote:

I already have the filesystem.squashfs (from my crunchmaster run) so did not do any chroot.

Try again but this time start with a "fresh" BunsenLabs ISO image and squashfs, the crunchmaster script is opaque in it's operation (to me, at least, and I can't be bothered reading it) and may be concealing errors, this is why I favour a "manual" approach.

Last edited by Head_on_a_Stick (2017-11-21 06:58:36)


"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#43 2017-12-05 13:42:04

nashjc
Member
Registered: 2016-04-01
Posts: 16

Re: Remastering Bunsen

HOAS -- Very much appreciate what you've posted. I can confirm it works. And with image customized by CrunchMaster.

What I've tried:
  A) (to check things work OK) Unpacked distribution iso (BL-deuterium 32 bit) and repack with your recipe.
     Boots on my Asus Zenbook UX303 (EFI) and UL30A (legacy).
  B) copy my custom squashfs into the unpacked BL file tree, delete the filesystem.packages and size stuff.
     Run recipe, pass to USB and reboots fine on both. (Though on UL30A the default volume of playback is too
     high!)
  C) rename/copy image to .iso and try in VirtualBox -- the installer starts, though I did not carry through to completion.

In any event, many thanks.

JN

PS. Planning to have write-up in due course on wiki.linux-ottawa.org. This has been one of group's projects.

Offline

Board footer

Powered by FluxBB