How to: Ubuntu & Debian debootstrap instalation

Moderators: mdrjr, odroid

How to: Ubuntu & Debian debootstrap instalation

Unread postby loboris » Mon Jan 05, 2015 2:31 am

I've created the script to install minimal ubuntu/debian system via debootstrap.

Last update: 2015-05-25 16:06 UTC
Download scripts package from: http://loboris.eu/makeodroid.tar.gz
Download images created with this script from: https://mega.co.nz/#F!p1lkwAAJ!Kli5oPaJNNfeAbVGw_Kpfg
  • Images with full desktop (Mate, Lubuntu) included.
  • Minimum SD Card size 1GB (minimal images), 4GB (desktop images).
  • Download, unpack and copy to sd card:
    Code: Select all
    unxz -k <image_name>.img.xz
    sudo dd if=<image_name>.img of=/dev/sdX bs=1M
    sudo sync
  • After booting remember to resize linux partition ( sudo fs_resize ).
  • Edit rc-local to set cpu frequency to 1.728 GHz.
  • Edit /media/boot/boot.ini according to your needs.

Overview:
  • makes complete Odroid-C1 SDCard image ready to be copied to SDCard
  • tested distributions: Ubuntu precise&trusty&utopic&vivid, Debian wheezy&jessie
  • installs basic debootstrap installation & some essential additional packages
  • automatic installation without user intervention needed
  • automatic creation of user account and user password
  • automatic localization (same as host or specified)
  • network works, ssh server installed
  • filesystem size less then 500 MB
  • initial RAM usage less then 40 MB
  • tricks to enable serial console, framebuffer console
  • using tmux (started automatically on logon) to provide cursor in framebuffer console
  • full desktop (LXDE/LUBUNTU/MATE) can be installed later (scripts included)
Options:
  • create image without fat partition, boot from ext4 partition
  • create btrfs formated filesystem with compression enabled
  • boot.ini has option to disable video and free more than 100MB of RAM, frame buffer is still usable (uses only 24MB RAM) (thanks tobetter)
  • xz compress image after creation and create md5summ
  • create filesystem in local directory, create image later using image_from_dir script
Tips:
  • uses Hardkernel's repository for kernel update
  • to resize partition to fit SDCard run:
    Code: Select all
    sudo fs_resize
  • you can use "format_sdcard" script to format sd card for Odroid Linux.
  • you can use "image_from_dir" script to create the image file from installation in local folder.
  • you can use "backup_sdcard" script to backup sdcard to local folder.
  • you can use "restore_sdcard" script to restore sdcard from backup folder.
  • :!: Edit rc-local to set cpu frequency to 1.728 GHz
  • For instructions how to include image in triple boot sd card (Android&Linux&OpenELEC) see
    http://forum.odroid.com/viewtopic.php?f=112&t=8740&p=68108#p68108

BUILD PROCEDURE:

Tested on Ubuntu Trusty/Utopic/Vivid and Debian Wheezy hosts (64bit).

Following packages must be installed on your host:
Code: Select all
sudo apt-get install debootstrap qemu-user-static

:!: Edit "params.sh" to configure the installation.

Script must be run as root (sudo) in script directory:
Code: Select all
sudo ./create_odroid_image

View "README.txt" and "params.sh", "create_odroid_image", "second-stage" scripts comments for more information.
All default passwords are odroid.

DESKTOP INSTALLATION:

  • Lubuntu/LXDE can be installed on any release by running:
    Code: Select all
    sudo install_lxde_desktop
    On Ubuntu 14.04 (trusty) it installs also mali drivers and kodi can be installed later (works great).

  • Mate Desktop can be installed on Ubuntu 15.04 (vivid) and on Debian jessie by running:
    Code: Select all
    sudo install_mate_desktop
    It installs full Mate Desktop with mali drivers.
    kodi can be installed later (works great).

    Tips:
    • If mali drivers are activated windows dragging is little slower (but usable). You can enable compositing, then everything is smooth.
      If compositing is enabled, you cannot use kodi (picture is transparrent), so for kodi, disable compositing.
    • You can test OpenGL ES2 running glmark2-es2 in terminal

Screenshot: http://loboris.eu/Odroid-jessie-minimal.png
Last edited by loboris on Tue May 26, 2015 4:29 pm, edited 54 times in total.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby ryecoaaron » Mon Jan 05, 2015 2:36 am

How did you get the framebuffer to work?
ryecoaaron
 
Posts: 98
Joined: Tue Dec 23, 2014 6:02 am
Location: Wisconsin
languages_spoken: english
ODROIDs: odroid-c1 x2, odroid-c2 x1, odroid-xu4 x3, cloudshell xu4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Mon Jan 05, 2015 2:43 am

echo 0 > /sys/devices/platform/mesonfb/graphics/fb1/blank
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby ryecoaaron » Mon Jan 05, 2015 3:04 am

Not sure why it is giving me a wget error since it is installed on the host system and in the apt-get install in the second-stage script. Output:

Code: Select all
ADD USER...
/second-stage: line 126: adduser: command not found
/second-stage: line 127: adduser: command not found
/second-stage: line 70: /home/odroid/.bashrc: No such file or directory
/second-stage: line 14: /etc/udev/rules.d/10-odroid.rules: No such file or directory
/second-stage: line 15: /etc/udev/rules.d/10-odroid.rules: No such file or directory
/second-stage: line 16: /etc/udev/rules.d/10-odroid.rules: No such file or directory
/second-stage: line 17: /etc/udev/rules.d/10-odroid.rules: No such file or directory
/second-stage: line 18: /etc/udev/rules.d/10-odroid.rules: No such file or directory
/second-stage: line 19: /etc/udev/rules.d/10-odroid.rules: No such file or directory
***********************************************************
*
FINISHED
*
***********************************************************
---------------------
Creating initramfs...
---------------------
/usr/local/bin/kernel_update: line 13: wget: command not found
/usr/local/bin/kernel_update: line 14: wget: command not found
/bin/cat: /tmp/kupdate/odroidc.tar.xz.md5sum: No such file or directory
/usr/bin/md5sum: /tmp/kupdate/odroidc.tar.xz: No such file or directory
Kernel downloaded
/usr/bin/xz: odroidc.tar.xz: No such file or directory
/bin/tar: odroidc.tar: Cannot open: No such file or directory
/bin/tar: Error is not recoverable: exiting now
/bin/rm: cannot remove `odroidc.tar': No such file or directory
/bin/rm: cannot remove `odroidc.tar.xz.md5sum': No such file or directory
*** Installing new kernel. Please wait. A backup and log will be saved on /root
/bin/cp: cannot stat `lib/*': No such file or directory
/bin/cp: cannot stat `boot/*': No such file or directory
/bin/ls: cannot access /boot/config-*: No such file or directory
/bin/cp: cannot stat `/boot/uInitrd-': No such file or directory
/bin/tar: Removing leading `/' from member names
/bin/tar: /lib/modules: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
/usr/local/bin/kernel_update: line 49: update-initramfs: command not found
/usr/local/bin/kernel_update: line 50: mkimage: command not found
mv: cannot stat `odroid-wheezy/media/boot/uInitrd': No such file or directory
cp: cannot stat `odroid-wheezy/boot/uImage': No such file or directory
cp: cannot stat `odroid-wheezy/boot/meson8b_odroidc.dtb': No such file or directory

===========================================================
== Odroid instalation finished.
ryecoaaron
 
Posts: 98
Joined: Tue Dec 23, 2014 6:02 am
Location: Wisconsin
languages_spoken: english
ODROIDs: odroid-c1 x2, odroid-c2 x1, odroid-xu4 x3, cloudshell xu4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby magnum_pi » Mon Jan 05, 2015 6:23 am

The links don't work for me, loboris. I allowed javascript, but it just gives a blank page.
magnum_pi
 
Posts: 198
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Mon Jan 05, 2015 6:54 am

Try new links in 1st post.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby magnum_pi » Mon Jan 05, 2015 7:00 am

Thanks, the last link (which is all I needed) worked for me. I tested the other new links and my browser popped up asking where to save, so I guess they work too.
magnum_pi
 
Posts: 198
Joined: Tue Mar 05, 2013 6:37 am
languages_spoken: English, Japanese, French, Irish
ODROIDs: U2, X2, XU, U3

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby woomg » Mon Jan 05, 2015 8:43 pm

May I remove some packages from 'second_stage' file like 'build-essential, git...etc'? What are the mandatory packages for building minimalistic image?
I want to create minimalistic image only bootup with ssh server.

Thanks,
woomg
 
Posts: 17
Joined: Thu Feb 27, 2014 3:42 pm
languages_spoken: english, korean
ODROIDs: ODROID U3/ODROID C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Mon Jan 05, 2015 9:02 pm

woomg wrote:May I remove some packages from 'second_stage' file like 'build-essential, git...etc'? What are the mandatory packages for building minimalistic image?
I want to create minimalistic image only bootup with ssh server.

Thanks,


I think you can remove build-essential, git, whiptail, wireless-tools, wpasupplicant, mc, htop, but you wont get match more free space
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby woomg » Mon Jan 05, 2015 9:20 pm

loboris wrote:I think you can remove build-essential, git, whiptail, wireless-tools, wpasupplicant, mc, htop, but you wont get match more free space


Thanks a lot, :D
woomg
 
Posts: 17
Joined: Thu Feb 27, 2014 3:42 pm
languages_spoken: english, korean
ODROIDs: ODROID U3/ODROID C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby dirtyrobinson » Sat Jan 10, 2015 1:54 pm

Will the debian jessie image work for an eMMC module as well? or just for sd cards?
dirtyrobinson
 
Posts: 36
Joined: Sun Jan 19, 2014 8:49 am
languages_spoken: english
ODROIDs: Odroid U3 & C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby tobetter » Sat Jan 10, 2015 2:03 pm

dirtyrobinson wrote:Will the debian jessie image work for an eMMC module as well? or just for sd cards?

+1, it will work. :)
User avatar
tobetter
 
Posts: 2411
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sun Jan 11, 2015 6:36 am

dirtyrobinson wrote:Will the debian jessie image work for an eMMC module as well? or just for sd cards?


Tested and works on SD card, eMMC, USB flash, USB HD.

Script updated.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby mscdex » Sun Jan 11, 2015 11:48 am

+10 Thanks for this, it worked great for building a minimal server image.
mscdex
 
Posts: 73
Joined: Sun Jan 04, 2015 11:09 am
languages_spoken: english
ODROIDs: ODROID C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby soeren » Wed Jan 14, 2015 2:18 am

the checksum of both img files are wrong. I downloaded several times but still wrong.
The images also do not boot. PowerLED red, but nothing else :(
soeren
 
Posts: 5
Joined: Wed Jan 14, 2015 2:09 am
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Wed Jan 14, 2015 5:17 am

soeren wrote:the checksum of both img files are wrong. I downloaded several times but still wrong.
The images also do not boot. PowerLED red, but nothing else :(

I just downloaded jessie image (Firefox), checksum ok., booted ok.

Code: Select all
md5sum debian-jessie-minimal.rar > xxx.md5
cmp debian-jessie-minimal.rar.md5 xxx.md5     ( no output, ok files equal)
unrar e debian-jessie-minimal.rar
sudo dd if=debian-jessie-minimal.img of=/dev/sdi bs=1M
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby soeren » Wed Jan 14, 2015 5:22 am

my fault :)

i checked the img. not the rar.

Thank you !
soeren
 
Posts: 5
Joined: Wed Jan 14, 2015 2:09 am
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby soeren » Wed Jan 14, 2015 6:46 am

i got it running, thank you very much, great work!
soeren
 
Posts: 5
Joined: Wed Jan 14, 2015 2:09 am
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Wed Jan 14, 2015 7:23 am

soeren wrote:i got it running, thank you very much, great work!

Great, what was the problem ?
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby soeren » Wed Jan 14, 2015 5:19 pm

I do not really know. when i just put in the power cable, the red LED turns on and nothing else happens.
But when I put it several times in (like if you short-circuiting a car :D ) the board boots up and the blue LED turns on, too.

I got my board yesterday and had just some time in the evening to test it. After I got it to run it worked about 2 hours without any problems.
First performance tests on nodejs and postgresql are promising.

Best regards
soeren
 
Posts: 5
Joined: Wed Jan 14, 2015 2:09 am
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby tobetter » Wed Jan 14, 2015 5:22 pm

soeren wrote:I do not really know. when i just put in the power cable, the red LED turns on and nothing else happens.
But when I put it several times in (like if you short-circuiting a car :D ) the board boots up and the blue LED turns on, too.

I got my board yesterday and had just some time in the evening to test it. After I got it to run it worked about 2 hours without any problems.
First performance tests on nodejs and postgresql are promising.

Best regards

Is your card SanDisk MicroSD?
User avatar
tobetter
 
Posts: 2411
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby BlueDroid » Wed Jan 14, 2015 7:20 pm

soeren wrote:I do not really know. when i just put in the power cable, the red LED turns on and nothing else happens.
But when I put it several times in (like if you short-circuiting a car :D ) the board boots up and the blue LED turns on, too.

Better keep your proof of ownership handy. If anyone catches sight of you hot wiring your C1 the police may show up & try to toss you in jail.
BlueDroid
 
Posts: 31
Joined: Mon Dec 15, 2014 5:02 pm
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby soeren » Thu Jan 15, 2015 12:54 am

SD Card is Sony microSDHC with UHS-I.

Today the same. I think it is a hardware issue. I am very interested if other C1 users have the same booting problem.
soeren
 
Posts: 5
Joined: Wed Jan 14, 2015 2:09 am
languages_spoken: english

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby tobetter » Thu Jan 15, 2015 1:03 am

soeren wrote:SD Card is Sony microSDHC with UHS-I.

Today the same. I think it is a hardware issue. I am very interested if other C1 users have the same booting problem.

I have not tested Sony MicroSD yet, but it would be possible having compatible issue if the card does not start immediately on power cycle. Please keep the MicroSD inserted about 40-60 seconds, if it would start again.
Just for reference, http://odroid.com/dokuwiki/doku.php?id= ... _selection
Last edited by tobetter on Thu Jan 15, 2015 1:04 am, edited 1 time in total.
User avatar
tobetter
 
Posts: 2411
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Thu Jan 15, 2015 1:03 am

soeren wrote:SD Card is Sony microSDHC with UHS-I.

Today the same. I think it is a hardware issue. I am very interested if other C1 users have the same booting problem.


I tested on SanDisk Ultra 8GB, no problem, and on old Lexar class 4 4GB, works ok, sometimes I have to wait 30 sec to boot.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Thu Jan 15, 2015 8:01 am

New:
- added option to create image without fat partition, boot from ext4 partition
- added Debian-wheezy server image with installed and tested packages:

parted btrfs-tools rsync aptitude shorewall nfs-kernel-server
apache2 php5 samba cifs-utils pure-ftpd
mysql-server phpmyadmin
firebird2.5-super php5-interbase
build-essential libssl-dev
webmin
node.js
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby meveric » Thu Jan 15, 2015 8:09 am

why so many packages preinstalled on a server image?
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9200
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Thu Jan 15, 2015 8:14 am

meveric wrote:why so many packages preinstalled on a server image?


That is what I need and install on most servers. It is just minimal image with installed and configured additional packages.
"Minimal-image" is, de facto, (minimal) server image.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby ryecoaaron » Thu Jan 15, 2015 8:19 am

I would call that a lamp image :)
ryecoaaron
 
Posts: 98
Joined: Tue Dec 23, 2014 6:02 am
Location: Wisconsin
languages_spoken: english
ODROIDs: odroid-c1 x2, odroid-c2 x1, odroid-xu4 x3, cloudshell xu4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby meveric » Thu Jan 15, 2015 8:23 am

but issn't installing a whole bunch of different programs that are probably useless to other people defeating the statement of a "minimal" image?
I have an XU running with a server image for over 3 months straight without a reboot.. and not a single of the programs you installed is on that image i use..
Just curious, why you put that stuff there.. but i guess if it's what you need..

ryecoaaron wrote:I would call that a lamp image :)

well i don't think Wheezy provides a LAMP package... (god bless them for that, since the lamp package is one of the stupiest things to install)

Edit:
ok i lied, i have shorewall installed.. that's actually a good thing to have :D
Last edited by meveric on Thu Jan 15, 2015 8:29 am, edited 1 time in total.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9200
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby ryecoaaron » Thu Jan 15, 2015 8:27 am

image not package :) I use nginx myself.
ryecoaaron
 
Posts: 98
Joined: Tue Dec 23, 2014 6:02 am
Location: Wisconsin
languages_spoken: english
ODROIDs: odroid-c1 x2, odroid-c2 x1, odroid-xu4 x3, cloudshell xu4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Thu Jan 15, 2015 8:35 am

meveric wrote:but issn't installing a whole bunch of different programs that are probably useless to other people defeating the statement of a "minimal" image?
I have an XU running with a server image for over 3 months straight without a reboot.. and not a single of the programs you installed is on that image i use..
Just curious, why you put that stuff there.. but i guess if it's what you need..

ryecoaaron wrote:I would call that a lamp image :)

well i don't think Wheezy provides a LAMP package... (god bless them for that, since the lamp package is one of the stupiest things to install)

Edit:
ok i lied, i have shorewall installed.. that's actually a good thing to have :D


"Minimal image" is the one created with my script. There two examples (utopic/jessie) in the 1st post for download.
You can easily create your own "minimal image" (it takes 15 minutes on my machine) and then install what you want/need.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby Technikfreak2002 » Thu Jan 15, 2015 8:06 pm

Hi @all!

Really nice work! downloded image and it works! Will test the script today!

Are there some news about hdmi audio?

@loboris: Thank you for this script!
Technikfreak2002
 
Posts: 30
Joined: Sun Dec 14, 2014 10:13 pm
languages_spoken: german, english (really bad)
ODROIDs: ODROID-C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby rockla » Fri Jan 16, 2015 3:17 am

Just want to confirm we just need to write the Debian Wheezy image to SD card and boot?
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Fri Jan 16, 2015 3:29 am

rockla wrote:Just want to confirm we just need to write the Debian Wheezy image to SD card and boot?


yes, we just need to write the Debian Wheezy image to SD card and boot !
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby rockla » Fri Jan 16, 2015 12:49 pm

Awesome , will flash Wheezy Server Image this in few days was worried that i have create partitions again but if image can handle it would be great first need to create a backup of my Ubuntu Image.

How would future kernel update happen ? And what is the current kernel version in the image ?
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Fri Jan 16, 2015 6:44 pm

rockla wrote:Awesome , will flash Wheezy Server Image this in few days was worried that i have create partitions again but if image can handle it would be great first need to create a backup of my Ubuntu Image.

How would future kernel update happen ? And what is the current kernel version in the image ?


You can upgrade the kernel from Hardkernel web site at any time running (as root):
Code: Select all
sudo kernel_upgrade web

or from local directory:
Code: Select all
sudo kernel_upgrade local <path_to_local_directory>

Local directory must contain files odroidc.tar.xz and odroidc.tar.xz.md5sum
Link to the script to build custom kernel from source and pack it to odroidc.tar.xz and odroidc.tar.xz.md5sum is in the first post.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby rockla » Fri Jan 16, 2015 7:47 pm

rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Fri Jan 16, 2015 9:41 pm

rockla wrote:kernel_update -> http://loboris.eu/make_kernel.sh ?

NO, "kernel_update" is the script included in the image (/usr/local/bin/kernel_update).
"make_kernel.sh" is the script to build custom kernel from source.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby rockla » Fri Jan 16, 2015 10:54 pm

Thanks , I was looking to seperate out Desktop apps from Ubuntu image but when i run below it produces a very long list and it has libtorrent which i had installed , safe to run ?

Code: Select all
apt-get remove --purge libx11-6 libgtk-3-common xkb-data


Its trying to remove this ?

libboost-filesystem1.54.0 libboost-regex1.54.0 l
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby Technikfreak2002 » Sat Jan 17, 2015 6:55 am

I've tested the script today and it works!

Maybe I found a lttle bug in the "second-stage" scripts when setting user password.
in this line you wrote $USERPASS:$USER. I thnk it schould be $USER:$USERPASS instead. Can you check this?

Again, thanks for this nice work!
Technikfreak2002
 
Posts: 30
Joined: Sun Dec 14, 2014 10:13 pm
languages_spoken: german, english (really bad)
ODROIDs: ODROID-C1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sat Jan 17, 2015 7:43 am

Technikfreak2002 wrote:I've tested the script today and it works!

Maybe I found a lttle bug in the "second-stage" scripts when setting user password.
in this line you wrote $USERPASS:$USER. I thnk it schould be $USER:$USERPASS instead. Can you check this?

Again, thanks for this nice work!

You are right, of course, thank you for noticing. Never noticed because I always used the same name and password.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby davidh2k » Sat Jan 17, 2015 8:24 am

We were running into trouble running the script on Debian Wheezy to debootstrap Debian Wheezy, the debootstrap isn't working from the script. I have no idea what is causing it because I grabbed the debootstrap command from your command, replaced the variables and it ran just fine...

Code: Select all
root@srv001:~/test/odroid/makeodroid# ./create-sdcard

Fri Jan 16 23:47:01 CET 2015
Creating Ubuntu/Debian SD Card instalation for Odroid-C1

Creating root filesistem in odroid-trusty...

DEBOOTSTRAP, FIRST STAGE
OK.
Creating "sources.list"
chroot: failed to run command `/usr/bin/qemu-arm-static': Not a directory
================================================
ERROR on second-stage, instalation NOT FINISHED.
================================================


Code: Select all
debootstrap --arch armhf --foreign --verbose --variant=minbase --include=wget wheezy odroid-trusty "http://ftp.us.debian.org/debian"


It's now installing the core packages...

The problem is that the inital debootstrap is missing? It can't find /bin/bash obviously cause it is not there the way the script works. But I admit that this may be caused due to Debian not beeing Ubuntu ;)

Code: Select all
root@srv001:~/test/odroid/makeodroid# chroot odroid-trusty/ /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/bash /second-stage
chroot: failed to run command `/usr/bin/qemu-arm-static': Not a directory


Greetings
David
davidh2k
 
Posts: 16
Joined: Fri Jan 09, 2015 2:19 am
languages_spoken: german, english
ODROIDs: c1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sat Jan 17, 2015 8:44 am

davidh2k wrote:We were running into trouble running the script on Debian Wheezy to debootstrap Debian Wheezy, the debootstrap isn't working from the script. I have no idea what is causing it because I grabbed the debootstrap command from your command, replaced the variables and it ran just fine...
.
.
.
Greetings
David

Is qemu-user-static installed on your system (/usr/bin/qemu-arm-static)?
If not, install it:
Code: Select all
sudo apt-get install qemu-user-static
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sat Jan 17, 2015 8:49 am

New version with many improvements available. See first post.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sat Jan 17, 2015 9:52 am

davidh2k wrote:We were running into trouble running the script on Debian Wheezy to debootstrap Debian Wheezy, the debootstrap isn't working from the script. I have no idea what is causing it because I grabbed the debootstrap command from your command, replaced the variables and it ran just fine...
...

Just tested on fresh Debian wheezy instalation + sudo apt-get install debootstrap qemu-user-static , no problem (with new script version).
Code: Select all
boris@debian:~/makeodroid$ sudo ./create_odroid_image
[sudo] password for boris:

Sub Sij 17 01:35:06 CET 2015
Creating Ubuntu/Debian SD Card instalation for Odroid-C1
========================================================

Using disk image "wheezy-minimal.img"
Creating bootable SD card image wheezy-minimal.img, please wait ...

Creating partition images, please wait ...

Creating new filesystem on wheezy-minimal.img...
  New filesystem created on SD card.

Partitioning SD card wheezy-minimal.img...
  Creating fat & ext4
  OK.

Formating fat partition ...
  fat partition formated.
Formating ext4 partition, please wait ...
  ext4 partition formated.

Instaling u-boot to wheezy-minimal.img ...
U-boot installed to wheezy-minimal.img.

Mounting SD Card partitions...
SD Card partitions mounted to linux-wheezy & boot-wheezy

DEBOOTSTRAP, FIRST STAGE
OK.                       
Creating "sources.list"
DEBOOTSTRAP, SECOND-STAGE
/second-stage: line 179: cannot redirect standard input from /dev/null: No such file or directory
OK.                       
Updating...
OK.                       
Upgrading...
OK.                       
Installing base packages...
OK.                       
Installing more packages...
OK.                       
Configuring...
CREATING root PASSWORD...
ADDING USER...
/bin/ln: failed to create symbolic link `/etc/systemd/system/getty.target.wants/getty@tty2.service': No such file or directory
/bin/ln: failed to create symbolic link `/etc/systemd/system/getty.target.wants/getty@tty2.service': No such file or directory

Instalation finished.


Installing kernel from: "web" and creating initramfs...

Downloading kernel from http://builder.mdrjr.net/kernel-3.10-c/00-LATEST ...
OK.                       
OK.                       
Kernel package ready.
Unpacking kernel...
*** Installing new kernel. Please wait. A backup and log will be saved on /root
 Backup old kernel modules and boot files...
OK.                       
 Remove old kernel modules and boot files...
 Copy new kernel to boot partition...
 Copy new kernel files to /lib and /boot...
** We are chrooted! **
 Creating initramfs ...
OK.                       
 Making uInitrd ...
OK.                       
 Copy uInitrd to boot partition ...
--- Log: ------------------------------------------
/bin/tar: Removing leading `/' from member names
/bin/tar: /lib/modules: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
update-initramfs: Generating /boot/initrd.img-3.10.43
/bin/df: Warning: cannot read table of mounted file systems: No such file or directory
warning: failed to read mtab
Image Name:   uInitrd 3.10.43
Created:      Sat Jan 17 00:45:39 2015
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    2565583 Bytes = 2505.45 kB = 2.45 MB
Load Address: 00000000
Entry Point:  00000000
---------------------------------------------------

Creating "fstab"
Creating "xorg.conf"
Creating "boot.ini"
Creating SDCard image

Sub Sij 17 01:45:47 CET 2015

************************************************************
Instalation finished.

You have bootable Odroid-C1 SD Card image "wheezy-minimal.img".
Use dd to copy to your SDCard
  e.g. sudo dd if=wheezy-minimal.img of=/dev/<your_sdcard> bs=1M

************************************************************
* For kernel update run:                                   *
*   sudo /usr/local/bin/kernel_update                      *
* -------------------------------------------------------- *
* To resize linux partition to fill sd card run:           *
*   sudo /usr/local/bin/fs_resize                          *
* -------------------------------------------------------- *
* To configure your local settings use:                    *
*   sudo dpkg-reconfigure tzdata                           *
*   sudo dpkg-reconfigure keyboard-configuration           *
*   sudo dpkg-reconfigure locales                          *
*   sudo dpkg-reconfigure console-setup                    *
*     #change your system's locale entries by modifying    *
*     #the file /etc/default/locale (e.g. en_US.UTF-8      *
*   sudo locale-gen <your_locale> (e.g en_US.UTF-8)        *
*   sudo dpkg-reconfigure locales                          *
************************************************************


boris@debian:~/makeodroid$
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby rockla » Sat Jan 17, 2015 1:46 pm

Cannot increase the partition size.

Code: Select all
root@OdroidC1:~# sudo fs_resize

Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
/dev/mmcblk0p1       3072 31115264 31112193 14.9G 83 Linux

  Max block: 31115264
   Part end: 31115264
 Part start: 3072
   Part num: 1

Partition allready maximum size !
root@OdroidC1:~# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  870M  442M  368M  55% /
udev             10M     0   10M   0% /dev
tmpfs           193M  9.3M  183M   5% /run
tmpfs           481M     0  481M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           481M     0  481M   0% /sys/fs/cgroup
tmpfs           481M     0  481M   0% /tmp


EDIT 1- The script was not working so i ran the command manually i guess the script is only for 2 partition images.

Code: Select all
root@OdroidC1:/usr/local/bin# resize2fs /dev/mmcblk0p1
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p1 is now 3889024 (4k) blocks long.

root@OdroidC1:/usr/local/bin# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G  467M   14G   4% /
udev             10M     0   10M   0% /dev
tmpfs           198M  9.3M  188M   5% /run
tmpfs           493M     0  493M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           493M     0  493M   0% /sys/fs/cgroup
tmpfs           493M     0  493M   0% /tmp


Does having 2 partitions provide better performance , the unpacking packages takes too long for me.
rockla
 
Posts: 224
Joined: Sat Dec 27, 2014 6:50 pm
languages_spoken: english
ODROIDs: C1,C2

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby loboris » Sat Jan 17, 2015 8:29 pm

rockla wrote:Cannot increase the partition size.
.
Does having 2 partitions provide better performance , the unpacking packages takes too long for me.

Script works with one or two partitions. You must REBOOT after running fs_resize, then resize2fs command will be executed automaticaly on start.
Number of partitions has no impact on performance.
loboris
 
Posts: 161
Joined: Sat Jan 03, 2015 12:07 am
languages_spoken: english
ODROIDs: C1, XU4

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby davidh2k » Sat Jan 17, 2015 11:01 pm

loboris wrote:Is qemu-user-static installed on your system (/usr/bin/qemu-arm-static)?
If not, install it:
Code: Select all
sudo apt-get install qemu-user-static


I made sure it is ;)

Greetings
David
davidh2k
 
Posts: 16
Joined: Fri Jan 09, 2015 2:19 am
languages_spoken: german, english
ODROIDs: c1

Re: Ubuntu/Debian minimal debootstrap instalation

Unread postby ryecoaaron » Sat Jan 17, 2015 11:31 pm

Any suggestions for this problem?

Code: Select all
SD Card partitions mounted to linux-wheezy & boot-wheezy

DEBOOTSTRAP, FIRST STAGE
OK.
Creating "sources.list"
DEBOOTSTRAP, SECOND-STAGE
/second-stage: line 179: cannot redirect standard input from /dev/null: No such file or directory
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
/debootstrap/debootstrap: line 359: /bin/cat: cannot execute binary file
please wait //second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/debootstrap/debootstrap: line 360: /bin/cat: cannot execute binary file
/second-stage: line 163: /bin/sleep: cannot execute binary file
/debootstrap/debootstrap: line 362: /bin/cat: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait //debootstrap/debootstrap: line 405: /bin/cat: cannot execute binary file
/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait -/debootstrap/debootstrap: line 410: /bin/uname: cannot execute binary file
/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait \/second-stage: line 163: /bin/sleep: cannot execute binary file
please wait |/second-stage: line 163: /bin/sleep: cannot execute binary file
ERROR.
*********************
** debootstrap ERROR.
*********************
================================================
ERROR on second-stage, instalation NOT FINISHED.
================================================


I checked the image and /bin/sleep is there and executable. /dev/null is also there.
ryecoaaron
 
Posts: 98
Joined: Tue Dec 23, 2014 6:02 am
Location: Wisconsin
languages_spoken: english
ODROIDs: odroid-c1 x2, odroid-c2 x1, odroid-xu4 x3, cloudshell xu4

Next

Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 2 guests