Running Precise 5.4.93 (k 3.8.0) from an f2fs volume on SDHC

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Running Precise 5.4.93 (k 3.8.0) from an f2fs volume on SDHC

#1 Post by ETP »

Please see Barry’s post for the background to this topic: http://bkhome.org/blog2/?viewDetailed=00142

For current benchmarking of f2fs on SSD and SDHC see:
http://www.phoronix.com/scan.php?page=a ... sdhc&num=1

This version of Precise therefore includes partial support for f2fs but there is, AFAIK no boot-loader currently available capable of actually running on f2fs. For the purpose of this experiment I therefore elected to use my favourite technique which I term a “mixed frugal install
Attachments
Small.JPG
(63.9 KiB) Downloaded 5172 times
Last edited by ETP on Sat 16 Mar 2013, 09:51, edited 4 times in total.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

ETP,
A good start!

The way to go I think, is to create two partitions on the SDHC card, or whatever media you want to boot off.

The first will be fat16 and be just big enough to have vmlinuz.

The second partition will occupy the rest of the media and will be f2fs. This will have a full installation of Puppy, that is, just like a full hard drive installation, which basically means the contents of the puppy.sfs file copied to the partition.

The first partition will be setup with grub or syslinux or whatever.

This is my plan anyway, haven't done it yet.

That would be like a normal full hd installation, but we can also do it our puppy-way, with initrd and puppy.sfs, and the session saved to the entire f2fs partition. That way, we have the aufs layered f.s. and the benefit of being able to load extra sfs files.
[url]https://bkhome.org/news/[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Running Precise 5.4.93 (k 3.8.0) from an f2fs volume on SDHC

#3 Post by ETP »

Hi Barry,

The two partition approach had also been my favoured method that I tried first, but I could not get my BIOS to boot from it. (Fat32/f2fs)

I should explain however that my old Phoenix PG 6.00 BIOS is a quirky beast with “something of the night
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#4 Post by smokey01 »

I haven't tried to boot it from a USB yet but it works fine in VirtualBox.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Running Precise 5.4.93 (k 3.8.0) from an f2fs volume on SDHC

#5 Post by ETP »

Having finally wrestled my truculent BIOS into submission, I can report that 5493 is running fine on a 4GB SDHC card with two partitions. The first is a 16 MB fat partition, the second is f2fs taking up the remainder of the card. This is not yet a full install as Barry envisages. Rather, it is a small step in the right direction with the main sfs and savefile being held on the f2fs partition. As such it helps towards validating his proposal.

A full copy of the relevant syslinux.cfg is reproduced at the end of this post.

For the benefit of anyone wanting to try this approach I have prepared a 16 Meg image file that can in theory, be used to make any SD card or USB stick bootable and will be perceived by the BIOS as a hard disc.
It contains the kernel and initrd.gz from 5493, all the required syslinux files including the cfg below and two high quality splash screens. As an added bonus it also contains the grub files and syntax to dual boot XP with nothing to add or change on your hard drive.

The image file (16Meg5493.img) together with the XP utility to flash the image on to the target device (win32diskimager-v0.7-binary) are available on:

http://www.mydrive.ch

Guest login name = maddog@puppy4
Password= maddog

Win32diskimager is in ZIP form & just needs extracting. It does not require installation.

Procedure for using image file:

1. Delete all partitions on your target device.

2. Unplug any sticks or cards other than your target device.

3. In XP use Win32diskimager to write the image to the target.

4. Boot from your CD of 5493 using the boot-code “puppy pfix=ram
Attachments
comboshot.png
(137.27 KiB) Downloaded 4728 times
Last edited by ETP on Tue 12 Mar 2013, 14:30, edited 4 times in total.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Running Precise 5.4.93 (k 3.8.0) from an f2fs volume on SDHC

#6 Post by ETP »

Win32diskimager

In my previous post dated 26th Feb 2013 I mentioned that the image technique could in theory, be used on any card or stick. I have since then, using the same 16 Meg image file, produced a 4GB USB stick in an identical fashion.

It has proven to be a very useful method and with a more generic 256 Meg image could possibly be used as an alternative way of distributing most pups. Any stick or card so produced would be bootable and contain everything needed including the kernel, main sfs and syslinux menu system. In addition to completing the first run dialogues one would also have to format the rest of the device as ext4 using Gparted ready to receive the save file once created.

Gparted

Gparted is not f2fs aware. Nor can it understand the vfat format of a partition as small as 16 Meg. For clarification the following shows what it will display and although alarming at first sight is in fact correct.
Attachments
gparted_view.JPG
(90.13 KiB) Downloaded 4210 times
Last edited by ETP on Tue 12 Mar 2013, 14:29, edited 3 times in total.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

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

#7 Post by 01micko »

Hello ETP

Very nice work,, inspiring too, :)

I have just built a POC Slacko with k3.8.2 with all the f2fs capability. Works too.

I decided to approach things completely differently.

Given that no bootloader is f2fs capable then we are stuck with vfat to boot. Well, ext2(3,4) is a possibility but for simplicity (translate = noob compat) vfat is easy.

I tried and tried to do in one step an install with syslinux, even the latest but it kept failing. Not necessarily a syslinux problem, perhaps the way I was trying to bend it.

What I ended up doing was a 500M vFat partition to boot the RO stuff (vmlinuz, initrd,gz, main sfs and also an adrive sfs) with the save file on the f2fs, using grub4dos as the bootloader.. (I much prefer syslinux, but I was getting short on time and I knew what would work).

I'm more or less happy with the result and when (time permitting) I refine the result I'll post further findings.

Thanks for getting the ball rolling!

"The rolling stone gathers no moss"

:lol:

Cheers!
Puppy Linux Blog - contact me for access

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

PHATSlacko-5.5.00-SCSI

#8 Post by ETP »

Hi 01Micko,

PHATSlacko is stunning and very quick for a fully loaded pup. Thanks to you “Puppy
Attachments
PHATSlacko_16Meg_vfat_partition.png
Files in 16Meg image.
(1.71 KiB) Downloaded 4242 times
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

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

#9 Post by 01micko »

Hello ETP et al,

I downloaded your img file. I decided to see if I could script what you have and I succeeded, in a round a bout sort of way. As I do, I changed stuff [:lol: ] and removed some capabilities that your image has but also added a possible capability of dual booting the media. (This is not implemented, we'll see if the thing is stable first, plus see if it needs more features).

The end result is f2fs-usb-installer 336 KB

It should work with PHATSlacko and Upup-Precise >=3.8.2 as it requires at least a 3.8 kernel with f2fs enabled. The script does do a check for that. It also requires gparted-0.14.1-i686_F2FS-s14 for PHATSlacko and gparted-0.14.1-i686_F2FS-precise.pet for Upup-Precise-3.8.2 (first version) as subsequent versions of Upup-Precise include GParted-14.1 patched for f2fs, currently Upup-Precise is at 3.8.3.1.

The script is a wizard format and prompts you to create 2 partitions on the USB drive (didn't test SD card, probably will work), one of 32MB vfat (future expansion to dual/multiboot taken into account) and the other, rest of the device as f2fs. It then offers you a choice of where to copy the files, CD, ISO image or directory (which can be an existing frugal install). Appropriate locations containing the files are mounted, the appropriate partitions are mounted, files are copied and a syslinux.cfg is generated. The package includes extlinux, syslinux, mbr.bin, vesa-menu.c32, chain.c32 and some images for the boot screen, the last stage you get to choose that image, and you could add others if you want, as long as they work.

WARNING: This must be treated as experimental and as such is not recommended on a production system.

NOTE: The syslinux binaries are from version 4.03 in the Slackware repo. Some do overwrite the native puppy (old) bins.

Enjoy!
Puppy Linux Blog - contact me for access

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#10 Post by pemasu »

ETP and 01micko. Thanks !
It just works !
http://www.murga-linux.com/puppy/viewto ... 288#694288

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

f2fs-usb-installer

#11 Post by ETP »

Hi 01Micko,

I loaded it into Upup-Precise 3.8.3.1 and pointed it at a copy of the 3.8.3.1 ISO to produce a hybrid bootable 4GB SDHC card.

Not surprisingly my quirky BIOS refused to boot from it, as I always have to first prepare any card or stick with the HP Utility before applying syslinux.

It booted fine on a relatively new borrowed netbook however and all the menu options worked as expected.

I have in the past booted Puppy on this Intel Atom N570 1.6GHz both purely from USB stick and in a mixed install with the kernel on USB and the savefile and main sfs on the NTFS data partition. It is not a fast machine and I was stunned when it appeared to boot faster from the hybrid class 4 SDHC card. F2fs is however primarily targeted at SD cards for use in (Samsung) phones and cameras and its benefits truly became apparent.

Thanks for a great utility which I commend particularly for SDHC cards.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

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

#12 Post by 01micko »

Hi ETP, pemasu

Thanks for giving it a spin!

I have the dual boot capability working 8) . However, I want to get it working with the stock puppy binaries, if nothing more than to remove the bins from the package. Problem with the stock pup version of syslinux though is that it is very cut down and doesn't support vesamenu. This should be fine if you just want a single boot media. Also, Barry is more likely to look at the program this way and may get it working for Quirky, or even a future ARM arch pup.

What I can do is put in a test for syslinux version and inform the user about the above issue letting them know that they can get a later version of syslinux from PPM (if they are using upup/PHAT) if they want dual boot capability.
---------------------------------------------------------------------------------------------------------------

LATER...

I have it working with the stock puppy syslinux, but I left the images in, so the pet is now ~100M, remove the images and it will shrink dramatically. It still supports syslinux >= 4.0 but it needs to be installed separately.

NOTE: You must uninstall the previous version because the syslinux bins are in a non standard location and will be found by the script and bork installation. OR delete the directory /usr/share/syslinux_sp

SO now you can
  • load with stock syslinux with the limitation of no menu so you are restricted to one OS (pup) on the device, that will suit some users I guess
  • load an OS with the vesamenu as long as you install syslinux >=4.0
  • load another OS as a dual (and probably more will work too) boot without disturbing the originally loaded OS.
Here is the very simple code in syslinux.cfg that boots Upup or PHAT as a single OS on the device

Code: Select all

default /${BOOTD}/vmlinuz initrd=/${BOOTD}/initrd.gz pmedia=ataflash psavemark=2
..where ${BOOTD} is the dir name of where the boot files are. The script works that out from the main sfs name, so if there is puppy_precise_3.8.3.sfs it becomes precise_3.8.3

Have fun!
Attachments
f2fs-usb-installer-0.3-i686.pet
includes images but NOT syslinux bins, get 'em from PPM
(101.79 KiB) Downloaded 1227 times
Puppy Linux Blog - contact me for access

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

f2fs-usb-installer-0.3-i686.pet

#13 Post by ETP »

Hi 01Micko,

Using Upup-Precise 3.8.3.1 I produced a hybrid SDHC which booted rapidly on the same netbook. This was using just the simple syslinux.cfg code which I think you are quite right to go with as it utilises what is already in most pups, gives maximum BIOS compatibility and is probably enough for most users who just want to quickly get to the puppy desktop.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#14 Post by pemasu »

01micko. Almost in the topic. Eh...I am atm woofing Upup Ringtail. Do you have patch for gparted and ./configure options for gparted compile. I could give f2fs a try in Upup Ringtail....before it is up.up for upload.

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

#15 Post by 01micko »

Hello pemasu

EDIT: gparted-15.0 gives troubles so stick to 14.1, just did a quick build in PHAT, iirc I had no issue in Upup Here is a link I uploaded all you need <-- http://www.smokey01.com/01micko/src/

NOTE: to use slackbuild, make sure everything is in the same folder, including src and patches and just run "./gparted.SlackBuild", it's very easy.



------------------------------------------------------------------------------------------------------

old original post
VVVVVVVVVVVVV

Here is modified SlackBuild

Code: Select all

#!/bin/sh


# Copyright 2008, 2009, 2010, 2011, 2012  Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PKGNAM=gparted
VERSION=0.14.1
BUILD=${BUILD:-2}
TAG=${TAG:-_pmagic}

CWD=$(pwd)
TMP=$CWD
PKG=$CWD/package-$PKGNAM

ARCH="i486"
SLKCFLAGS="-Os -march=i486 -mtune=i686"

NUMJOBS=${NUMJOBS:-"-j2"}

rm -rf $PKG
mkdir -p $TMP $PKG

cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
cd $PKGNAM-$VERSION

chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \; -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \;

# Patch GParted to use exfat-utils
patch -p1 < ../pmagic-exfat.diff

# Patch GParted to for f2fs support
patch -p1 < ../pmagic-f2fs.diff

CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-doc \
--build=$ARCH-pc-linux-gnu
  
# Build and install:
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1

# Strip binaries:
( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
  xargs strip --strip-unneeded --remove-section=.note --remove-section=.comment 2> /dev/null
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
  xargs strip --strip-unneeded --remove-section=.note --remove-section=.comment 2> /dev/null
)

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
cd $CWD

## Cleanup
#rm -fr $PKG &> /dev/null
#rm -fr $CWD/$PKGNAM-$VERSION &> /dev/null

## What is actually included in Parted Magic
#rm -fr $CWD/pmagic_root &> /dev/null
#installpkg --root $CWD/pmagic_root $CWD/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz

#rm -fr $CWD/pmagic_root/{var,usr/sbin/gparted,usr/share/{applications,icons,man}}

## Parted Magic only supports these locales
#mv $CWD/pmagic_root/usr/share/locale $CWD/pmagic_root/usr/share/locale_old
#mkdir $CWD/pmagic_root/usr/share/locale
#for i in de en_US es fr it ja nb pl pt_BR ru zh_CN zh_TW; do
   #if [ -e $CWD/pmagic_root/usr/share/locale_old/$i ]; then
      #cp -af $CWD/pmagic_root/usr/share/locale_old/$i $CWD/pmagic_root/usr/share/locale
   #fi
#done
#rm -fr $CWD/pmagic_root/usr/share/locale_old

#rm -f $CWD/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
#cp -a pmagic_root $PKG
#mkdir -p $PKG/install
#cat $CWD/slack-desc > $PKG/install/slack-desc
#cd $PKG
#makepkg -l y -c n $CWD/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
#cd $CWD
## Cleanup
##rm -fr $PKG
##rm -fr pmagic_root
Just comment the "makepkg" stuff as you don't have it :P

Just cd into the source dir when built and run new2dir or do it manually in the packag-gparted generated directory.

Get patches and src from http://beefdrapes.partedmagic.com/source/gparted/ BUT notice they updated to gparted-15.0 a matter of days ago, so if you run into troubles I'll post 14.1 source. It built against your *mm static libs fine.


NOTE: to use slackbuild, make sure everything is in the same folder, including src and patches and just run "./gparted.SlackBuild", it's very easy.


HTH
Puppy Linux Blog - contact me for access

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#16 Post by pemasu »

Thanks 01micko. I will try it soon.
Cheers.

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

#17 Post by 01micko »

Thanks 01micko. I will try it soon.
Your welcome.

Looking forward to try the "raring ringtail pup". I'm guessing the name refers to ringtail possum which we used to see all the time when we were kids, but now are a bit rare... hmmmm, pun not intended!

When it's built I can see if I can make a triple boot f2fs stick! I can't see a problem.
Puppy Linux Blog - contact me for access

Post Reply