Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[minihowto] Network bootable (no nfs) minimal livecd
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Wed Jun 10, 2020 6:33 pm    Post subject: Reply with quote

Pardon me for resurrecting such an old topic. I noticed there is a script that makes all the necessary changes with a single command.

https://wiki.gentoo.org/wiki/Installation_alternatives#Diskless_install_using_PXE_and_kernel.2Finitrd.2Fsquashfs_from_the_LiveCD

But the patch is more than a year old and no longer applies cleanly to the latest minimal iso image. I'd very much appreciate if someone more knowledgeable takes a look at "init" file and lets everyone know what changes are necessary.
__
sol
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Wed Jun 10, 2020 6:39 pm    Post subject: Reply with quote

Last time I did this (a couple of weeks ago), I just made the changes by hand, but here's a patch from that changes

Code:

--- init.old   2020-06-10 11:37:47.050888808 -0700
+++ init   2020-06-10 11:38:43.594721612 -0700
@@ -664,6 +664,10 @@
    if [ "${got_good_root}" != '1' ] && [ /dev/nfs != "${REAL_ROOT}" ] && [ sgimips != "${LOOPTYPE}" ] && [ 1 != "${aufs}" ] && [ 1 != "${overlayfs}" ]
    then
       bootstrapCD
+   elif [ "${REAL_ROOT}" = '/' ]
+   then
+      got_good_root=1
+      cp /image.squashfs ${CDROOT_PATH}
    fi
 
    if [ "${REAL_ROOT}" = '' ] && [ "${got_good_root}" != '1' ]
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Wed Jun 10, 2020 8:39 pm    Post subject: Reply with quote

Raffi wrote:
Last time I did this (a couple of weeks ago), I just made the changes by hand, but here's a patch from that changes

Code:

--- init.old   2020-06-10 11:37:47.050888808 -0700
+++ init   2020-06-10 11:38:43.594721612 -0700
@@ -664,6 +664,10 @@
    if [ "${got_good_root}" != '1' ] && [ /dev/nfs != "${REAL_ROOT}" ] && [ sgimips != "${LOOPTYPE}" ] && [ 1 != "${aufs}" ] && [ 1 != "${overlayfs}" ]
    then
       bootstrapCD
+   elif [ "${REAL_ROOT}" = '/' ]
+   then
+      got_good_root=1
+      cp /image.squashfs ${CDROOT_PATH}
    fi
 
    if [ "${REAL_ROOT}" = '' ] && [ "${got_good_root}" != '1' ]


That did the trick. Thank you.
One thing I noticed is that as long as I have "loop=/image.squashfs" (i.e. use absolute path), I don't need to copy "image.squashfs". In other words,

Code:
[pxelinux.cfg/default]

label gentoo
    kernel gentoo/gentoo
    append initrd=gentoo/gentoo.igz root=/dev/ram0 init=/linuxrc loop=/image.squashfs looptype=squashfs cdroot=1 real_root=/


Code:
[init]

if [ "${got_good_root}" != '1' ] && [ /dev/nfs != "${REAL_ROOT}" ] && [ sgimips != "${LOOPTYPE}" ] && [ 1 != "${aufs}" ] && [ 1 != "${overlayfs}" ]
then
    bootstrapCD
elif [ "${REAL_ROOT}" = '/' ]
then
    got_good_root=1
fi

__
sol


Last edited by solamour on Wed Jun 10, 2020 8:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
Raffi
l33t
l33t


Joined: 17 Mar 2003
Posts: 731
Location: Moscow, Id.

PostPosted: Wed Jun 10, 2020 8:44 pm    Post subject: Reply with quote

Since my iso is not what I put on my tftp site and is not available anywhere else, there would be no image.squashfs if I didn't copy it into the ramdisk.

One of these days I need to revisit this and see if there is a better way, but for now, every year or so, I update my network book and as long as I works, I've not really spent much time with it.
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Wed Jun 10, 2020 11:05 pm    Post subject: Reply with quote

As for me, the following step in the setup process must be the reason I could skip copying "image.squashfs" in init file.

Code:
# Copy in squashfs image
cp /mnt/loop/image.squashfs .


Anyhow, I wish there were a simpler way than manually updating it every so often, especially when the official documentation can get easily outdated.
__
sol
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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