Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Install Script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
dinominant
Tux's lil' helper
Tux's lil' helper


Joined: 27 Oct 2006
Posts: 77

PostPosted: Tue Sep 12, 2017 5:17 am    Post subject: Gentoo Install Script Reply with quote

I've written a script which I use to automate most of the steps in the Gentoo handbook: https://github.com/nathanshearer/gentooinstall

Some of the key features I find most useful are:
  • Both stage3 hash and cryptographic verification (I always skipped those step during manual installs)
  • Foreign architecture support via qemu dynamic translation
  • An armbian2gentoo wrapper script that converts an armbian image into a clean gentoo image


Using the script is very simple:
Code:
# gentooinstall -d /mnt/gentoo -t "Canada/Mountain"

Code:
# gentooinstall -d /mnt/gentoo -a armv7hf -t "Canada/Mountain"

_________________
BTC: 18wdrw8sLtruvdwr5kB3RxbbxzjDeXUpRh
LTC: LYynwaSeBLb4gHaMnkB7NQ27H6wF3Fjyxo
Back to top
View user's profile Send private message
koprimer
n00b
n00b


Joined: 29 Feb 2004
Posts: 64

PostPosted: Tue Sep 12, 2017 5:34 am    Post subject: Reply with quote

nice script, thanks for sharing
Back to top
View user's profile Send private message
sheep204
n00b
n00b


Joined: 28 Dec 2005
Posts: 28

PostPosted: Tue Sep 19, 2017 1:06 pm    Post subject: Re: Gentoo Install Script Reply with quote

dinominant wrote:
I've written a script which I use to automate most of the steps in the Gentoo handbook: https://github.com/nathanshearer/gentooinstall

Some of the key features I find most useful are:
  • Both stage3 hash and cryptographic verification (I always skipped those step during manual installs)
  • Foreign architecture support via qemu dynamic translation
  • An armbian2gentoo wrapper script that converts an armbian image into a clean gentoo image


Using the script is very simple:
Code:
# gentooinstall -d /mnt/gentoo -t "Canada/Mountain"

Code:
# gentooinstall -d /mnt/gentoo -a armv7hf -t "Canada/Mountain"


thanks for share and does this script compile kernel automaticly?
Back to top
View user's profile Send private message
shrike
Tux's lil' helper
Tux's lil' helper


Joined: 20 Feb 2004
Posts: 115
Location: Closer to home

PostPosted: Wed Sep 20, 2017 1:38 pm    Post subject: Reply with quote

dinominant,

Cool idea, armbian2gentoo. Thanks!

I have tried it with and without the -a option but there are errors as shown below. As my scripting skills are poor I have no idea where the problem is.


Code:
nehalem ~/pine64/gentooinstall-master # /root/pine64/gentooinstall-master/armbian2gentoo -a armv8 -i https://dl.armbian.com/pine64/Ubuntu_xenial_dev_nightly.7z
Downloading the armbian image...
/tmp/armbian2gentoo.4274/armbian.7z                             100%[======================================================>] 228.55M  2.81MB/s    in 88s     
Extracting the armbian image... done.
Finding the root file system... done.
Increasing the size of the root file system (to accommodate the gentoo install)...
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop0: 54873/103584 files (0.1% non-contiguous), 294691/414208 blocks
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/loop0 to 2096640 (4k) blocks.
The filesystem on /dev/loop0 is now 2096640 (4k) blocks long.

Mounting the root filesystem at /tmp/armbian2gentoo.4274/root...
Moving armbian out of the way...
mv: cannot move '/tmp/armbian2gentoo.4274/root/oldroot' to a subdirectory of itself, '/tmp/armbian2gentoo.4274/root/oldroot/oldroot'
Installing Gentoo...

We are the Gentoo Community.
Power your systems and surrender your chips.
Your ideological and technological distinctiveness will be added to our own.
You will adapt to serve us.
Resistance is futile.

Downloading the stage 3 tarball...
Moving boot, fstab and the armbian kernel modules back into place...
mv: cannot move '/tmp/armbian2gentoo.4274/root/oldroot/etc/fstab' to '/tmp/armbian2gentoo.4274/root/etc/fstab': No such file or directory
Removing armbian...
Shrinking the root filesystem...
umount: /tmp/armbian2gentoo.4274/root/dev: mountpoint not found
umount: /tmp/armbian2gentoo.4274/root/proc: mountpoint not found
umount: /tmp/armbian2gentoo.4274/root/sys: mountpoint not found
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found.  Create? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/loop0: ***** FILE SYSTEM WAS MODIFIED *****
/dev/loop0: 921/509952 files (0.1% non-contiguous), 52567/2096640 blocks
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/loop0 to 29179 (4k) blocks.
Begin pass 2 (max = 19488)
Relocating blocks             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 64)
Scanning inode table          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 151)
Updating inode references     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/loop0 is now 29179 (4k) blocks long.

Shrinking the partition...


Thanks,

shrike
Back to top
View user's profile Send private message
dinominant
Tux's lil' helper
Tux's lil' helper


Joined: 27 Oct 2006
Posts: 77

PostPosted: Thu Sep 21, 2017 12:04 am    Post subject: Re: Gentoo Install Script Reply with quote

sheep204 wrote:
thanks for share and does this script compile kernel automaticly?

It does have a kernel phase which installs and compiles gentoo-sources with its default kernel options. I don't have a bootloader phase with efistub/lilo/grub yet so that still has to be done manually.

shrike wrote:
I have tried it with and without the -a option but there are errors as shown below. As my scripting skills are poor I have no idea where the problem is.

I've added some better output for the gentooinstall script related to aarch64 and arm64. Currently it's an unsupported architecture, but armv7hf should work on those platforms until arm64 is working. I was able to run this command on my x86_64 host (which has qemu dynamic translation setup and working already):
Code:
armbian2gentoo -i https://dl.armbian.com/orangepipc/Ubuntu_xenial_default.7z -o test.img -p stage3,stage3digest,stage3hash,extract,dynamictranslation,deletestage3,resolvconf,mountchroot,portage,timezone,locale,password

Code:
gentooinstall # ./armbian2gentoo -i https://dl.armbian.com/orangepipc/Ubuntu_xenial_default.7z -o test.img -p stage3,stage3digest,stage3hash,extract,dynamictranslation,deletestage3,resolvconf,mountchroot,portage,timezone,locale,password
Downloading the armbian image...
/tmp/armbian2gentoo.18682/armbian.7z         100%[=============================================================================================>] 218.38M  9.63MB/s    in 23s     
Extracting the armbian image... done.
Finding the root file system... done.
Increasing the size of the root file system (to accommodate the gentoo install)...
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop1: 48717/90432 files (0.1% non-contiguous), 255232/361472 blocks
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/loop1 to 2096128 (4k) blocks.
The filesystem on /dev/loop1 is now 2096128 (4k) blocks long.

Mounting the root filesystem at /tmp/armbian2gentoo.18682/root...
Moving armbian out of the way... done.
Installing Gentoo...

We are the Gentoo Community.
Power your systems and surrender your chips.
Your ideological and technological distinctiveness will be added to our own.
You will adapt to serve us.
Resistance is futile.

Downloading the stage 3 tarball...
/tmp/armbian2gentoo.18682/root/stage3-armv7a 100%[=============================================================================================>] 292.06M  14.6MB/s    in 23s     
/tmp/armbian2gentoo.18682/root/stage3-armv7a 100%[=============================================================================================>]   1.56K  --.-KB/s    in 0s     
Verifying the cryptographic signature of the stage3 hashes... Success.
Verifying the hash of the stage3 tarball... Success.
Extracting "/tmp/armbian2gentoo.18682/root/stage3-armv7a_hardfp-20161129.tar.bz2" to "/tmp/armbian2gentoo.18682/root"... Done.
Verifying kernel support for 'misc binaries'... Success.
Verifying that "/usr/bin/qemu-arm" is a static binary... Success.
Testing dynamic binary translation... Success.
Copying "/usr/bin/qemu-arm" into the installation to enable dynamic binary translation... Done.
Patching /etc/resolv.conf
!!! Section 'x-portage' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Section 'gentoo' in repos.conf has location attribute set to nonexistent directory: '/usr/portage'
!!! Invalid Repository Location (not a dir): '/usr/portage'
>>> Regenerating /etc/ld.so.cache...
!!! Invalid news item: /usr/portage/metadata/news/2017-08-19-hardened-sources-removal/2017-08-19-hardened-sources-removal.en.txt
!!!   line 5: News-Item-Format: 2.0
!!! Invalid news item: /usr/portage/metadata/news/2017-04-10-split-and-slotted-wine/2017-04-10-split-and-slotted-wine.en.txt
!!!   line 6: News-Item-Format: 2.0
!!! Invalid news item: /usr/portage/metadata/news/2017-07-16-systemd-rootprefix/2017-07-16-systemd-rootprefix.en.txt
!!!   line 5: News-Item-Format: 2.0

 * IMPORTANT: 11 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

>>> Regenerating /etc/ld.so.cache...


Configuring pkg...

 * Updating /etc/localtime with /usr/share/zoneinfo/UTC

>>> Regenerating /etc/ld.so.cache...
 * Generating locale-archive: forcing # of jobs to 1
 * Generating 2 locales (this might take a while) with 1 jobs
 *  (1/2) Generating en_US.ISO-8859-1 ...                                                                                                                                    [ ok ]
 *  (2/2) Generating en_US.UTF-8 ...                                                                                                                                         [ ok ]
 * Generation complete
Setting LANG to en_US.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
>>> Regenerating /etc/ld.so.cache...
BAD PASSWORD: it is based on a dictionary word
Moving boot, fstab and the armbian kernel modules back into place...
Removing armbian...
Shrinking the root filesystem...
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found.  Create? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/loop1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/loop1: 233313/482304 files (0.0% non-contiguous), 499963/2096128 blocks
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/loop1 to 986260 (4k) blocks.
Begin pass 2 (max = 150027)
Relocating blocks             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 64)
Scanning inode table          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 31981)
Updating inode references     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/loop1 is now 986260 (4k) blocks long.

Shrinking the partition...

_________________
BTC: 18wdrw8sLtruvdwr5kB3RxbbxzjDeXUpRh
LTC: LYynwaSeBLb4gHaMnkB7NQ27H6wF3Fjyxo
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
Page 1 of 1

 
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